@Test
	public void testCompositeSink() {
		ModuleDescriptor processor1Descriptor = new ModuleDescriptor.Builder()
				.setModuleDefinition(processor1Definition)
				.setGroup("compositesinkgroup")
				.build();
		ModuleDescriptor processor2Descriptor = new ModuleDescriptor.Builder()
				.setModuleDefinition(processor2Definition)
				.setGroup("compositesinkgroup")
				.build();
		ModuleDescriptor sinkDescriptor = new ModuleDescriptor.Builder()
				.setModuleDefinition(sinkDefinition)
				.setGroup("compositesinkgroup")
				.build();

		ModuleDefinition composed = ModuleDefinitions.composed("compositesink", ModuleType.sink,
				"processor1 | processor2 | sink",
				Arrays.asList(processor1Definition, processor2Definition, sinkDefinition));

		//parser results being reversed, we emulate here
		List<ModuleDescriptor> children = Arrays.asList(sinkDescriptor, processor2Descriptor, processor1Descriptor);
		ModuleDescriptor compositeDescriptor = new ModuleDescriptor.Builder()
				.setModuleDefinition(composed)
				.setGroup("compositesinkgroup")
				.addChildren(children)
				.setIndex(2)
				.build();
		Module module = moduleFactory.createModule(compositeDescriptor, deploymentProperties);
		assertTrue(module instanceof CompositeModule);
		assertEquals(sink, module.getType());
	}
@author Mark Fisher
@author David Turanski
@author Gary Russell
spring-xd-dirt/src/test/java/org/springframework/xd/dirt/module/CompositeModuleTests.java