@Before
	public void before() {
		ModuleDefinition sinkDefinition = TestModuleDefinitions.dummy("sink", ModuleType.sink);
		ModuleDefinition sourceDefinition = TestModuleDefinitions.dummy("source", ModuleType.source);

		ArrayList<ModuleDefinition> definitions = new ArrayList<ModuleDefinition>();
		definitions.add(TestModuleDefinitions.dummy("source", ModuleType.source));
		when(moduleRegistry.findDefinitions("source")).thenReturn(definitions);
		when(moduleRegistry.findDefinitions("time")).thenReturn(definitions);
		when(moduleRegistry.findDefinition("time", ModuleType.source)).thenReturn(sourceDefinition);

		definitions = new ArrayList<ModuleDefinition>();
		definitions.add(TestModuleDefinitions.dummy("sink", ModuleType.sink));
		when(moduleRegistry.findDefinitions("sink")).thenReturn(definitions);
		when(moduleRegistry.findDefinitions("log")).thenReturn(definitions);
		when(moduleRegistry.findDefinition("log", ModuleType.sink)).thenReturn(sinkDefinition);

		definitions = new ArrayList<ModuleDefinition>();
		definitions.add(TestModuleDefinitions.dummy("processor", ModuleType.processor));
		when(moduleRegistry.findDefinitions("processor")).thenReturn(definitions);
	}
Tests REST compliance of streams-related end-points. Unlike {@link StreamsControllerIntegrationTests}, instead of
mocks, this class provides access to actual repositories: {@link ZooKeeperStreamRepository} and
{@link ZooKeeperStreamDefinitionRepository}.

@author Gunnar Hillert
@author Glenn Renfro
@author David Turanski
@author Florent Biville
spring-xd-dirt/src/test/java/org/springframework/xd/dirt/rest/StreamsControllerIntegrationWithRepositoryTests.java