Thanks Oleg
For example you mean JdbcMessageStoreChannelIntegrationTests ?
Any plans to make something like that pattern part of a spring-integration-test utility at some point?
I'm thinking something like -
I register the number of messages I expect to be produced and a set of channels that should recieve output messages with the PipelineTestUtil, and the test utility registers a handler on each of the channels. The handler would look something like the JdbcMessageStoreChannelIntegrationTests#Service.
I start the pipeline/context/inbound-adapter and then call await(however-long-i-think-it-should-take) on the utility. Assuming test doesn't timeout I can get the messages from each channel that I registered an interest in and check the results..
eg :
Code:
pipelineTestUtil.setExpectedMessages(no-of-messages-I-expect)
pipelineTestUtil.registerOutputChannels(channelsThatShouldGetOutputs);
startThePipeline(); // maybe pipelineTestUtil.startThePipeline()
try{
pipelineTestUtil.await(how-long-it-should-take);
List<Messages<?>> messagesToCheck = pipelineTestUtil.getMessagesFromChannel(name-of-one-of-output-channels)
} catch
....