org.springframework.integration.test.matcher
Class PayloadAndHeaderMatcher

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

public class PayloadAndHeaderMatcher
extends org.hamcrest.BaseMatcher<Message<?>>

Matcher to make assertions about message equality easier. Usage:

 @Test
 public void testSomething() {
   Message expected = ...;
   Message result = ...;
   assertThat(result, sameExceptImmutableHeaders(expected));
 }
 
 @Factory
 public static Matcher> sameExceptImmutableHeaders(Message expected) {
   return new PayloadAndHeaderMatcher(expected);
 }
 


Method Summary
 void describeTo(org.hamcrest.Description description)
           
 boolean matches(java.lang.Object arg)
           
static org.hamcrest.Matcher<Message<?>> sameExceptIgnorableHeaders(Message<?> expected, java.lang.String... ignoreKeys)
           
 
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
 

Method Detail

sameExceptIgnorableHeaders

public static org.hamcrest.Matcher<Message<?>> sameExceptIgnorableHeaders(Message<?> expected,
                                                                          java.lang.String... ignoreKeys)

matches

public boolean matches(java.lang.Object arg)

describeTo

public void describeTo(org.hamcrest.Description description)