|
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.HeaderMatcher
public class HeaderMatcher
MessageHeaders
of a Message
containing any entry
or multiple that match?Assert.assertThat(Object, Matcher)
for a single
entry:ANY_HEADER_KEY = "foo"; ANY_HEADER_VALUE = "bar"; assertThat(message, hasEntry(ANY_HEADER_KEY, ANY_HEADER_VALUE)); assertThat(message, hasEntry(ANY_HEADER_KEY, is(String.class))); assertThat(message, hasEntry(ANY_HEADER_KEY, notNullValue())); assertThat(message, hasEntry(ANY_HEADER_KEY, is(ANY_HEADER_VALUE)));
Map<String, Object> expectedInHeaderMap = new HashMap<String, Object>(); expectedInHeaderMap.put(ANY_HEADER_KEY, ANY_HEADER_VALUE); expectedInHeaderMap.put(OTHER_HEADER_KEY, is(OTHER_HEADER_VALUE)); assertThat(message, HeaderMatcher.hasAllEntries(expectedInHeaderMap));
ANY_HEADER_KEY = "foo"; assertThat(message, HeaderMatcher.hasKey(ANY_HEADER_KEY));
Method Summary | ||
---|---|---|
void |
describeTo(org.hamcrest.Description description)
|
|
static org.hamcrest.Matcher<Message<?>> |
hasAllHeaders(Map<String,?> entries)
|
|
static
|
hasCorrelationId(T value)
|
|
static org.hamcrest.Matcher<Message<?>> |
hasExpirationDate(Date value)
|
|
static org.hamcrest.Matcher<Message<?>> |
hasExpirationDate(org.hamcrest.Matcher<Long> matcher)
|
|
static
|
hasHeader(String key,
org.hamcrest.Matcher<?> valueMatcher)
|
|
static
|
hasHeader(String key,
T value)
|
|
static
|
hasHeaderKey(String key)
|
|
static
|
hasMessageId(T value)
|
|
static org.hamcrest.Matcher<Message<?>> |
hasSequenceNumber(Integer value)
|
|
static org.hamcrest.Matcher<Message<?>> |
hasSequenceNumber(org.hamcrest.Matcher<Integer> matcher)
|
|
static org.hamcrest.Matcher<Message<?>> |
hasSequenceSize(Integer value)
|
|
static org.hamcrest.Matcher<Message<?>> |
hasSequenceSize(org.hamcrest.Matcher<Integer> value)
|
|
static org.hamcrest.Matcher<Message<?>> |
hasTimestamp(Date value)
|
|
static org.hamcrest.Matcher<Message<?>> |
hasTimestamp(org.hamcrest.Matcher<Long> matcher)
|
|
boolean |
matches(Object item)
Method made final to prevent accidental override. |
|
boolean |
matchesSafely(Message<?> item)
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<?> item)
public void describeTo(org.hamcrest.Description description)
public static <T> org.hamcrest.Matcher<Message<?>> hasHeader(String key, T value)
public static <T> org.hamcrest.Matcher<Message<?>> hasHeader(String key, org.hamcrest.Matcher<?> valueMatcher)
public static <T> org.hamcrest.Matcher<Message<?>> hasHeaderKey(String key)
public static org.hamcrest.Matcher<Message<?>> hasAllHeaders(Map<String,?> entries)
public static <T> org.hamcrest.Matcher<Message<?>> hasMessageId(T value)
public static <T> org.hamcrest.Matcher<Message<?>> hasCorrelationId(T value)
public static org.hamcrest.Matcher<Message<?>> hasSequenceNumber(Integer value)
public static org.hamcrest.Matcher<Message<?>> hasSequenceNumber(org.hamcrest.Matcher<Integer> matcher)
public static org.hamcrest.Matcher<Message<?>> hasSequenceSize(Integer value)
public static org.hamcrest.Matcher<Message<?>> hasSequenceSize(org.hamcrest.Matcher<Integer> value)
public static org.hamcrest.Matcher<Message<?>> hasExpirationDate(Date value)
public static org.hamcrest.Matcher<Message<?>> hasExpirationDate(org.hamcrest.Matcher<Long> matcher)
public static org.hamcrest.Matcher<Message<?>> hasTimestamp(Date value)
public static org.hamcrest.Matcher<Message<?>> hasTimestamp(org.hamcrest.Matcher<Long> matcher)
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 |