Class MessageCodeMatcher

  • All Implemented Interfaces:
    org.hamcrest.Matcher<org.faktorips.runtime.Message>, org.hamcrest.SelfDescribing

    public class MessageCodeMatcher
    extends MessageMatcher
    Matches a Message if it's message code is the given messageCode.
    • Constructor Summary

      Constructors 
      Constructor Description
      MessageCodeMatcher​(java.lang.String messageCode)  
      MessageCodeMatcher​(java.lang.String messageCode, boolean expectMessage)  
      MessageCodeMatcher​(org.hamcrest.Matcher<java.lang.String> messageCodeMatcher)  
      MessageCodeMatcher​(org.hamcrest.Matcher<java.lang.String> messageCodeMatcher, boolean expectMessage)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void describeMessageProperty​(org.hamcrest.Description description)
      Adds the description of the property checked by this matcher to the given description.
      protected 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.
      protected boolean matchesSafely​(org.faktorips.runtime.Message message)  
      • Methods inherited from class org.hamcrest.TypeSafeMatcher

        describeMismatch, matches
      • Methods inherited from class org.hamcrest.BaseMatcher

        _dont_implement_Matcher___instead_extend_BaseMatcher_, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • MessageCodeMatcher

        public MessageCodeMatcher​(@CheckForNull
                                  java.lang.String messageCode)
        Parameters:
        messageCode - the expected message code
      • MessageCodeMatcher

        public MessageCodeMatcher​(@CheckForNull
                                  java.lang.String messageCode,
                                  boolean expectMessage)
        Parameters:
        messageCode - the expected message code
        expectMessage - whether a message is expected. true if a message is expected, false if no message with the given message code is expected (negates result).
      • MessageCodeMatcher

        public MessageCodeMatcher​(org.hamcrest.Matcher<java.lang.String> messageCodeMatcher)
        Parameters:
        messageCodeMatcher - a Matcher for the message code
      • MessageCodeMatcher

        public MessageCodeMatcher​(org.hamcrest.Matcher<java.lang.String> messageCodeMatcher,
                                  boolean expectMessage)
        Parameters:
        messageCodeMatcher - a Matcher for the message code
        expectMessage - whether a message is expected. true if a message is expected, false if no message matched by the given message is expected (negates result).
    • Method Detail

      • describeMessageProperty

        protected void describeMessageProperty​(org.hamcrest.Description description)
        Description copied from class: MessageMatcher
        Adds the description of the property checked by this matcher to the given description.
        Specified by:
        describeMessageProperty in class MessageMatcher
      • describeMismatchedProperty

        protected void describeMismatchedProperty​(org.faktorips.runtime.Message message,
                                                  org.hamcrest.Description mismatchDescription)
        Description copied from class: MessageMatcher
        Adds the description of the given message's actual value of the property checked by this matcher to the given description.
        Specified by:
        describeMismatchedProperty in class MessageMatcher
      • matchesSafely

        protected boolean matchesSafely​(org.faktorips.runtime.Message message)
        Specified by:
        matchesSafely in class org.hamcrest.TypeSafeMatcher<org.faktorips.runtime.Message>