StormStatusServiceImpl implements StormStatusService { @Override public TopologySummary getTopologySummary() { return restTemplate .getForObject(getStormUiProperty() + TOPOLOGY_SUMMARY_URL, TopologySummary.class); } @Autowired  StormStatusServiceImpl(Environment environment, RestTemplate restTemplate, SensorParserGroupService sensorParserGroupService); @Override SupervisorSummary getSupervisorSummary(); @Override TopologySummary getTopologySummary(); @Override TopologyStatus getTopologyStatus(String name); @Override List<TopologyStatus> getAllTopologyStatus(); @Override TopologyResponse activateTopology(String name); @Override TopologyResponse deactivateTopology(String name);  }
@Test public void getTopologySummaryShouldReturnTopologySummary() throws Exception { final TopologyStatus topologyStatus = new TopologyStatus(); topologyStatus.setStatus(TopologyStatusCode.STARTED); topologyStatus.setName("bro"); topologyStatus.setId("bro_id"); final TopologySummary topologySummary = new TopologySummary(); topologySummary.setTopologies(new TopologyStatus[]{topologyStatus}); when(environment.getProperty(STORM_UI_SPRING_PROPERTY)).thenReturn(HTTP_STORM_UI); when(restTemplate.getForObject(HTTP_STORM_UI + TOPOLOGY_SUMMARY_URL, TopologySummary.class)).thenReturn(topologySummary); TopologyStatus expectedStatus = new TopologyStatus(); expectedStatus.setStatus(TopologyStatusCode.STARTED); expectedStatus.setName("bro"); expectedStatus.setId("bro_id"); TopologySummary expected = new TopologySummary(); expected.setTopologies(new TopologyStatus[]{expectedStatus}); TopologySummary actual = stormStatusService.getTopologySummary(); assertEquals(expected, actual); assertEquals(expected.hashCode(), actual.hashCode()); }