New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
extracting(Function...)
propagates Object
instead of the common base type of all extractors
#3372
Comments
Have you given a try to extracting(String propertyOrField, InstanceOfAssertFactory) or asInstanceOf ? Should look like // ... import static InstanceOfAssertFactories.STRING
assertThat(v010)
.extracting(Semver::getVersion, Semver::toString)
.allSatisfy(o -> assertThat(o).asInstanceOf(STRING).matches("^0\\.1\\.0-SNAPSHOT-1-g\\p{XDigit}{7}$")); |
What you're looking for is probably However, there could be a way to make |
extracting(Function...)
does not allow type propagation when all extractors produce the same base type
extracting(Function...)
does not allow type propagation when all extractors produce the same base typeextracting(Function...)
propagates Object
instead of the common base type of all extractors
both things sound great, hadn't heard of |
recommendtion from assertj/assertj#3372
@xenoterracide shall we close this issue or is there something more to discuss? |
I would keep it open to see if we can do something cheap like in #1551. |
^ same |
recommendtion from assertj/assertj#3372
Feature summary
So, I'm noticing that my attempts to validate that this
toString()
andgetVersion
are returning the same thing is kind of painful.Example
The text was updated successfully, but these errors were encountered: