StreamStatusMetricService { @CachedGauge(absolute = true, name = "streams.count", timeout = 30, timeoutUnit = TimeUnit.SECONDS) public int getTotalStreams() { return streamStatusDao.getAll().size(); } StreamStatusMetricService(StreamStatusDao streamStatusDao); @CachedGauge(absolute = true, name = "streams.count", timeout = 30, timeoutUnit = TimeUnit.SECONDS) int getTotalStreams(); @CachedGauge(absolute = true, name = "streams.names", timeout = 30, timeoutUnit = TimeUnit.SECONDS) List<String> getStreamNames(); @CachedGauge(absolute = true, name = "streams.actions", timeout = 30, timeoutUnit = TimeUnit.SECONDS) Map<String, String> getStreamActions();  }
@Test public void testGetTotalStreams() throws Exception { int number= service.getTotalStreams(); assertEquals(2, number); }