|
| 1 | +package io.quarkus.micrometer.deployment; |
| 2 | + |
| 3 | +import io.micrometer.core.instrument.MeterRegistry; |
| 4 | +import io.quarkus.micrometer.test.Util; |
| 5 | +import io.quarkus.test.QuarkusUnitTest; |
| 6 | +import jakarta.inject.Inject; |
| 7 | +import org.junit.jupiter.api.Assertions; |
| 8 | +import org.junit.jupiter.api.Disabled; |
| 9 | +import org.junit.jupiter.api.Test; |
| 10 | +import org.junit.jupiter.api.extension.RegisterExtension; |
| 11 | + |
| 12 | +public class MicrometerBinderEnableAllPrecedenceOverBinderEnabledDefaultTest { |
| 13 | + |
| 14 | + @RegisterExtension |
| 15 | + static final QuarkusUnitTest config = new QuarkusUnitTest() |
| 16 | + .withConfigurationResource("test-logging.properties") |
| 17 | + .overrideConfigKey("quarkus.micrometer.binder.enable-all", "true") |
| 18 | + .overrideConfigKey("quarkus.micrometer.binder.jvm", "false") |
| 19 | + .overrideConfigKey("quarkus.micrometer.binder-enabled-default", "false") |
| 20 | + .withApplicationRoot((jar) -> jar |
| 21 | + .addClasses(Util.class)); |
| 22 | + |
| 23 | + @Inject |
| 24 | + MeterRegistry registry; |
| 25 | + |
| 26 | + @Test |
| 27 | + @Disabled("Should have any registered MeterRegistry objects when binder-enabled-default is disabled and enabled-all is enabled") |
| 28 | + public void testMeterRegistryPresent() { |
| 29 | + Assertions.assertNotNull(registry, "A registry should be configured"); |
| 30 | + |
| 31 | + Assertions.assertNotNull(registry.find("jvm.info").counter(), |
| 32 | + "JVM Info counter should be present, found: " + Util.listMeters(registry, "jvm.info")); |
| 33 | + } |
| 34 | +} |
0 commit comments