This is an automated email from the ASF dual-hosted git repository.

szetszwo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ratis.git


The following commit(s) were added to refs/heads/master by this push:
     new d740e5135 RATIS-2255. Migrate ratis-grpc to junit 5. (#1233)
d740e5135 is described below

commit d740e513555a3c4bbf26cab061bca5ff63bb1859
Author: Tsz-Wo Nicholas Sze <[email protected]>
AuthorDate: Wed Mar 5 08:38:37 2025 -0800

    RATIS-2255. Migrate ratis-grpc to junit 5. (#1233)
---
 ratis-grpc/pom.xml                                                | 4 ++--
 .../test/java/org/apache/ratis/grpc/MiniRaftClusterWithGrpc.java  | 8 ++++----
 ratis-metrics-default/pom.xml                                     | 5 -----
 ratis-metrics-dropwizard3/pom.xml                                 | 5 -----
 4 files changed, 6 insertions(+), 16 deletions(-)

diff --git a/ratis-grpc/pom.xml b/ratis-grpc/pom.xml
index fc6797831..c555b8e4c 100644
--- a/ratis-grpc/pom.xml
+++ b/ratis-grpc/pom.xml
@@ -75,8 +75,8 @@
     </dependency>
 
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-api</artifactId>
       <scope>test</scope>
     </dependency>
     <dependency>
diff --git 
a/ratis-grpc/src/test/java/org/apache/ratis/grpc/MiniRaftClusterWithGrpc.java 
b/ratis-grpc/src/test/java/org/apache/ratis/grpc/MiniRaftClusterWithGrpc.java
index 1519298f3..bd1c72b24 100644
--- 
a/ratis-grpc/src/test/java/org/apache/ratis/grpc/MiniRaftClusterWithGrpc.java
+++ 
b/ratis-grpc/src/test/java/org/apache/ratis/grpc/MiniRaftClusterWithGrpc.java
@@ -33,7 +33,7 @@ import org.apache.ratis.server.impl.MiniRaftCluster;
 import org.apache.ratis.server.impl.RaftServerTestUtil;
 import org.apache.ratis.util.NetUtils;
 import org.apache.ratis.util.ReferenceCountedLeakDetector;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 
 import java.util.Optional;
 
@@ -104,9 +104,9 @@ public class MiniRaftClusterWithGrpc extends 
MiniRaftCluster.RpcBase {
       RaftServer.Division division = RaftServerTestUtil.getDivision(server, 
id);
       final GrpcServicesImpl service = (GrpcServicesImpl) 
RaftServerTestUtil.getServerRpc(division);
       ZeroCopyMetrics zeroCopyMetrics = service.getZeroCopyMetrics();
-      Assert.assertEquals(0, zeroCopyMetrics.nonZeroCopyMessages());
-      Assert.assertEquals("Zero copy messages are not released, please check 
logs to find leaks. ",
-          zeroCopyMetrics.zeroCopyMessages(), 
zeroCopyMetrics.releasedMessages());
+      Assertions.assertEquals(0, zeroCopyMetrics.nonZeroCopyMessages());
+      Assertions.assertEquals(zeroCopyMetrics.zeroCopyMessages(), 
zeroCopyMetrics.releasedMessages(),
+          "Unreleased zero copy messages: please check logs to find the leaks. 
");
     }));
   }
 }
diff --git a/ratis-metrics-default/pom.xml b/ratis-metrics-default/pom.xml
index 2739ad077..cad2150c7 100644
--- a/ratis-metrics-default/pom.xml
+++ b/ratis-metrics-default/pom.xml
@@ -49,11 +49,6 @@
       <artifactId>slf4j-api</artifactId>
     </dependency>
 
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <scope>test</scope>
-    </dependency>
     <dependency>
       <groupId>org.junit.jupiter</groupId>
       <artifactId>junit-jupiter-engine</artifactId>
diff --git a/ratis-metrics-dropwizard3/pom.xml 
b/ratis-metrics-dropwizard3/pom.xml
index 143f63de4..cb9f50427 100644
--- a/ratis-metrics-dropwizard3/pom.xml
+++ b/ratis-metrics-dropwizard3/pom.xml
@@ -53,11 +53,6 @@
       <artifactId>slf4j-api</artifactId>
     </dependency>
 
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <scope>test</scope>
-    </dependency>
     <dependency>
       <groupId>org.junit.jupiter</groupId>
       <artifactId>junit-jupiter-engine</artifactId>

Reply via email to