Class MessageMatcher
java.lang.Object
org.hamcrest.BaseMatcher<org.springframework.messaging.Message<?>>
org.springframework.integration.test.matcher.MessageMatcher
- All Implemented Interfaces:
org.hamcrest.Matcher<org.springframework.messaging.Message<?>>,org.hamcrest.SelfDescribing
public class MessageMatcher
extends org.hamcrest.BaseMatcher<org.springframework.messaging.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 MessageMatcher(expected);
}
-
Constructor Summary
Constructors Constructor Description MessageMatcher(org.springframework.messaging.Message<?> operand) -
Method Summary
Modifier and Type Method Description voiddescribeTo(org.hamcrest.Description description)booleanmatches(java.lang.Object arg)
-
Constructor Details
-
MessageMatcher
public MessageMatcher(org.springframework.messaging.Message<?> operand)
-
-
Method Details
-
matches
public boolean matches(java.lang.Object arg) -
describeTo
public void describeTo(org.hamcrest.Description description)
-