### Question:
PythianTopology { public void build(PythianToplogyConfiguration topologyConfiguration) { componentPool.addConnections(topologyConfiguration.getConnections()); componentPool.addComponents(topologyConfiguration.getComponents()); while (!componentPool.isEmpty()) { ComponentConfiguration configuration = componentPool.getAvailableComponent(); if (configuration != null) { Map<String, Stream> inputStreams = componentPool.getAvailableInputStreams(configuration); Map<String, StateFactory> componentStateFactories = pythianStateFactory.createStateFactories(configuration); Component component = componentFactory.createComponent(configuration, componentStateFactories, inputStreams); componentPool.registerBuildedComponent(component, configuration); } else { throw new IllegalArgumentException("Unable to create topology, some connections are missing"); } } } PythianTopology(); void build(PythianToplogyConfiguration topologyConfiguration); StormTopology getStormTopology(); Config getTridentConfig();  }### Answer:
@Test public void should_create_components() { String componentId = randomAlphabetic(6); PythianToplogyConfiguration topologyConfiguration = mock(PythianToplogyConfiguration.class); ComponentConfiguration componentConfiguration = mock(ComponentConfiguration.class); when(componentConfiguration.getId()).thenReturn(componentId); when(topologyConfiguration.getComponents()).thenReturn(asList(componentConfiguration)); Map<String, StateFactory> expectedStateFactories = new HashMap<>(); Component component = mock(Component.class); Map<String, Stream> inputStreams = new HashMap<>(); when(componentPool.isEmpty()).thenReturn(false, true); when(componentPool.getAvailableComponent()).thenReturn(componentConfiguration); when(componentPool.getAvailableInputStreams(componentConfiguration)).thenReturn(inputStreams); when(pythianStateFactory.createStateFactories(componentConfiguration)).thenReturn(expectedStateFactories); when(componentFactory.createComponent(componentConfiguration, expectedStateFactories, inputStreams)).thenReturn(component); topology.build(topologyConfiguration); verify(componentPool).registerBuildedComponent(component, componentConfiguration); }