Class PayloadAndHeaderMatcher<T>

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

public final class PayloadAndHeaderMatcher<T> 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 PayloadAndHeaderMatcher(expected);
 }
 
 
Author:
Dave Syer, Artem Bilan, Gary Russell
  • Method Details

    • sameExceptIgnorableHeaders

      public static <P> PayloadAndHeaderMatcher<P> sameExceptIgnorableHeaders(Message<P> expected, String... ignoreKeys)
    • matches

      public boolean matches(Object arg)
    • describeTo

      public void describeTo(org.hamcrest.Description description)