public class MessageQueueMatcher<T> extends org.hamcrest.BaseMatcher<BlockingQueue<org.springframework.messaging.Message<?>>>
TestSupportBinder.
Expected usage is of the form (with appropriate static imports):
public class TransformProcessorApplicationTests {
@Autowired
@Bindings(TransformProcessor.class)
private Processor processor;
@Autowired
private MessageCollectorImpl messageCollector;
@Test
public void testUsingExpression() {
processor.input().send(new GenericMessage <Object>("hello"));
assertThat(messageCollector.forChannel(processor.output()), receivesPayloadThat(is("hellofoo")).within(10));
}
}
| Modifier and Type | Class and Description |
|---|---|
static class |
MessageQueueMatcher.Extractor<R,T>
A transformation to be applied to a received message before asserting, e.g.
to only inspect the payload.
|
| Constructor and Description |
|---|
MessageQueueMatcher(org.hamcrest.Matcher<T> delegate,
long timeout,
TimeUnit unit,
MessageQueueMatcher.Extractor<org.springframework.messaging.Message<?>,T> extractor) |
| Modifier and Type | Method and Description |
|---|---|
void |
describeMismatch(Object item,
org.hamcrest.Description description) |
void |
describeTo(org.hamcrest.Description description) |
MessageQueueMatcher<T> |
immediately() |
MessageQueueMatcher<T> |
indefinitely() |
boolean |
matches(Object item) |
static <P> MessageQueueMatcher<P> |
receivesMessageThat(org.hamcrest.Matcher<org.springframework.messaging.Message<P>> messageMatcher) |
static <P> MessageQueueMatcher<P> |
receivesPayloadThat(org.hamcrest.Matcher<P> payloadMatcher) |
MessageQueueMatcher<T> |
within(long timeout,
TimeUnit unit) |
public MessageQueueMatcher(org.hamcrest.Matcher<T> delegate, long timeout, TimeUnit unit, MessageQueueMatcher.Extractor<org.springframework.messaging.Message<?>,T> extractor)
public static <P> MessageQueueMatcher<P> receivesMessageThat(org.hamcrest.Matcher<org.springframework.messaging.Message<P>> messageMatcher)
public static <P> MessageQueueMatcher<P> receivesPayloadThat(org.hamcrest.Matcher<P> payloadMatcher)
public boolean matches(Object item)
public void describeMismatch(Object item, org.hamcrest.Description description)
describeMismatch in interface org.hamcrest.Matcher<BlockingQueue<org.springframework.messaging.Message<?>>>describeMismatch in class org.hamcrest.BaseMatcher<BlockingQueue<org.springframework.messaging.Message<?>>>public MessageQueueMatcher<T> within(long timeout, TimeUnit unit)
public MessageQueueMatcher<T> immediately()
public MessageQueueMatcher<T> indefinitely()
public void describeTo(org.hamcrest.Description description)
Copyright © 2019 Pivotal Software, Inc.. All rights reserved.