Search in sources :

Example 1 with ReservoirFactory

use of org.springframework.boot.actuate.metrics.dropwizard.ReservoirFactory in project spring-boot by spring-projects.

the class MetricsDropwizardAutoConfigurationTests method dropwizardWithoutCustomReservoirConfigured.

@Test
public void dropwizardWithoutCustomReservoirConfigured() {
    this.context = new AnnotationConfigApplicationContext(MetricsDropwizardAutoConfiguration.class);
    DropwizardMetricServices dropwizardMetricServices = this.context.getBean(DropwizardMetricServices.class);
    ReservoirFactory reservoirFactory = (ReservoirFactory) ReflectionTestUtils.getField(dropwizardMetricServices, "reservoirFactory");
    assertThat(reservoirFactory.getReservoir("test")).isNull();
}
Also used : AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) DropwizardMetricServices(org.springframework.boot.actuate.metrics.dropwizard.DropwizardMetricServices) ReservoirFactory(org.springframework.boot.actuate.metrics.dropwizard.ReservoirFactory) Test(org.junit.Test)

Example 2 with ReservoirFactory

use of org.springframework.boot.actuate.metrics.dropwizard.ReservoirFactory in project spring-boot by spring-projects.

the class MetricsDropwizardAutoConfigurationTests method dropwizardWithCustomReservoirConfigured.

@Test
public void dropwizardWithCustomReservoirConfigured() {
    this.context = new AnnotationConfigApplicationContext(MetricsDropwizardAutoConfiguration.class, Config.class);
    DropwizardMetricServices dropwizardMetricServices = this.context.getBean(DropwizardMetricServices.class);
    ReservoirFactory reservoirFactory = (ReservoirFactory) ReflectionTestUtils.getField(dropwizardMetricServices, "reservoirFactory");
    assertThat(reservoirFactory.getReservoir("test")).isInstanceOf(UniformReservoir.class);
}
Also used : AnnotationConfigApplicationContext(org.springframework.context.annotation.AnnotationConfigApplicationContext) DropwizardMetricServices(org.springframework.boot.actuate.metrics.dropwizard.DropwizardMetricServices) ReservoirFactory(org.springframework.boot.actuate.metrics.dropwizard.ReservoirFactory) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 DropwizardMetricServices (org.springframework.boot.actuate.metrics.dropwizard.DropwizardMetricServices)2 ReservoirFactory (org.springframework.boot.actuate.metrics.dropwizard.ReservoirFactory)2 AnnotationConfigApplicationContext (org.springframework.context.annotation.AnnotationConfigApplicationContext)2