Class ThrowableMessageMatcher<T extends Throwable>

java.lang.Object
org.hamcrest.BaseMatcher<T>
com.googlecode.catchexception.throwable.apis.internal.hamcrest.ThrowableMessageMatcher<T>
Type Parameters:
T - an throwable subclass
All Implemented Interfaces:
org.hamcrest.Matcher<T>, org.hamcrest.SelfDescribing

public class ThrowableMessageMatcher<T extends Throwable> extends org.hamcrest.BaseMatcher<T>
Creates a matcher that matches an throwable with a certain message.
  • Constructor Details

    • ThrowableMessageMatcher

      public ThrowableMessageMatcher(String expectedMessage)
      Instantiates a new throwable message matcher.
      Parameters:
      expectedMessage - the expected throwable message
    • ThrowableMessageMatcher

      public ThrowableMessageMatcher(org.hamcrest.Matcher<String> expectedMessageMatcher)
      Instantiates a new throwable message matcher.
      Parameters:
      expectedMessageMatcher - a string matcher that shall match the throwable message
  • Method Details

    • matches

      public boolean matches(Object obj)
    • describeTo

      public void describeTo(org.hamcrest.Description description)