use of io.dropwizard.metrics.Counter in project light-4j by networknt.
the class ConsoleReporterTest method reportsCounterValues.
@Test
public void reportsCounterValues() throws Exception {
final Counter counter = mock(Counter.class);
when(counter.getCount()).thenReturn(100L);
reporter.report(this.map(), map("test.counter", counter), this.map(), this.map(), this.map());
assertThat(consoleOutput()).isEqualTo(lines("3/17/13 6:04:36 PM =============================================================", "", "-- Counters --------------------------------------------------------------------", "test.counter", " count = 100", "", ""));
}
use of io.dropwizard.metrics.Counter in project light-4j by networknt.
the class Slf4jReporterTest method reportsCounterValuesAtError.
@Test
public void reportsCounterValuesAtError() throws Exception {
final Counter counter = mock(Counter.class);
when(counter.getCount()).thenReturn(100L);
when(logger.isErrorEnabled(marker)).thenReturn(true);
errorReporter.report(this.map(), map("test.counter", counter), this.map(), this.map(), this.map());
verify(logger).error(marker, "type={}, name={}, count={}", "COUNTER", "test.counter", 100L);
}
use of io.dropwizard.metrics.Counter in project light-4j by networknt.
the class Slf4jReporterTest method reportsCounterValues.
@Test
public void reportsCounterValues() throws Exception {
final Counter counter = mock(Counter.class);
when(counter.getCount()).thenReturn(100L);
when(logger.isInfoEnabled(marker)).thenReturn(true);
infoReporter.report(this.map(), map("test.counter", counter), this.map(), this.map(), this.map());
verify(logger).info(marker, "type={}, name={}, count={}", "COUNTER", "prefix.test.counter", 100L);
}
Aggregations