@Test
	public void testTapOnProxy() throws Exception {
		ModuleDefinition moduleDefinition = TestModuleDefinitions.dummy("testing", ModuleType.processor);
		Module module = mock(Module.class);
		when(module.getDescriptor()).thenReturn(new ModuleDescriptor.Builder()
				.setGroup("foo")
				.setIndex(1)
				.setModuleDefinition(moduleDefinition)
				.build());
		when(module.getComponent(MessageBus.class)).thenReturn(bus);
		when(module.getName()).thenReturn(moduleDefinition.getName());
		DirectChannel output = new DirectChannel();
		MessageChannel proxy = (MessageChannel) new ProxyFactory(output).getProxy();
		when(module.getComponent("output", MessageChannel.class)).thenReturn(proxy);
		plugin.postProcessModule(module);
		List<?> interceptors = TestUtils.getPropertyValue(output, "interceptors.interceptors", List.class);
		assertEquals(0, interceptors.size());

		// simulate addition of a tap consumer
		zkConnection.getClient().create().creatingParentsIfNeeded().forPath(
				Paths.build(Paths.TAPS, "stream:foo.testing.1"));
		Thread.sleep(1000);

		assertEquals(1, interceptors.size());
		assertTrue(interceptors.get(0) instanceof WireTap);
	}
@author Mark Fisher
@author Jennifer Hickey
@author Gary Russell
@author David Turanski
spring-xd-dirt/src/test/java/org/springframework/xd/dirt/plugins/stream/StreamPluginTests.java