-
Notifications
You must be signed in to change notification settings - Fork 16
Description
JUnit 4.13 is going to deprecate all APIs that use Hamcrest. This includes methods of both ErrorCollector and ExpectedException. Instead JUnit 5.0 will change the internal implementation to not use Hamcrest.
I'm looking for a way for Hamcrest to be able to extend both rules, e.g. add a expect(Matcher<? super Throwable>) method to ExpectedException or checkThat(T value, Matcher<? super T> matcher). Right now, all I can think of is hamcrest-junit providing subclasses for both rules or JUnit adding a functional interface, e.g. interface Check<T>{ void check(T value) throws AssertionError; }, instead of using Matcher<T> and hamcrest-junit adding an adapter, e.g. MatcherCheck<T> extends Check<T>.
Some of this has already been discussed over at junit-team/junit4#1150