Search in sources :

Example 1 with CounterFactory

use of com.netflix.zuul.monitoring.CounterFactory in project spring-cloud-netflix by spring-cloud.

the class DefaultCounterFactoryTests method shouldIncrement.

@Test
public void shouldIncrement() throws Exception {
    MeterRegistry meterRegistry = mock(MeterRegistry.class);
    CounterFactory factory = new DefaultCounterFactory(meterRegistry);
    Counter counter = mock(Counter.class);
    when(meterRegistry.counter(NAME)).thenReturn(counter);
    factory.increment(NAME);
    verify(counter).increment();
}
Also used : Counter(io.micrometer.core.instrument.Counter) MeterRegistry(io.micrometer.core.instrument.MeterRegistry) CounterFactory(com.netflix.zuul.monitoring.CounterFactory) Test(org.junit.Test)

Example 2 with CounterFactory

use of com.netflix.zuul.monitoring.CounterFactory in project spring-cloud-netflix by spring-cloud.

the class ZuulEmptyMetricsApplicationTests method shouldSetupDefaultCounterFactoryIfCounterServiceIsPresent.

@Test
public void shouldSetupDefaultCounterFactoryIfCounterServiceIsPresent() throws Exception {
    CounterFactory factory = this.context.getBean(CounterFactory.class);
    assertEquals(EmptyCounterFactory.class, factory.getClass());
}
Also used : CounterFactory(com.netflix.zuul.monitoring.CounterFactory) Test(org.junit.Test)

Aggregations

CounterFactory (com.netflix.zuul.monitoring.CounterFactory)2 Test (org.junit.Test)2 Counter (io.micrometer.core.instrument.Counter)1 MeterRegistry (io.micrometer.core.instrument.MeterRegistry)1