Clear MeterRegistry before each test case

Closes gh-38604
This commit is contained in:
Moritz Halbritter
2023-11-30 09:02:22 +01:00
parent ae0ae8234f
commit 203cd542c0

View File

@@ -30,6 +30,7 @@ import io.micrometer.core.instrument.binder.logging.LogbackMetrics;
import io.micrometer.core.instrument.simple.SimpleConfig;
import io.micrometer.core.instrument.simple.SimpleMeterRegistry;
import jakarta.servlet.DispatcherType;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
@@ -99,6 +100,11 @@ class MetricsIntegrationTests {
@Autowired
private MeterRegistry registry;
@BeforeEach
void setUp() {
this.registry.clear();
}
@SuppressWarnings("unchecked")
@Test
void restTemplateIsInstrumented() {