JavaHamcrest
JavaHamcrest copied to clipboard
FeatureMatcher factory method for java 8 users
This simple addition allows users on java 8 to do this:
FeatureMatcher.ofFunction(Thing::calculateName, containsString("foo"), "calculated name contains foo", "calculateName")
instead of
new FeatureMatcher(containsString("foo"), "calculated name contains foo", "calculateName") {
@Override
protected String featureValueOf(Thing actual) {
return actual.calculateName();
}
}
Less verbose/more concise, more pleasant to work with, and does not require hamcrest to be updated to java 8 or anything.
@leaumar looking at getting java 8, 11 and newer support into hamcrest, please can you rebase from master, as hamcrest-core and hamcrest-library have been refactored a lot and also deprecated, so that everything is just in hamcrest.
Going to try and kick start hamcrest, so if you want to get it merged, please rebase from the branch feature/v3.x-ea.
Still trying to understand how has permissions to perform a release.
Looking to keep v2.x as java 7, with v3 bumping to java 8.