This is an automated email from the ASF dual-hosted git repository.
zhangduo pushed a commit to branch branch-2.5
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2.5 by this push:
new 74b0a1de955 HBASE-29937 Upgrade hbase-metrics-api to use junit5 (#7816)
74b0a1de955 is described below
commit 74b0a1de9557f14b460c269b348c3334cd86cfe3
Author: Liu Xiao <[email protected]>
AuthorDate: Thu Mar 5 22:58:30 2026 +0800
HBASE-29937 Upgrade hbase-metrics-api to use junit5 (#7816)
Signed-off-by: Duo Zhang <[email protected]>
(cherry picked from commit 56c5c9ee7e780f7981f4003dae568c6a93399f30)
---
hbase-metrics-api/pom.xml | 5 -----
.../hbase/metrics/TestMetricRegistriesLoader.java | 18 ++++++------------
2 files changed, 6 insertions(+), 17 deletions(-)
diff --git a/hbase-metrics-api/pom.xml b/hbase-metrics-api/pom.xml
index 28abd360d00..ddf41fd321f 100644
--- a/hbase-metrics-api/pom.xml
+++ b/hbase-metrics-api/pom.xml
@@ -88,11 +88,6 @@
<artifactId>junit-jupiter-params</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.junit.vintage</groupId>
- <artifactId>junit-vintage-engine</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
diff --git
a/hbase-metrics-api/src/test/java/org/apache/hadoop/hbase/metrics/TestMetricRegistriesLoader.java
b/hbase-metrics-api/src/test/java/org/apache/hadoop/hbase/metrics/TestMetricRegistriesLoader.java
index b9df823e756..83cdcbb2fca 100644
---
a/hbase-metrics-api/src/test/java/org/apache/hadoop/hbase/metrics/TestMetricRegistriesLoader.java
+++
b/hbase-metrics-api/src/test/java/org/apache/hadoop/hbase/metrics/TestMetricRegistriesLoader.java
@@ -17,30 +17,24 @@
*/
package org.apache.hadoop.hbase.metrics;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.mockito.Mockito.mock;
-import org.apache.hadoop.hbase.HBaseClassTestRule;
import org.apache.hadoop.hbase.testclassification.SmallTests;
-import org.junit.ClassRule;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
+import org.junit.jupiter.api.Tag;
+import org.junit.jupiter.api.Test;
import org.apache.hbase.thirdparty.com.google.common.collect.Lists;
/**
* Test class for {@link MetricRegistriesLoader}.
*/
-@Category(SmallTests.class)
+@Tag(SmallTests.TAG)
public class TestMetricRegistriesLoader {
- @ClassRule
- public static final HBaseClassTestRule CLASS_RULE =
- HBaseClassTestRule.forClass(TestMetricRegistriesLoader.class);
-
@Test
- public void testLoadSinleInstance() {
+ public void testLoadSingleInstance() {
MetricRegistries loader = mock(MetricRegistries.class);
MetricRegistries instance =
MetricRegistriesLoader.load(Lists.newArrayList(loader));
assertEquals(loader, instance);