From 07e40c20ab8f38c86ee9c744e4a8b6623482212d Mon Sep 17 00:00:00 2001 From: Chris Pennello Date: Fri, 5 Aug 2022 17:04:30 -0700 Subject: [PATCH] Fixes TestMetrics filter bug. Previously, this matches implementation was ignoring the `name` passed in and instead comparing the *literal* `"testMetricWait.pool.Wait"` to the dynamically-created `MetricRegistry.name("testMetricWait", "pool", "Wait")`. This commit updates the matches implementation to instead compare the `name` passed in. This brings it in line with the other implementations in the same file. --- src/test/java/com/zaxxer/hikari/pool/TestMetrics.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/com/zaxxer/hikari/pool/TestMetrics.java b/src/test/java/com/zaxxer/hikari/pool/TestMetrics.java index 2e05dca98..84ad628fe 100644 --- a/src/test/java/com/zaxxer/hikari/pool/TestMetrics.java +++ b/src/test/java/com/zaxxer/hikari/pool/TestMetrics.java @@ -71,7 +71,7 @@ public void testMetricWait() throws SQLException @Override public boolean matches(String name, Metric metric) { - return "testMetricWait.pool.Wait".equals(MetricRegistry.name("testMetricWait", "pool", "Wait")); + return name.equals(MetricRegistry.name("testMetricWait", "pool", "Wait")); } }).values().iterator().next();