-
Why is the convenient What are the reasons behind that decision? AssertJ 3.25.3 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It's mostly a design decision to draw a clear line for maintenance. In short, Given that About verbosity, a static import can of course help: asInstanceOf(LIST) However, I agree |
Beta Was this translation helpful? Give feedback.
It's mostly a design decision to draw a clear line for maintenance.
In short,
asList
is a historical method introduced beforeasInstanceOf
/InstanceOfAssertFactories
were available.Given that
asList
is not type-safe (#3105) and many other related methods are not offered today (#1020), we wanted to draw the line knowing that we provide over 80 base factories plus more than 20 type-safe ones withInstanceOfAssertFactories
.About verbosity, a static import can of course help:
However, I agree
InstanceOfAssertFactory
tends to be verbose so we'll look at improving the naming in version 4 (#3425).