Skip to content

The future of ErrorCollector and ExpectedException #11

@marcphilipp

Description

@marcphilipp

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

@npryce @sf105 I'm looking for your opinion on this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions