Class MessageMatcher
java.lang.Object
org.hamcrest.BaseMatcher<T>
org.hamcrest.TypeSafeMatcher<org.faktorips.runtime.Message>
org.faktorips.testsupport.matchers.MessageMatcher
- All Implemented Interfaces:
org.hamcrest.Matcher<org.faktorips.runtime.Message>,org.hamcrest.SelfDescribing
- Direct Known Subclasses:
MessageCodeMatcher,MessageInvalidObjectMatcher,MessageMarkerMatcher,MessagePropertyMatcher,MessageSeverityMatcher
public abstract class MessageMatcher
extends org.hamcrest.TypeSafeMatcher<org.faktorips.runtime.Message>
A typesafe
Matcher for a Message.- Implementation Requirements:
- the methods
describeMessageProperty(Description)anddescribeMismatchedProperty(Message, Description)should only describe the matched property; they will be combined with a leading "a message that " when this matcher is used as is and embedded in more descriptive messages when used withand(MessageMatcher)or aMessageListMessageMatcheras created byIpsMatchers.hasMessages(Matcher...). - Since:
- 22.6
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionand(MessageMatcher other) Combines thisMessageMatcherwith anotherMessageMatchercreating aMessageMatcherthat only matches if both original matchers match.protected abstract voiddescribeMessageProperty(org.hamcrest.Description description) Adds the description of the property checked by this matcher to the given description.protected abstract voiddescribeMismatchedProperty(org.faktorips.runtime.Message message, org.hamcrest.Description mismatchDescription) Adds the description of the given message's actual value of the property checked by this matcher to the given description.protected voiddescribeMismatchSafely(org.faktorips.runtime.Message message, org.hamcrest.Description mismatchDescription) voiddescribeTo(org.hamcrest.Description description) Methods inherited from class org.hamcrest.TypeSafeMatcher
describeMismatch, matches, matchesSafelyMethods inherited from class org.hamcrest.BaseMatcher
_dont_implement_Matcher___instead_extend_BaseMatcher_, isNotNull, toString
-
Constructor Details
-
MessageMatcher
public MessageMatcher()
-
-
Method Details
-
describeTo
public void describeTo(org.hamcrest.Description description) - Implementation Note:
- uses
describeMessageProperty(Description)to describe the property the message should have
-
describeMessageProperty
protected abstract void describeMessageProperty(org.hamcrest.Description description) Adds the description of the property checked by this matcher to the given description. -
describeMismatchSafely
protected void describeMismatchSafely(org.faktorips.runtime.Message message, org.hamcrest.Description mismatchDescription) - Overrides:
describeMismatchSafelyin classorg.hamcrest.TypeSafeMatcher<org.faktorips.runtime.Message>- Implementation Note:
- uses
describeMismatchedProperty(Message, Description)to describe the property the actually has
-
describeMismatchedProperty
protected abstract void describeMismatchedProperty(org.faktorips.runtime.Message message, org.hamcrest.Description mismatchDescription) Adds the description of the given message's actual value of the property checked by this matcher to the given description. -
and
Combines thisMessageMatcherwith anotherMessageMatchercreating aMessageMatcherthat only matches if both original matchers match.
-