|
Spring Integration | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.hamcrest.BaseMatcher<T> org.springframework.integration.test.matcher.PayloadMatcher
public class PayloadMatcher
Message
equal to a given value or is matching
a given matcher?Assert.assertThat(Object, Matcher)
could look
like this to test a payload value:ANY_PAYLOAD = new BigDecimal("1.123"); Message<BigDecimal message = MessageBuilder.withPayload(ANY_PAYLOAD).build(); assertThat(message, hasPayload(ANY_PAYLOjAD));
Assert.assertThat(Object, Matcher)
delegating to
another Matcher
.ANY_PAYLOAD = new BigDecimal("1.123"); assertThat(message, PayloadMatcher.hasPayload(is(BigDecimal.class))); assertThat(message, PayloadMatcher.hasPayload(notNullValue())); assertThat(message, not((PayloadMatcher.hasPayload(is(String.class))))); *
Method Summary | ||
---|---|---|
void |
describeTo(org.hamcrest.Description description)
|
|
static
|
hasPayload(org.hamcrest.Matcher<T> payloadMatcher)
|
|
static
|
hasPayload(T payload)
|
|
boolean |
matches(Object item)
Method made final to prevent accidental override. |
|
boolean |
matchesSafely(Message<?> message)
Subclasses should implement this. |
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 |
---|
public boolean matchesSafely(Message<?> message)
public void describeTo(org.hamcrest.Description description)
public static <T> org.hamcrest.Matcher<Message<?>> hasPayload(T payload)
public static <T> org.hamcrest.Matcher<Message<?>> hasPayload(org.hamcrest.Matcher<T> payloadMatcher)
public final boolean matches(Object item)
BaseMatcher
.
|
Spring Integration | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |