@Test
	public void testProcessingChain() {
		String processingChainUnderTest = "transform --expression='payload.toUpperCase()' | filter --expression='payload.length() > 4'";
		String streamDefinition = "queue:producer >" + processingChainUnderTest + "> queue:consumer";
		String streamName = "test";

		StreamDefinition testStream = new StreamDefinition(streamName, streamDefinition);
		integrationSupport.createAndDeployStream(testStream);

		MessageBus messageBus = integrationSupport.messageBus();

		NamedChannelSource source = new SingleNodeNamedChannelSourceFactory(messageBus).createNamedChannelSource("queue:producer");
		NamedChannelSink sink = new SingleNodeNamedChannelSinkFactory(messageBus).createNamedChannelSink("queue:consumer");

		source.sendPayload("hello");
		String result = (String) sink.receivePayload(RECEIVE_TIMEOUT);
		assertEquals("HELLO", result);

		source.sendPayload("a");
		result = (String) sink.receivePayload(RECEIVE_TIMEOUT);
		assertNull(result);

		source.unbind();
		sink.unbind();

		assertTrue("stream " + testStream.getName() + "not undeployed",
				integrationSupport.undeployAndDestroyStream(testStream));
	}
What a Module/Stream developer might write to test a processing chain.

@author David Turanski
spring-xd-dirt/src/test/java/org/springframework/xd/dirt/stream/ExampleProcessingChainTests.java