Class MessageMatcher

java.lang.Object
org.hamcrest.BaseMatcher<org.springframework.messaging.Message<?>>
org.springframework.integration.test.matcher.MessageMatcher
All Implemented Interfaces:
org.hamcrest.Matcher<org.springframework.messaging.Message<?>>, org.hamcrest.SelfDescribing

public class MessageMatcher extends org.hamcrest.BaseMatcher<org.springframework.messaging.Message<?>>
Matcher to make assertions about message equality easier. Usage:

&#064;Test
public void testSomething() {
  Message<String> expected = ...;
  Message<String> result = ...;
  assertThat(result, sameExceptImmutableHeaders(expected));
}

&#064;Factory
public static Matcher<Message<?>> sameExceptImmutableHeaders(Message<?> expected) {
  return new MessageMatcher(expected);
}

  • Constructor Summary

    Constructors
    Constructor
    Description
    MessageMatcher(org.springframework.messaging.Message<?> operand)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    describeTo(org.hamcrest.Description description)
     
    boolean
     

    Methods inherited from class org.hamcrest.BaseMatcher

    _dont_implement_Matcher___instead_extend_BaseMatcher_, describeMismatch, isNotNull, toString

    Methods inherited from class Object

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

    • MessageMatcher

      public MessageMatcher(org.springframework.messaging.Message<?> operand)
  • Method Details

    • matches

      public boolean matches(Object arg)
    • describeTo

      public void describeTo(org.hamcrest.Description description)