Hi,
just an idea, similar to AbstractAssert.asList(), AbstractAssert could have asOptional, asMap, ... returning the respective specialized Assertions instance.
I think this is particularly useful in combination with .extracting()
Also, I wonder if asList() could be extended to take a class as argument like:
assertThat(listAsObject).asList(Integer.class).allMatch(v -> v > 10);
asList(Class) is something we can do but I'm worried adding all the other ones will clutter the API, especially if code completion shows assertion alphabetically, users will have to scroll after all asXXX methods to discover the API.
I'm ok to add the main ones as a per request basis (for example I would not add asBoolean )
I'm saying (more or less) the same thing in https://github.com/joel-costigliola/assertj-core/issues/167#issuecomment-33899613
How about changing the isInstanceOf & isExactlyInstanceOf signatures to cast?
Plus one to asMap().
I believe you have been heard in https://github.com/joel-costigliola/assertj-core/pull/1498 ;-)
Hi @tkruse, could you check if asInstanceOf satisfies your requirements?
yes, seems this can be closed.
Most helpful comment
yes, seems this can be closed.