Package org.hamcrest

Class MatcherAssert

java.lang.Object
org.hamcrest.MatcherAssert

public class MatcherAssert extends Object
The Hamcrest entrypoint, static methods to check if matchers match a given value.
  • Method Details

    • assertThat

      public static <T> void assertThat(T actual, Matcher<? super T> matcher)
      Checks that a value matches a matcher
      Type Parameters:
      T - the type of the value
      Parameters:
      actual - the value to check
      matcher - the matcher
    • assertThat

      public static <T> void assertThat(String reason, T actual, Matcher<? super T> matcher)
      Checks that a value matches a matcher
      Type Parameters:
      T - the type of the value
      Parameters:
      reason - a description of what is being matched
      actual - the value to check
      matcher - the matcher
    • assertThat

      public static void assertThat(String reason, boolean assertion)
      Checks that an assertion is true
      Parameters:
      reason - a description of what is being checked
      assertion - the result of the check