Skip to content

Commit 2e0b416

Browse files
committed
Update DropwizardExportsTest.java
Signed-off-by: Kinshuk Bairagi <[email protected]>
1 parent 65b4ddd commit 2e0b416

File tree

1 file changed

+11
-1
lines changed
  • prometheus-metrics-instrumentation-dropwizard/src/test/java/io/prometheus/metrics/instrumentation/dropwizard

1 file changed

+11
-1
lines changed

prometheus-metrics-instrumentation-dropwizard/src/test/java/io/prometheus/metrics/instrumentation/dropwizard/DropwizardExportsTest.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import static org.assertj.core.api.Assertions.assertThat;
44
import static org.assertj.core.data.Offset.offset;
55
import static org.junit.Assert.assertThrows;
6+
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
67

78
import com.codahale.metrics.*;
89
import io.prometheus.metrics.expositionformats.OpenMetricsTextFormatWriter;
@@ -25,7 +26,10 @@ class DropwizardExportsTest {
2526
@BeforeEach
2627
public void setUp() {
2728
metricRegistry = new MetricRegistry();
28-
DropwizardExports.builder().dropwizardRegistry(metricRegistry).register(registry);
29+
DropwizardExports.builder()
30+
.dropwizardRegistry(metricRegistry)
31+
.metricFilter(MetricFilter.ALL)
32+
.register(registry);
2933
}
3034

3135
@Test
@@ -35,6 +39,12 @@ public void testBuilderThrowsErrorOnNullRegistry() {
3539
() -> DropwizardExports.builder().dropwizardRegistry(null).register(registry));
3640
}
3741

42+
@Test
43+
public void testBuilderCreatesOkay() {
44+
assertDoesNotThrow(
45+
() -> DropwizardExports.builder().dropwizardRegistry(metricRegistry).register());
46+
}
47+
3848
@Test
3949
public void testCounter() {
4050
metricRegistry.counter("foo.bar").inc(1);

0 commit comments

Comments
 (0)