Class MessageMatcher

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

public class MessageMatcher extends org.hamcrest.BaseMatcher<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);
 }
 
 
Author:
Dave Syer, Artem Bilan
  • Constructor Details

    • MessageMatcher

      public MessageMatcher(Message<?> operand)
  • Method Details

    • matches

      public boolean matches(Object arg)
    • describeTo

      public void describeTo(org.hamcrest.Description description)