use of org.springframework.boot.actuate.endpoint.MetricsEndpointMetricReader in project spring-boot by spring-projects.
the class MetricExportAutoConfigurationTests method exportMetricsEndpoint.
@Test
public void exportMetricsEndpoint() {
this.context = new AnnotationConfigApplicationContext(WriterConfig.class, MetricEndpointConfiguration.class, MetricExportAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class);
MetricExporters exporters = this.context.getBean(MetricExporters.class);
MetricCopyExporter exporter = (MetricCopyExporter) exporters.getExporters().get("writer");
exporter.setIgnoreTimestamps(true);
exporter.export();
MetricsEndpointMetricReader reader = this.context.getBean("endpointReader", MetricsEndpointMetricReader.class);
Mockito.verify(reader, Mockito.atLeastOnce()).findAll();
}
Aggregations