Class MessageCodeMatcher

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

    public class MessageCodeMatcher
    extends org.hamcrest.TypeSafeMatcher<org.faktorips.runtime.Message>
    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)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void describeTo​(org.hamcrest.Description description)  
      protected boolean matchesSafely​(org.faktorips.runtime.Message m)  
      • Methods inherited from class org.hamcrest.TypeSafeMatcher

        describeMismatch, describeMismatchSafely, 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).
    • Method Detail

      • describeTo

        public void describeTo​(org.hamcrest.Description description)
      • matchesSafely

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