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
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 TypeMethodDescriptionvoid
describeTo
(org.hamcrest.Description description) boolean
static <P> PayloadAndHeaderMatcher<P>
sameExceptIgnorableHeaders
(Message<P> expected, String... ignoreKeys) Methods inherited from class org.hamcrest.BaseMatcher
_dont_implement_Matcher___instead_extend_BaseMatcher_, describeMismatch, isNotNull, toString
-
Method Details
-
sameExceptIgnorableHeaders
public static <P> PayloadAndHeaderMatcher<P> sameExceptIgnorableHeaders(Message<P> expected, String... ignoreKeys) -
matches
-
describeTo
public void describeTo(org.hamcrest.Description description)
-