diff --git a/prometheus-metrics-instrumentation-dropwizard/src/test/java/io/prometheus/metrics/instrumentation/dropwizard/DropwizardExportsTest.java b/prometheus-metrics-instrumentation-dropwizard/src/test/java/io/prometheus/metrics/instrumentation/dropwizard/DropwizardExportsTest.java index 2b3e9e778..8c1661fcf 100644 --- a/prometheus-metrics-instrumentation-dropwizard/src/test/java/io/prometheus/metrics/instrumentation/dropwizard/DropwizardExportsTest.java +++ b/prometheus-metrics-instrumentation-dropwizard/src/test/java/io/prometheus/metrics/instrumentation/dropwizard/DropwizardExportsTest.java @@ -3,6 +3,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.data.Offset.offset; import static org.junit.Assert.assertThrows; +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import com.codahale.metrics.*; import io.prometheus.metrics.expositionformats.OpenMetricsTextFormatWriter; @@ -25,7 +26,10 @@ class DropwizardExportsTest { @BeforeEach public void setUp() { metricRegistry = new MetricRegistry(); - DropwizardExports.builder().dropwizardRegistry(metricRegistry).register(registry); + DropwizardExports.builder() + .dropwizardRegistry(metricRegistry) + .metricFilter(MetricFilter.ALL) + .register(registry); } @Test @@ -35,6 +39,12 @@ public void testBuilderThrowsErrorOnNullRegistry() { () -> DropwizardExports.builder().dropwizardRegistry(null).register(registry)); } + @Test + public void testBuilderCreatesOkay() { + assertDoesNotThrow( + () -> DropwizardExports.builder().dropwizardRegistry(metricRegistry).register()); + } + @Test public void testCounter() { metricRegistry.counter("foo.bar").inc(1);