From aad1d2cc944c2e5826596e9f6fd923ffbc5bf645 Mon Sep 17 00:00:00 2001 From: Andrei Arlou Date: Tue, 2 Jan 2024 20:24:46 +0200 Subject: [PATCH] 3.x Make OciMetricsDataTest.beforeEach public (#7328) --- .../oci/metrics/OciMetricsDataTest.java | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/integrations/oci/metrics/metrics/src/test/java/io/helidon/integrations/oci/metrics/OciMetricsDataTest.java b/integrations/oci/metrics/metrics/src/test/java/io/helidon/integrations/oci/metrics/OciMetricsDataTest.java index e96ea519d49..b50a001e2e7 100644 --- a/integrations/oci/metrics/metrics/src/test/java/io/helidon/integrations/oci/metrics/OciMetricsDataTest.java +++ b/integrations/oci/metrics/metrics/src/test/java/io/helidon/integrations/oci/metrics/OciMetricsDataTest.java @@ -28,7 +28,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.concurrent.TimeUnit; import io.helidon.metrics.api.RegistryFactory; @@ -36,7 +35,7 @@ import com.oracle.bmc.monitoring.model.MetricDataDetails; -public class OciMetricsDataTest { +class OciMetricsDataTest { private final OciMetricsSupport.NameFormatter nameFormatter = new OciMetricsSupport.NameFormatter() { }; private final Type[] types = {Type.BASE, Type.VENDOR, Type.APPLICATION}; private final String dimensionScopeName = "scope"; @@ -47,21 +46,15 @@ public class OciMetricsDataTest { private final MetricRegistry appMetricRegistry = rf.getRegistry(Type.APPLICATION); @BeforeEach - private void beforeEach() { - // clear all registry + void clearAllRegistry() { for (Type type: types) { MetricRegistry metricRegistry = rf.getRegistry(type); - metricRegistry.removeMatching(new MetricFilter() { - @Override - public boolean matches(MetricID metricID, Metric metric) { - return true; - } - }); + metricRegistry.removeMatching(MetricFilter.ALL); } } @Test - public void testMetricRegistries() { + void testMetricRegistries() { String counterName = "DummyCounter"; String meterName = "DummyMeter"; String timerName = "DummyTimer"; @@ -96,7 +89,7 @@ public void testMetricRegistries() { } @Test - public void testOciMonitoringParameters() { + void testOciMonitoringParameters() { String compartmentId = "dummy.compartmentId"; String namespace = "dummy-namespace"; String resourceGroup = "dummy_resourceGroup"; @@ -114,7 +107,7 @@ public void testOciMonitoringParameters() { } @Test - public void testDimensions() { + void testDimensions() { String dummyTagName = "DummyTag"; String dummyTagValue = "DummyValue";