类 MatcherAssertionErrors


  • @Deprecated
    public abstract class MatcherAssertionErrors
    extends Object
    已过时。
    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).
    从以下版本开始:
    3.2
    作者:
    Rossen Stoyanchev, Sam Brannen
    • 方法详细资料

      • assertThat

        public static <T> void assertThat​(T actual,
                                          Matcher<T> matcher)
        已过时。
        Assert that the given matcher matches the actual value.
        类型参数:
        T - the static type accepted by the matcher
        参数:
        actual - the value to match against
        matcher - the matcher
      • assertThat

        public static <T> void assertThat​(String reason,
                                          T actual,
                                          Matcher<T> matcher)
        已过时。
        Assert that the given matcher matches the actual value.
        类型参数:
        T - the static type accepted by the matcher
        参数:
        reason - additional information about the error
        actual - the value to match against
        matcher - the matcher