SubscribableChannel test helper?
Does it exist something like muleClient in spring integration?
I would like to client.getResponse(subscribableChannel, timeout) so I can easily unit test fetching messages from channels.
At the moment I'm doing this (that is wrong in so many ways and wont probably work in a queued channel at all) :
expectedChannel.subscribe(new MessageHandler() {
@Override
public void handleMessage(Message<?> message) throws MessagingException {
assertThat(message, hasPayload(payload));
System.err.println("CALLED");
}
});
inputChannel.send(MessageBuilder.withPayload(paylo ad).build());
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}