Class MatcherAssertionErrors


  • @Deprecated
    public abstract class MatcherAssertionErrors
    extends Object
    Deprecated.
    as of Spring 4.2, in favor of the original MatcherAssert class with JUnit 4.9 / Hamcrest 1.3
    A replacement of MatcherAssert that removes the need to depend on "hamcrest-all" when using Hamcrest 1.1 and also maintains backward compatibility with Hamcrest 1.1 (also embedded in JUnit 4.4 through 4.8).
    Since:
    3.2
    Author:
    Rossen Stoyanchev, Sam Brannen
    • Method Detail

      • assertThat

        public static <T> void assertThat​(T actual,
                                          Matcher<T> matcher)
        Deprecated.
        Assert that the given matcher matches the actual value.
        Type Parameters:
        T - the static type accepted by the matcher
        Parameters:
        actual - the value to match against
        matcher - the matcher
      • assertThat

        public static <T> void assertThat​(String reason,
                                          T actual,
                                          Matcher<T> matcher)
        Deprecated.
        Assert that the given matcher matches the actual value.
        Type Parameters:
        T - the static type accepted by the matcher
        Parameters:
        reason - additional information about the error
        actual - the value to match against
        matcher - the matcher