assertj-assertions-generator icon indicating copy to clipboard operation
assertj-assertions-generator copied to clipboard

Feature: Generate alternative to `get` + `isNotNull`

Open reitzig opened this issue 5 years ago • 1 comments

Currently, we write:

assertThat(myValue.getMyProperty()).isNotNull()

Nicer would be:

assertThat(myValue).hasAnyMyProperty()

reitzig avatar Aug 17 '20 10:08 reitzig

It think #220 would be more general. Then, we could write:

assertThat(myValue).myProperty().isNotNull()

Which is good enough in many cases; of course, we couldn't get back to the original Assert once we "descend" into the one of the property.

reitzig avatar Aug 02 '24 10:08 reitzig