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:
@Test
public void testSomething() {
Message<String> expected = ...;
Message<String> result = ...;
assertThat(result, sameExceptImmutableHeaders(expected));
}
@Factory
public static Matcher<Message<?>> sameExceptImmutableHeaders(Message<?> expected) {
return new PayloadAndHeaderMatcher(expected);
}
- Author:
- Dave Syer, Artem Bilan, Gary Russell
-
Method Summary
Modifier and Type Method Description void
describeTo(org.hamcrest.Description description)
boolean
matches(Object arg)
static <P> PayloadAndHeaderMatcher<P>
sameExceptIgnorableHeaders(Message<P> expected, String... ignoreKeys)
-
Method Details
-
sameExceptIgnorableHeaders
public static <P> PayloadAndHeaderMatcher<P> sameExceptIgnorableHeaders(Message<P> expected, String... ignoreKeys) -
matches
-
describeTo
public void describeTo(org.hamcrest.Description description)
-