RATIS-2021. Migrate ratis-test tests to Junit 5 - Part 2. (#1043)

diff --git a/ratis-server/src/test/java/org/apache/ratis/RaftBasicTests.java b/ratis-server/src/test/java/org/apache/ratis/RaftBasicTests.java
index 4ff9681..13ee08c 100644
--- a/ratis-server/src/test/java/org/apache/ratis/RaftBasicTests.java
+++ b/ratis-server/src/test/java/org/apache/ratis/RaftBasicTests.java
@@ -42,8 +42,9 @@
 import org.apache.ratis.util.Slf4jUtils;
 import org.apache.ratis.util.TimeDuration;
 import org.apache.ratis.util.Timestamp;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Assumptions;
+import org.junit.jupiter.api.Test;
 import org.slf4j.Logger;
 import org.slf4j.event.Level;
 
@@ -152,12 +153,12 @@
           });
         } else {
           final RaftClientReply reply = client.io().send(message);
-          Assert.assertTrue(reply.isSuccess());
+          Assertions.assertTrue(reply.isSuccess());
         }
       }
       if (async) {
         f.join();
-        Assert.assertEquals(messages.length, asyncReplyCount.get());
+        Assertions.assertEquals(messages.length, asyncReplyCount.get());
       }
     }
     Thread.sleep(cluster.getTimeoutMax().toIntExact(TimeUnit.MILLISECONDS) + 100);
@@ -194,7 +195,7 @@
     Thread.sleep(cluster.getTimeoutMax().toLong(TimeUnit.MILLISECONDS) + 100);
     for (RaftServer.Division followerToSendLog : followersToSendLog) {
       RaftLog followerLog = followerToSendLog.getRaftLog();
-      Assert.assertTrue(RaftTestUtil.logEntriesContains(followerLog, messages));
+      Assertions.assertTrue(RaftTestUtil.logEntriesContains(followerLog, messages));
     }
 
     LOG.info(String.format("killing old leader: %s", leaderId.toString()));
@@ -212,7 +213,7 @@
     Set<RaftPeerId> followersToSendLogIds =
         followersToSendLog.stream().map(f -> f.getId()).collect(Collectors.toSet());
 
-    Assert.assertTrue(followersToSendLogIds.contains(newLeaderId));
+    Assertions.assertTrue(followersToSendLogIds.contains(newLeaderId));
 
     cluster.getServerAliveStream()
         .map(RaftServer.Division::getRaftLog)
@@ -234,8 +235,8 @@
         cluster.killServer(followers.get(i).getId());
       }
     } catch (IndexOutOfBoundsException e) {
-      throw new org.junit.AssumptionViolatedException("The assumption is follower.size() = NUM_SERVERS - 1, "
-              + "actual NUM_SERVERS is " + NUM_SERVERS + ", and actual follower.size() is " + followers.size(), e);
+      Assumptions.abort("The assumption is follower.size() = NUM_SERVERS - 1, "
+          + "actual NUM_SERVERS is " + NUM_SERVERS + ", and actual follower.size() is " + followers.size());
     }
 
     SimpleMessage[] messages = SimpleMessage.create(1);
@@ -293,7 +294,7 @@
           if (!useAsync) {
             final RaftClientReply reply =
                 client.io().send(messages[step.getAndIncrement()]);
-            Assert.assertTrue(reply.isSuccess());
+            Assertions.assertTrue(reply.isSuccess());
           } else {
             final CompletableFuture<RaftClientReply> replyFuture =
                 client.async().send(messages[i]);
@@ -305,13 +306,13 @@
               if (step.incrementAndGet() == messages.length) {
                 f.complete(null);
               }
-              Assert.assertTrue(r.isSuccess());
+              Assertions.assertTrue(r.isSuccess());
             });
           }
         }
         if (useAsync) {
           f.join();
-          Assert.assertTrue(step.get() == messages.length);
+          Assertions.assertEquals(step.get(), messages.length);
         }
       } catch(Exception t) {
         if (exceptionInClientThread.compareAndSet(null, t)) {
@@ -393,7 +394,7 @@
       }
 
       final int n = clients.stream().mapToInt(c -> c.step.get()).sum();
-      Assert.assertTrue(n >= lastStep.get());
+      Assertions.assertTrue(n >= lastStep.get());
 
       if (n - lastStep.get() < 50 * numClients) { // Change leader at least 50 steps.
         Thread.sleep(10);
@@ -447,7 +448,7 @@
       // The duration for which the client waits should be more than the retryCacheExpiryDuration.
       final TimeDuration duration = startTime.elapsedTime();
       TimeDuration retryCacheExpiryDuration = RaftServerConfigKeys.RetryCache.expiryTime(cluster.getProperties());
-      Assert.assertTrue(duration.compareTo(retryCacheExpiryDuration) >= 0);
+      Assertions.assertTrue(duration.compareTo(retryCacheExpiryDuration) >= 0);
     }
   }
 
@@ -479,10 +480,10 @@
       long smAppliedIndexAfter = (Long) smAppliedIndexGauge.getValue();
       checkFollowerCommitLagsLeader(cluster);
 
-      Assert.assertTrue("StateMachine Applied Index not incremented",
-          appliedIndexAfter > appliedIndexBefore);
-      Assert.assertTrue("StateMachine Apply completed Index not incremented",
-          smAppliedIndexAfter > smAppliedIndexBefore);
+      Assertions.assertTrue(appliedIndexAfter > appliedIndexBefore,
+          "StateMachine Applied Index not incremented");
+      Assertions.assertTrue(smAppliedIndexAfter > smAppliedIndexBefore,
+          "StateMachine Apply completed Index not incremented");
     }
   }
 
@@ -495,12 +496,12 @@
     for (RaftServer.Division f : followers) {
       final RaftGroupMemberId follower = f.getMemberId();
       Gauge followerCommitGauge = ServerMetricsTestUtils.getPeerCommitIndexGauge(leader, follower.getPeerId());
-      Assert.assertTrue((Long)leaderCommitGauge.getValue() >=
+      Assertions.assertTrue((Long)leaderCommitGauge.getValue() >=
           (Long)followerCommitGauge.getValue());
       Gauge followerMetric = ServerMetricsTestUtils.getPeerCommitIndexGauge(follower, follower.getPeerId());
       System.out.println(followerCommitGauge.getValue());
       System.out.println(followerMetric.getValue());
-      Assert.assertTrue((Long)followerCommitGauge.getValue()  <= (Long)followerMetric.getValue());
+      Assertions.assertTrue((Long)followerCommitGauge.getValue()  <= (Long)followerMetric.getValue());
     }
   }
 
@@ -511,7 +512,7 @@
         RATIS_STATEMACHINE_METRICS, RATIS_STATEMACHINE_METRICS_DESC);
 
     Optional<RatisMetricRegistry> metricRegistry = MetricRegistries.global().get(info);
-    Assert.assertTrue(metricRegistry.isPresent());
+    Assertions.assertTrue(metricRegistry.isPresent());
 
     return ServerMetricsTestUtils.getGaugeWithName(gaugeName, metricRegistry::get);
   }
diff --git a/ratis-test/src/test/java/org/apache/ratis/TestRaftServerNoLeaderTimeout.java b/ratis-test/src/test/java/org/apache/ratis/TestRaftServerNoLeaderTimeout.java
index 7f4da0e..c10dc10 100644
--- a/ratis-test/src/test/java/org/apache/ratis/TestRaftServerNoLeaderTimeout.java
+++ b/ratis-test/src/test/java/org/apache/ratis/TestRaftServerNoLeaderTimeout.java
@@ -28,10 +28,10 @@
 import org.apache.ratis.statemachine.StateMachine;
 import org.apache.ratis.util.Slf4jUtils;
 import org.apache.ratis.util.TimeDuration;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.slf4j.event.Level;
 
 import java.io.IOException;
@@ -60,13 +60,13 @@
     return properties;
   }
 
-  @Before
+  @BeforeEach
   public void setup() throws IOException {
-    Assert.assertNull(cluster.getLeader());
+    Assertions.assertNull(cluster.getLeader());
     cluster.start();
   }
 
-  @After
+  @AfterEach
   public void tearDown() {
     if (cluster != null) {
       cluster.shutdown();
@@ -91,10 +91,10 @@
 
     RaftProtos.RoleInfoProto roleInfoProto =
         SimpleStateMachine4Testing.get(healthyFollower).getLeaderElectionTimeoutInfo();
-    Assert.assertNotNull(roleInfoProto);
+    Assertions.assertNotNull(roleInfoProto);
 
-    Assert.assertEquals(roleInfoProto.getRole(), RaftProtos.RaftPeerRole.CANDIDATE);
+    Assertions.assertEquals(roleInfoProto.getRole(), RaftProtos.RaftPeerRole.CANDIDATE);
     final long noLeaderTimeoutMs = noLeaderTimeout.toLong(TimeUnit.MILLISECONDS);
-    Assert.assertTrue(roleInfoProto.getCandidateInfo().getLastLeaderElapsedTimeMs() > noLeaderTimeoutMs);
+    Assertions.assertTrue(roleInfoProto.getCandidateInfo().getLastLeaderElapsedTimeMs() > noLeaderTimeoutMs);
   }
 }
diff --git a/ratis-test/src/test/java/org/apache/ratis/TestRaftServerSlownessDetection.java b/ratis-test/src/test/java/org/apache/ratis/TestRaftServerSlownessDetection.java
index 0ea0fe9..b150a1a 100644
--- a/ratis-test/src/test/java/org/apache/ratis/TestRaftServerSlownessDetection.java
+++ b/ratis-test/src/test/java/org/apache/ratis/TestRaftServerSlownessDetection.java
@@ -30,12 +30,6 @@
 import org.apache.ratis.statemachine.StateMachine;
 import org.apache.ratis.util.Slf4jUtils;
 import org.apache.ratis.util.TimeDuration;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-
 
 import java.io.IOException;
 import java.util.List;
@@ -43,13 +37,18 @@
 import java.util.concurrent.TimeUnit;
 
 import org.apache.ratis.thirdparty.com.codahale.metrics.Gauge;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
 import org.slf4j.event.Level;
 
 /**
  * Test Raft Server Slowness detection and notification to Leader's statemachine.
  */
 //TODO: fix StateMachine.notifySlowness(..); see RATIS-370
-@Ignore
+@Disabled
 public class TestRaftServerSlownessDetection extends BaseTest {
   static {
     Slf4jUtils.setLogLevel(RaftServer.Division.LOG, Level.DEBUG);
@@ -70,13 +69,13 @@
     return properties;
   }
 
-  @Before
+  @BeforeEach
   public void setup() throws IOException {
-    Assert.assertNull(cluster.getLeader());
+    Assertions.assertNull(cluster.getLeader());
     cluster.start();
   }
 
-  @After
+  @AfterEach
   public void tearDown() {
     if (cluster != null) {
       cluster.shutdown();
@@ -107,23 +106,23 @@
     Thread.sleep( slownessTimeout * 2);
 
     long followerHeartBeatElapsedMetricNew = (long) metric.getValue();
-    Assert.assertTrue(followerHeartBeatElapsedMetricNew > followerHeartBeatElapsedMetric);
+    Assertions.assertTrue(followerHeartBeatElapsedMetricNew > followerHeartBeatElapsedMetric);
 
     // Followers should not get any failed not notification
     for (RaftServer.Division followerServer : cluster.getFollowers()) {
-      Assert.assertNull(SimpleStateMachine4Testing.get(followerServer).getSlownessInfo());
+      Assertions.assertNull(SimpleStateMachine4Testing.get(followerServer).getSlownessInfo());
     }
     // the leader should get notification that the follower has failed now
     RaftProtos.RoleInfoProto roleInfoProto =
         SimpleStateMachine4Testing.get(cluster.getLeader()).getSlownessInfo();
-    Assert.assertNotNull(roleInfoProto);
+    Assertions.assertNotNull(roleInfoProto);
 
     List<RaftProtos.ServerRpcProto> followers =
         roleInfoProto.getLeaderInfo().getFollowerInfoList();
     //Assert that the node shutdown is lagging behind
     for (RaftProtos.ServerRpcProto serverProto : followers) {
       if (RaftPeerId.valueOf(serverProto.getId().getId()).equals(failedFollower.getId())) {
-        Assert.assertTrue(serverProto.getLastRpcElapsedTimeMs() > slownessTimeout);
+        Assertions.assertTrue(serverProto.getLastRpcElapsedTimeMs() > slownessTimeout);
       }
     }
   }
diff --git a/ratis-test/src/test/java/org/apache/ratis/netty/TestRaftWithNetty.java b/ratis-test/src/test/java/org/apache/ratis/netty/TestRaftWithNetty.java
index 28815d7..55b9c37 100644
--- a/ratis-test/src/test/java/org/apache/ratis/netty/TestRaftWithNetty.java
+++ b/ratis-test/src/test/java/org/apache/ratis/netty/TestRaftWithNetty.java
@@ -19,7 +19,7 @@
 
 import org.apache.ratis.RaftBasicTests;
 import org.apache.ratis.server.impl.BlockRequestHandlingInjection;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class TestRaftWithNetty
     extends RaftBasicTests<MiniRaftClusterWithNetty>
diff --git a/ratis-test/src/test/java/org/apache/ratis/netty/TestTlsConfWithNetty.java b/ratis-test/src/test/java/org/apache/ratis/netty/TestTlsConfWithNetty.java
index db967e3..77910b2 100644
--- a/ratis-test/src/test/java/org/apache/ratis/netty/TestTlsConfWithNetty.java
+++ b/ratis-test/src/test/java/org/apache/ratis/netty/TestTlsConfWithNetty.java
@@ -38,8 +38,8 @@
 import org.apache.ratis.thirdparty.io.netty.handler.logging.LoggingHandler;
 import org.apache.ratis.thirdparty.io.netty.handler.ssl.SslContext;
 import org.apache.ratis.util.JavaUtils;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -112,7 +112,7 @@
         final CompletableFuture<String> future = replyFutures.get(i);
         final String reply = future.get(3, TimeUnit.SECONDS);
         LOG.info(reply);
-        Assert.assertEquals(NettyTestServer.toReply(words[i]), reply);
+        Assertions.assertEquals(NettyTestServer.toReply(words[i]), reply);
       }
     }
   }
diff --git a/ratis-test/src/test/java/org/apache/ratis/protocol/TestRaftGroup.java b/ratis-test/src/test/java/org/apache/ratis/protocol/TestRaftGroup.java
index 5267b22..f4a88e4 100644
--- a/ratis-test/src/test/java/org/apache/ratis/protocol/TestRaftGroup.java
+++ b/ratis-test/src/test/java/org/apache/ratis/protocol/TestRaftGroup.java
@@ -18,27 +18,25 @@
 package org.apache.ratis.protocol;
 
 import org.apache.ratis.BaseTest;
-import org.apache.ratis.thirdparty.com.google.protobuf.ByteString;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
 
 import java.util.LinkedList;
 import java.util.List;
 import java.util.UUID;
 
+@Timeout(value = 1)
 public class TestRaftGroup extends BaseTest {
-  @Override
-  public int getGlobalTimeoutSeconds() {
-    return 1;
-  }
 
-  @Test(expected = IllegalStateException.class)
+  @Test
   public void testDuplicatePeerId() throws Exception {
     UUID groupId = UUID.fromString("02511d47-d67c-49a3-9011-abb3109a44c1");
 
     List<RaftPeer> peers = new LinkedList<>();
     peers.add(RaftPeer.newBuilder().setId("n0").build());
     peers.add(RaftPeer.newBuilder().setId("n0").build());
-    RaftGroup.valueOf(RaftGroupId.valueOf(groupId), peers);
+    Assertions.assertThrows(IllegalStateException.class,
+        () -> RaftGroup.valueOf(RaftGroupId.valueOf(groupId), peers));
   }
 }
diff --git a/ratis-test/src/test/java/org/apache/ratis/protocol/TestRaftId.java b/ratis-test/src/test/java/org/apache/ratis/protocol/TestRaftId.java
index 6610b3d..b0e31ce 100644
--- a/ratis-test/src/test/java/org/apache/ratis/protocol/TestRaftId.java
+++ b/ratis-test/src/test/java/org/apache/ratis/protocol/TestRaftId.java
@@ -19,16 +19,14 @@
 
 import org.apache.ratis.BaseTest;
 import org.apache.ratis.thirdparty.com.google.protobuf.ByteString;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
 
 import java.util.UUID;
 
+@Timeout(value = 1)
 public class TestRaftId extends BaseTest {
-  @Override
-  public int getGlobalTimeoutSeconds() {
-    return 1;
-  }
 
   @Test
   public void testRaftId() {
@@ -39,35 +37,35 @@
   static void assertRaftId(UUID original, ByteString expected) {
     final ByteString bytes = RaftId.toByteString(original);
     if (expected != null) {
-      Assert.assertEquals(expected, bytes);
+      Assertions.assertEquals(expected, bytes);
     }
     final UUID computed = RaftId.toUuid(bytes);
 
-    Assert.assertEquals(original, computed);
-    Assert.assertEquals(bytes, RaftId.toByteString(computed));
+    Assertions.assertEquals(original, computed);
+    Assertions.assertEquals(bytes, RaftId.toByteString(computed));
   }
 
   @Test
   public void testClientId() {
     final ClientId id = ClientId.randomId();
     final ByteString bytes = id.toByteString();
-    Assert.assertEquals(bytes, id.toByteString());
-    Assert.assertEquals(id, ClientId.valueOf(bytes));
+    Assertions.assertEquals(bytes, id.toByteString());
+    Assertions.assertEquals(id, ClientId.valueOf(bytes));
   }
 
   @Test
   public void testRaftGroupId() {
     final RaftGroupId id = RaftGroupId.randomId();
     final ByteString bytes = id.toByteString();
-    Assert.assertEquals(bytes, id.toByteString());
-    Assert.assertEquals(id, RaftGroupId.valueOf(bytes));
+    Assertions.assertEquals(bytes, id.toByteString());
+    Assertions.assertEquals(id, RaftGroupId.valueOf(bytes));
   }
 
   @Test
   public void testRaftPeerId() {
     final RaftPeerId id = RaftPeerId.valueOf("abc");
     final ByteString bytes = id.toByteString();
-    Assert.assertEquals(bytes, id.toByteString());
-    Assert.assertEquals(id, RaftPeerId.valueOf(bytes));
+    Assertions.assertEquals(bytes, id.toByteString());
+    Assertions.assertEquals(id, RaftPeerId.valueOf(bytes));
   }
 }
diff --git a/ratis-test/src/test/java/org/apache/ratis/protocol/TestRoutingTable.java b/ratis-test/src/test/java/org/apache/ratis/protocol/TestRoutingTable.java
index 58bdf07..f3e08ec 100644
--- a/ratis-test/src/test/java/org/apache/ratis/protocol/TestRoutingTable.java
+++ b/ratis-test/src/test/java/org/apache/ratis/protocol/TestRoutingTable.java
@@ -18,14 +18,12 @@
 package org.apache.ratis.protocol;
 
 import org.apache.ratis.BaseTest;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
 
+@Timeout(value = 1)
 public class TestRoutingTable extends BaseTest {
-  @Override
-  public int getGlobalTimeoutSeconds() {
-    return 1;
-  }
 
   private final RaftPeerId[] peers = new RaftPeerId[10];
 
@@ -69,7 +67,7 @@
   }
 
   void testFailureCase(String name, int... peerIndices) {
-    Assert.assertEquals(0, peerIndices.length % 2);
+    Assertions.assertEquals(0, peerIndices.length % 2);
 
     testFailureCase(name + ": " + toString(peerIndices),
         () -> newRoutingTable(peerIndices),
@@ -77,7 +75,7 @@
   }
 
   String toString(int... peerIndices) {
-    Assert.assertEquals(0, peerIndices.length % 2);
+    Assertions.assertEquals(0, peerIndices.length % 2);
     if (peerIndices.length == 0) {
       return "<empty>";
     }
diff --git a/ratis-test/src/test/java/org/apache/ratis/retry/TestExceptionDependentRetry.java b/ratis-test/src/test/java/org/apache/ratis/retry/TestExceptionDependentRetry.java
index 36e6dfb..560c0f9 100644
--- a/ratis-test/src/test/java/org/apache/ratis/retry/TestExceptionDependentRetry.java
+++ b/ratis-test/src/test/java/org/apache/ratis/retry/TestExceptionDependentRetry.java
@@ -21,7 +21,6 @@
 import org.apache.ratis.BaseTest;
 import org.apache.ratis.server.impl.MiniRaftCluster;
 import org.apache.ratis.RaftTestUtil;
-import org.apache.ratis.client.retry.ClientRetryEvent;
 import org.apache.ratis.client.RaftClient;
 import org.apache.ratis.client.RaftClientConfigKeys;
 import org.apache.ratis.conf.RaftProperties;
@@ -33,16 +32,14 @@
 import org.apache.ratis.statemachine.impl.SimpleStateMachine4Testing;
 import org.apache.ratis.statemachine.StateMachine;
 import org.apache.ratis.util.TimeDuration;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 
 import java.io.IOException;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 
-import static org.junit.Assert.fail;
-
 /**
  * Class to test {@link ExceptionDependentRetry}.
  */
@@ -99,9 +96,9 @@
       builder.setExceptionToPolicy(IOException.class,
           RetryPolicies.retryUpToMaximumCountWithFixedSleep(1,
               TimeDuration.valueOf(1, TimeUnit.SECONDS)));
-      fail("testExceptionDependentRetryFailure failed");
+      Assertions.fail("testExceptionDependentRetryFailure failed");
     } catch (Exception ex) {
-      Assert.assertEquals(IllegalStateException.class, ex.getClass());
+      Assertions.assertEquals(IllegalStateException.class, ex.getClass());
     }
 
   }
@@ -115,9 +112,9 @@
           RetryPolicies.retryUpToMaximumCountWithFixedSleep(1,
               TimeDuration.valueOf(1, TimeUnit.SECONDS)));
       builder.setExceptionToPolicy(IOException.class, null);
-      fail("testExceptionDependentRetryFailure failed");
+      Assertions.fail("testExceptionDependentRetryFailure failed");
     } catch (Exception ex) {
-      Assert.assertEquals(IllegalStateException.class, ex.getClass());
+      Assertions.assertEquals(IllegalStateException.class, ex.getClass());
     }
   }
 
@@ -131,9 +128,9 @@
           RetryPolicies.retryUpToMaximumCountWithFixedSleep(1,
               TimeDuration.valueOf(1, TimeUnit.SECONDS)));
       builder.build();
-      fail("testExceptionDependentRetryFailureWithNoDefault failed");
+      Assertions.fail("testExceptionDependentRetryFailureWithNoDefault failed");
     } catch (Exception ex) {
-      Assert.assertEquals(IllegalStateException.class, ex.getClass());
+      Assertions.assertEquals(IllegalStateException.class, ex.getClass());
     }
 
     try {
@@ -143,9 +140,9 @@
           RetryPolicies.retryUpToMaximumCountWithFixedSleep(1,
               TimeDuration.valueOf(1, TimeUnit.SECONDS)));
       builder.setDefaultPolicy(null);
-      fail("testExceptionDependentRetryFailureWithNoDefault failed");
+      Assertions.fail("testExceptionDependentRetryFailureWithNoDefault failed");
     } catch (Exception ex) {
-      Assert.assertEquals(IllegalStateException.class, ex.getClass());
+      Assertions.assertEquals(IllegalStateException.class, ex.getClass());
     }
   }
 
@@ -157,11 +154,11 @@
           .handleAttemptFailure(TestRetryPolicy.newClientRetryEvent(i, null, exception));
 
       final boolean expected = i < retries && i < maxAttempts;
-      Assert.assertEquals(expected, action.shouldRetry());
+      Assertions.assertEquals(expected, action.shouldRetry());
       if (expected) {
-        Assert.assertEquals(sleepTime, action.getSleepTime().getDuration());
+        Assertions.assertEquals(sleepTime, action.getSleepTime().getDuration());
       } else {
-        Assert.assertEquals(0L, action.getSleepTime().getDuration());
+        Assertions.assertEquals(0L, action.getSleepTime().getDuration());
       }
     }
   }
@@ -195,11 +192,11 @@
       SimpleStateMachine4Testing.get(leader).blockWriteStateMachineData();
 
       client.async().send(new RaftTestUtil.SimpleMessage("2")).get();
-      Assert.fail("Test should have failed.");
+      Assertions.fail("Test should have failed.");
     } catch (ExecutionException e) {
       RaftRetryFailureException rrfe = (RaftRetryFailureException) e.getCause();
       final int expectedCount = 1 + retryCount; // new request attempt + retry attempts
-      Assert.assertEquals(expectedCount, rrfe.getAttemptCount());
+      Assertions.assertEquals(expectedCount, rrfe.getAttemptCount());
     } finally {
       SimpleStateMachine4Testing.get(leader).unblockWriteStateMachineData();
       cluster.shutdown();
diff --git a/ratis-test/src/test/java/org/apache/ratis/retry/TestExponentialBackoffRetry.java b/ratis-test/src/test/java/org/apache/ratis/retry/TestExponentialBackoffRetry.java
index 74f1807..c4d1d3a 100644
--- a/ratis-test/src/test/java/org/apache/ratis/retry/TestExponentialBackoffRetry.java
+++ b/ratis-test/src/test/java/org/apache/ratis/retry/TestExponentialBackoffRetry.java
@@ -19,8 +19,8 @@
 
 import org.apache.ratis.BaseTest;
 import org.apache.ratis.util.TimeDuration;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 
 import java.util.concurrent.TimeUnit;
 
@@ -36,12 +36,12 @@
 
     // Test maxAttempts
     ExponentialBackoffRetry retryPolicy = createPolicy(baseSleep, null, 1);
-    Assert.assertFalse(retryPolicy.handleAttemptFailure(() -> 1).shouldRetry());
+    Assertions.assertFalse(retryPolicy.handleAttemptFailure(() -> 1).shouldRetry());
 
     try {
       // baseSleep should not be null
       createPolicy(null, null, 1);
-      Assert.fail("Policy creation should have failed");
+      Assertions.fail("Policy creation should have failed");
     } catch (Exception e) {
     }
 
@@ -67,9 +67,9 @@
       // sleep time with randomness added
       long randomizedDuration = action.getSleepTime().toLong(TimeUnit.MILLISECONDS);
 
-      Assert.assertTrue(action.shouldRetry());
-      Assert.assertTrue(randomizedDuration >= d * 0.5);
-      Assert.assertTrue(randomizedDuration <= d * 1.5);
+      Assertions.assertTrue(action.shouldRetry());
+      Assertions.assertTrue(randomizedDuration >= d * 0.5);
+      Assertions.assertTrue(randomizedDuration <= d * 1.5);
     }
   }
 
diff --git a/ratis-test/src/test/java/org/apache/ratis/retry/TestMultipleLinearRandomRetry.java b/ratis-test/src/test/java/org/apache/ratis/retry/TestMultipleLinearRandomRetry.java
index 09ae55f..eb4b796 100644
--- a/ratis-test/src/test/java/org/apache/ratis/retry/TestMultipleLinearRandomRetry.java
+++ b/ratis-test/src/test/java/org/apache/ratis/retry/TestMultipleLinearRandomRetry.java
@@ -19,8 +19,8 @@
 
 import org.apache.ratis.BaseTest;
 import org.apache.ratis.util.TimeDuration;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 
 public class TestMultipleLinearRandomRetry extends BaseTest {
   @Override
@@ -49,12 +49,12 @@
 
   private static void assertIllegalInput(String input) {
     final MultipleLinearRandomRetry computed = MultipleLinearRandomRetry.parseCommaSeparated(input);
-    Assert.assertNull(computed);
+    Assertions.assertNull(computed);
   }
   private static MultipleLinearRandomRetry assertLegalInput(String expected, String input) {
     final MultipleLinearRandomRetry computed = MultipleLinearRandomRetry.parseCommaSeparated(input);
-    Assert.assertNotNull(computed);
-    Assert.assertTrue(computed.toString().endsWith(expected));
+    Assertions.assertNotNull(computed);
+    Assertions.assertTrue(computed.toString().endsWith(expected));
     return computed;
   }
 
@@ -69,18 +69,18 @@
       for (int j = 1; j <= counts[i]; j++) {
         final int attempt = ++k;
         final RetryPolicy.Action action = r.handleAttemptFailure(() -> attempt);
-        Assert.assertTrue(action.shouldRetry());
+        Assertions.assertTrue(action.shouldRetry());
         final TimeDuration randomized = action.getSleepTime();
         final TimeDuration expected = times[i].to(randomized.getUnit());
         final long d = expected.getDuration();
         LOG.info("times[{},{}] = {}, randomized={}", i, j, times[i], randomized);
-        Assert.assertTrue(randomized.getDuration() >= d*0.5);
-        Assert.assertTrue(randomized.getDuration() < (d*1.5 + precision));
+        Assertions.assertTrue(randomized.getDuration() >= d*0.5);
+        Assertions.assertTrue(randomized.getDuration() < (d*1.5 + precision));
       }
     }
 
     final int attempt = ++k;
     final RetryPolicy.Action action = r.handleAttemptFailure(() -> attempt);
-    Assert.assertFalse(action.shouldRetry());
+    Assertions.assertFalse(action.shouldRetry());
   }
 }
\ No newline at end of file
diff --git a/ratis-test/src/test/java/org/apache/ratis/retry/TestRetryPolicy.java b/ratis-test/src/test/java/org/apache/ratis/retry/TestRetryPolicy.java
index 1b9536b..cee8ee3 100644
--- a/ratis-test/src/test/java/org/apache/ratis/retry/TestRetryPolicy.java
+++ b/ratis-test/src/test/java/org/apache/ratis/retry/TestRetryPolicy.java
@@ -34,8 +34,8 @@
 import org.apache.ratis.protocol.exceptions.ResourceUnavailableException;
 import org.apache.ratis.util.TimeDuration;
 import org.apache.ratis.util.Timestamp;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 
 import java.io.IOException;
 import java.util.ArrayList;
@@ -62,11 +62,11 @@
       final RetryPolicy.Action action = policy.handleAttemptFailure(event);
 
       final boolean expected = i < n;
-      Assert.assertEquals(expected, action.shouldRetry());
+      Assertions.assertEquals(expected, action.shouldRetry());
       if (expected) {
-        Assert.assertEquals(sleepTime, action.getSleepTime());
+        Assertions.assertEquals(sleepTime, action.getSleepTime());
       } else {
-        Assert.assertEquals(0L, action.getSleepTime().getDuration());
+        Assertions.assertEquals(0L, action.getSleepTime().getDuration());
       }
     }
   }
@@ -97,33 +97,33 @@
         final RetryPolicy.Action action = policy.handleAttemptFailure(event);
 
         final boolean expected = i < n;
-        Assert.assertEquals(expected, action.shouldRetry());
+        Assertions.assertEquals(expected, action.shouldRetry());
         if (expected) {
-          Assert.assertEquals(writeSleep, action.getSleepTime());
+          Assertions.assertEquals(writeSleep, action.getSleepTime());
         } else {
-          Assert.assertEquals(0L, action.getSleepTime().getDuration());
+          Assertions.assertEquals(0L, action.getSleepTime().getDuration());
         }
       }
 
       { //read and stale read are using default
         final ClientRetryEvent event = newClientRetryEvent(i, readRequest, null);
         final RetryPolicy.Action action = policy.handleAttemptFailure(event);
-        Assert.assertTrue(action.shouldRetry());
-        Assert.assertEquals(0L, action.getSleepTime().getDuration());
+        Assertions.assertTrue(action.shouldRetry());
+        Assertions.assertEquals(0L, action.getSleepTime().getDuration());
       }
 
       {
         final ClientRetryEvent event = newClientRetryEvent(i, staleReadRequest, null);
         final RetryPolicy.Action action = policy.handleAttemptFailure(event);
-        Assert.assertTrue(action.shouldRetry());
-        Assert.assertEquals(0L, action.getSleepTime().getDuration());
+        Assertions.assertTrue(action.shouldRetry());
+        Assertions.assertEquals(0L, action.getSleepTime().getDuration());
       }
 
       { //watch has no retry
         final ClientRetryEvent event = newClientRetryEvent(i, watchRequest, null);
         final RetryPolicy.Action action = policy.handleAttemptFailure(event);
-        Assert.assertFalse(action.shouldRetry());
-        Assert.assertEquals(0L, action.getSleepTime().getDuration());
+        Assertions.assertFalse(action.shouldRetry());
+        Assertions.assertEquals(0L, action.getSleepTime().getDuration());
       }
     }
 
@@ -155,15 +155,15 @@
     for (RaftClientRequest request : requests) {
       final ClientRetryEvent event = pending.newClientRetryEvent(request, new Exception());
       final RetryPolicy.Action action = policy.handleAttemptFailure(event);
-      Assert.assertTrue(action.shouldRetry());
-      Assert.assertEquals(0L, action.getSleepTime().getDuration());
+      Assertions.assertTrue(action.shouldRetry());
+      Assertions.assertEquals(0L, action.getSleepTime().getDuration());
     }
 
     timeout.sleep();
     for (RaftClientRequest request : requests) {
       final ClientRetryEvent event = pending.newClientRetryEvent(request, new Exception());
       final RetryPolicy.Action action = policy.handleAttemptFailure(event);
-      Assert.assertFalse(action.shouldRetry());
+      Assertions.assertFalse(action.shouldRetry());
     }
   }
 
@@ -227,11 +227,11 @@
     final RetryPolicy.Action action = retryPolicy.handleAttemptFailure(event);
 
     final boolean expected = exceptionAttemptCount < exceptionPolicyPair.retries;
-    Assert.assertEquals(expected, action.shouldRetry());
+    Assertions.assertEquals(expected, action.shouldRetry());
     if (expected) {
-      Assert.assertEquals(exceptionPolicyPair.sleepTime, action.getSleepTime().getDuration());
+      Assertions.assertEquals(exceptionPolicyPair.sleepTime, action.getSleepTime().getDuration());
     } else {
-      Assert.assertEquals(0L, action.getSleepTime().getDuration());
+      Assertions.assertEquals(0L, action.getSleepTime().getDuration());
     }
   }
 
diff --git a/ratis-test/src/test/java/org/apache/ratis/security/SecurityTestUtils.java b/ratis-test/src/test/java/org/apache/ratis/security/SecurityTestUtils.java
index d6222b2..c390f10 100644
--- a/ratis-test/src/test/java/org/apache/ratis/security/SecurityTestUtils.java
+++ b/ratis-test/src/test/java/org/apache/ratis/security/SecurityTestUtils.java
@@ -23,7 +23,7 @@
 import org.apache.ratis.util.FileUtils;
 import org.bouncycastle.util.io.pem.PemObject;
 import org.bouncycastle.util.io.pem.PemReader;
-import org.junit.Assert;
+import org.junit.jupiter.api.Assertions;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -100,7 +100,7 @@
       KeyFactory keyFactory = KeyFactory.getInstance("RSA");
       return keyFactory.generatePrivate(privKeySpec);
     } catch (Exception e) {
-      Assert.fail("Failed to get private key from " + keyPath + ". Error: "  +
+      Assertions.fail("Failed to get private key from " + keyPath + ". Error: "  +
           e.getMessage());
     }
     return null;
@@ -116,7 +116,7 @@
       }
       return certificate;
     } catch (Exception e) {
-      Assert.fail("Failed to get certificate from " + certPath + ". Error: "  +
+      Assertions.fail("Failed to get certificate from " + certPath + ". Error: "  +
           e.getMessage());
     }
     return null;
@@ -133,7 +133,7 @@
       keyStore.setKeyEntry("ratis-server-key", privateKey, new char[0], certificate);
       return keyStore;
     } catch (Exception e) {
-      Assert.fail("Failed to get sever key store " + e.getMessage());
+      Assertions.fail("Failed to get sever key store " + e.getMessage());
     }
     return null;
   }
@@ -149,7 +149,7 @@
       keyStore.setKeyEntry("ratis-client-key", privateKey, new char[0], certificate);
       return keyStore;
     } catch (Exception e) {
-      Assert.fail("Failed to get client key store " + e.getMessage());
+      Assertions.fail("Failed to get client key store " + e.getMessage());
     }
     return null;
   }
@@ -167,7 +167,7 @@
       }
       return trustStore;
     } catch (Exception e) {
-      Assert.fail("Failed to get sever key store " + e.getMessage());
+      Assertions.fail("Failed to get sever key store " + e.getMessage());
     }
     return null;
   }
diff --git a/ratis-test/src/test/java/org/apache/ratis/server/ServerBuilderTest.java b/ratis-test/src/test/java/org/apache/ratis/server/ServerBuilderTest.java
index dd76a2e..9360b9b 100644
--- a/ratis-test/src/test/java/org/apache/ratis/server/ServerBuilderTest.java
+++ b/ratis-test/src/test/java/org/apache/ratis/server/ServerBuilderTest.java
@@ -26,8 +26,8 @@
 import org.apache.ratis.protocol.RaftPeerId;
 import org.apache.ratis.statemachine.impl.BaseStateMachine;
 import org.apache.ratis.util.Preconditions;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 
 /**
  * Test {@link RaftServer.Builder}.
@@ -58,7 +58,7 @@
                 .setStateMachine(new BaseStateMachine())
                 .setProperties(new RaftProperties())
                 .build();
-            Assert.fail("did not get expected exception");
+            Assertions.fail("did not get expected exception");
         } catch (IOException e) {
             Preconditions.assertInstanceOf(e.getCause(), IllegalStateException.class);
         }
@@ -74,7 +74,7 @@
                 .setStateMachine(new BaseStateMachine())
                 .setProperties(new RaftProperties())
                 .build();
-            Assert.fail("did not get expected exception");
+            Assertions.fail("did not get expected exception");
         } catch (IOException e) {
             Preconditions.assertInstanceOf(e.getCause(), IllegalStateException.class);
         }
diff --git a/ratis-test/src/test/java/org/apache/ratis/server/ServerRestartTests.java b/ratis-test/src/test/java/org/apache/ratis/server/ServerRestartTests.java
index 2f3edf7..db4e92b 100644
--- a/ratis-test/src/test/java/org/apache/ratis/server/ServerRestartTests.java
+++ b/ratis-test/src/test/java/org/apache/ratis/server/ServerRestartTests.java
@@ -46,8 +46,8 @@
 import org.apache.ratis.util.SizeInBytes;
 import org.apache.ratis.util.StringUtils;
 import org.apache.ratis.util.TimeDuration;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 import org.slf4j.Logger;
 import org.slf4j.event.Level;
 
@@ -111,7 +111,7 @@
     // make sure the restarted follower can catchup
     final RaftServer.Division followerState = cluster.getDivision(followerId);
     JavaUtils.attemptRepeatedly(() -> {
-      Assert.assertTrue(followerState.getInfo().getLastAppliedIndex() >= leaderLastIndex);
+      Assertions.assertTrue(followerState.getInfo().getLastAppliedIndex() >= leaderLastIndex);
       return null;
     }, 10, ONE_SECOND, "follower catchup", LOG);
 
@@ -119,9 +119,9 @@
     final RaftServer.Division follower = cluster.restartServer(followerId, false);
     final RaftLog followerLog = follower.getRaftLog();
     final long followerLastIndex = followerLog.getLastEntryTermIndex().getIndex();
-    Assert.assertTrue(followerLastIndex >= leaderLastIndex);
+    Assertions.assertTrue(followerLastIndex >= leaderLastIndex);
     final long leaderFinalIndex = cluster.getLeader().getRaftLog().getLastEntryTermIndex().getIndex();
-    Assert.assertEquals(leaderFinalIndex, followerLastIndex);
+    Assertions.assertEquals(leaderFinalIndex, followerLastIndex);
 
     final File followerOpenLogFile = getOpenLogFile(follower);
     final File leaderOpenLogFile = getOpenLogFile(cluster.getDivision(leaderId));
@@ -148,7 +148,7 @@
         if (i != truncatedMessageIndex) {
           final Message m = new SimpleMessage("m" + i);
           final RaftClientReply reply = client.io().sendReadOnly(m);
-          Assert.assertTrue(reply.isSuccess());
+          Assertions.assertTrue(reply.isSuccess());
           LOG.info("query {}: {} {}", m, reply, LogEntryProto.parseFrom(reply.getMessage().getContent()));
         }
       }
@@ -159,7 +159,7 @@
     try(final RaftClient client = cluster.createClient()) {
       // write some messages
       for(int i = 0; i < 10; i++) {
-        Assert.assertTrue(client.io().send(newMessage.get()).isSuccess());
+        Assertions.assertTrue(client.io().send(newMessage.get()).isSuccess());
       }
     }
   }
@@ -171,7 +171,7 @@
     }
     final RaftServer.Division server = cluster.restartServer(id, false);
     // the last index should be one less than before
-    Assert.assertEquals(lastIndex - 1, server.getRaftLog().getLastEntryTermIndex().getIndex());
+    Assertions.assertEquals(lastIndex - 1, server.getRaftLog().getLastEntryTermIndex().getIndex());
     server.getRaftServer().close();
   }
 
@@ -184,7 +184,7 @@
 
   static File getOpenLogFile(RaftServer.Division server) throws Exception {
     final List<Path> openLogs = getOpenLogFiles(server);
-    Assert.assertEquals(1, openLogs.size());
+    Assertions.assertEquals(1, openLogs.size());
     return openLogs.get(0).toFile();
   }
 
@@ -210,7 +210,7 @@
           10, HUNDRED_MILLIS, impl.getId() + "-getOpenLogFile", LOG);
       for(int i = 0; i < SegmentedRaftLogFormat.getHeaderLength(); i++) {
         assertCorruptedLogHeader(impl.getId(), openLogFile, i, cluster, LOG);
-        Assert.assertTrue(getOpenLogFiles(impl).isEmpty());
+        Assertions.assertTrue(getOpenLogFiles(impl).isEmpty());
       }
     }
   }
@@ -245,7 +245,7 @@
       final SimpleMessage m = messages[i];
       new Thread(() -> {
         try (final RaftClient client = cluster.createClient()) {
-          Assert.assertTrue(client.io().send(m).isSuccess());
+          Assertions.assertTrue(client.io().send(m).isSuccess());
         } catch (IOException e) {
           throw new IllegalStateException("Failed to send " + m, e);
         }
@@ -301,11 +301,11 @@
       final RaftServer.Division server = cluster.getDivision(id);
       final RaftLog raftLog = server.getRaftLog();
       JavaUtils.attemptRepeatedly(() -> {
-        Assert.assertTrue(raftLog.getLastCommittedIndex() >= loggedCommitIndex);
+        Assertions.assertTrue(raftLog.getLastCommittedIndex() >= loggedCommitIndex);
         return null;
       }, 10, HUNDRED_MILLIS, id + "(commitIndex >= loggedCommitIndex)", LOG);
       JavaUtils.attemptRepeatedly(() -> {
-        Assert.assertTrue(server.getInfo().getLastAppliedIndex() >= loggedCommitIndex);
+        Assertions.assertTrue(server.getInfo().getLastAppliedIndex() >= loggedCommitIndex);
         return null;
       }, 10, HUNDRED_MILLIS, id + "(lastAppliedIndex >= loggedCommitIndex)", LOG);
       LOG.info("{}: commitIndex={}, lastAppliedIndex={}",
@@ -318,16 +318,16 @@
     final RaftLog raftLog = server.getRaftLog();
     final long lastIndex = raftLog.getLastEntryTermIndex().getIndex();
     final LogEntryProto lastEntry = raftLog.get(lastIndex);
-    Assert.assertTrue(lastEntry.hasMetadataEntry());
+    Assertions.assertTrue(lastEntry.hasMetadataEntry());
 
     final long loggedCommitIndex = lastEntry.getMetadataEntry().getCommitIndex();
     final LogEntryProto lastCommittedEntry = raftLog.get(loggedCommitIndex);
-    Assert.assertTrue(lastCommittedEntry.hasStateMachineLogEntry());
+    Assertions.assertTrue(lastCommittedEntry.hasStateMachineLogEntry());
 
     final SimpleStateMachine4Testing leaderStateMachine = SimpleStateMachine4Testing.get(server);
     final TermIndex lastAppliedTermIndex = leaderStateMachine.getLastAppliedTermIndex();
-    Assert.assertEquals(lastCommittedEntry.getTerm(), lastAppliedTermIndex.getTerm());
-    Assert.assertTrue(lastCommittedEntry.getIndex() <= lastAppliedTermIndex.getIndex());
+    Assertions.assertEquals(lastCommittedEntry.getTerm(), lastAppliedTermIndex.getTerm());
+    Assertions.assertTrue(lastCommittedEntry.getIndex() <= lastAppliedTermIndex.getIndex());
   }
 
   @Test
@@ -364,11 +364,11 @@
     final SimpleMessage lastMessage = messages[messages.length - 1];
     try (final RaftClient client = cluster.createClient()) {
       for (SimpleMessage m : messages) {
-        Assert.assertTrue(client.io().send(m).isSuccess());
+        Assertions.assertTrue(client.io().send(m).isSuccess());
       }
 
       // assert that the last message exists
-      Assert.assertTrue(client.io().sendReadOnly(lastMessage).isSuccess());
+      Assertions.assertTrue(client.io().sendReadOnly(lastMessage).isSuccess());
     }
 
     final RaftLog log = leader.getRaftLog();
diff --git a/ratis-test/src/test/java/org/apache/ratis/server/TestRaftServerConfigKeys.java b/ratis-test/src/test/java/org/apache/ratis/server/TestRaftServerConfigKeys.java
index bb386e8..2026398 100644
--- a/ratis-test/src/test/java/org/apache/ratis/server/TestRaftServerConfigKeys.java
+++ b/ratis-test/src/test/java/org/apache/ratis/server/TestRaftServerConfigKeys.java
@@ -23,9 +23,9 @@
 import org.apache.ratis.util.FileUtils;
 import org.apache.ratis.util.JavaUtils;
 import org.apache.ratis.util.SizeInBytes;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 
 import java.io.File;
 import java.io.IOException;
@@ -51,7 +51,7 @@
           JavaUtils.getClassSimpleName(TestRaftServerConfigKeys.class) +
               Integer.toHexString(ThreadLocalRandom.current().nextInt())));
 
-  @AfterClass
+  @AfterAll
   public static void tearDown() throws IOException {
     FileUtils.deleteFully(rootTestDir.get());
   }
@@ -74,7 +74,7 @@
     final String expected = directories.stream().map(File::getAbsolutePath)
         .collect(Collectors.joining(","));
     final String actual = properties.get(RaftServerConfigKeys.STORAGE_DIR_KEY);
-    Assert.assertEquals(expected, actual);
+    Assertions.assertEquals(expected, actual);
   }
 
   /**
@@ -97,8 +97,8 @@
     final List<String> actualDirs = storageDirs.stream()
         .map(File::getAbsolutePath).collect(Collectors.toList());
     actualDirs.removeAll(expectedDirs);
-    Assert.assertEquals(directories.size(), storageDirs.size());
-    Assert.assertEquals(0, actualDirs.size());
+    Assertions.assertEquals(directories.size(), storageDirs.size());
+    Assertions.assertEquals(0, actualDirs.size());
   }
 
   /**
@@ -113,6 +113,6 @@
     int pendingRequestMegabyteLimit = Math.toIntExact(
         RaftServerConfigKeys.Write.byteLimit(properties).getSize()
             / SizeInBytes.ONE_MB.getSize());
-    Assert.assertEquals(4096, pendingRequestMegabyteLimit);
+    Assertions.assertEquals(4096, pendingRequestMegabyteLimit);
   }
 }
\ No newline at end of file
diff --git a/ratis-test/src/test/java/org/apache/ratis/server/impl/TestPeerConfiguration.java b/ratis-test/src/test/java/org/apache/ratis/server/impl/TestPeerConfiguration.java
index e1adcfa..df4d53c 100644
--- a/ratis-test/src/test/java/org/apache/ratis/server/impl/TestPeerConfiguration.java
+++ b/ratis-test/src/test/java/org/apache/ratis/server/impl/TestPeerConfiguration.java
@@ -20,14 +20,14 @@
 import org.apache.ratis.BaseTest;
 import org.apache.ratis.protocol.RaftPeer;
 import org.apache.ratis.protocol.RaftPeerId;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.stream.Collectors;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 public class TestPeerConfiguration extends BaseTest {
   @Test
diff --git a/ratis-test/src/test/java/org/apache/ratis/server/impl/TestRaftConfiguration.java b/ratis-test/src/test/java/org/apache/ratis/server/impl/TestRaftConfiguration.java
index 14e0030..77ec0ed 100644
--- a/ratis-test/src/test/java/org/apache/ratis/server/impl/TestRaftConfiguration.java
+++ b/ratis-test/src/test/java/org/apache/ratis/server/impl/TestRaftConfiguration.java
@@ -22,14 +22,14 @@
 import org.apache.ratis.protocol.RaftPeer;
 import org.apache.ratis.protocol.RaftPeerId;
 import org.apache.ratis.server.RaftConfiguration;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.stream.Collectors;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 public class TestRaftConfiguration extends BaseTest {
   @Test
@@ -65,29 +65,29 @@
     RaftConfigurationImpl config = RaftConfigurationImpl.newBuilder()
         .setConf(new PeerConfiguration(raftPeersWithPriority(1)))
         .build();
-    assertTrue("Peer is in single mode.", config.isSingleMode(RaftPeerId.valueOf("1")));
+    assertTrue(config.isSingleMode(RaftPeerId.valueOf("1")), "Peer is in single mode.");
 
     config = RaftConfigurationImpl.newBuilder()
         .setConf(new PeerConfiguration(raftPeersWithPriority(0, 1)))
         .setOldConf(new PeerConfiguration(raftPeersWithPriority(0)))
         .build();
-    assertTrue("Peer is in single mode.", config.isSingleMode(RaftPeerId.valueOf("0")));
-    assertFalse("Peer is a new peer.", config.isSingleMode(RaftPeerId.valueOf("1")));
+    assertTrue(config.isSingleMode(RaftPeerId.valueOf("0")), "Peer is in single mode.");
+    assertFalse(config.isSingleMode(RaftPeerId.valueOf("1")), "Peer is a new peer");
 
     config = RaftConfigurationImpl.newBuilder()
         .setConf(new PeerConfiguration(raftPeersWithPriority(0, 1)))
         .build();
-    assertFalse("Peer is in ha mode.", config.isSingleMode(RaftPeerId.valueOf("0")));
-    assertFalse("Peer is in ha mode.", config.isSingleMode(RaftPeerId.valueOf("1")));
+    assertFalse(config.isSingleMode(RaftPeerId.valueOf("0")), "Peer is in ha mode.");
+    assertFalse(config.isSingleMode(RaftPeerId.valueOf("1")), "Peer is in ha mode.");
 
     config = RaftConfigurationImpl.newBuilder()
         .setConf(new PeerConfiguration(raftPeersWithPriority(0, 1)))
         .setOldConf(new PeerConfiguration(raftPeersWithPriority(2, 3)))
         .build();
-    assertFalse("Peer is in ha mode.", config.isSingleMode(RaftPeerId.valueOf("0")));
-    assertFalse("Peer is in ha mode.", config.isSingleMode(RaftPeerId.valueOf("1")));
-    assertFalse("Peer is in ha mode.", config.isSingleMode(RaftPeerId.valueOf("3")));
-    assertFalse("Peer is in ha mode.", config.isSingleMode(RaftPeerId.valueOf("4")));
+    assertFalse(config.isSingleMode(RaftPeerId.valueOf("0")), "Peer is in ha mode.");
+    assertFalse(config.isSingleMode(RaftPeerId.valueOf("1")), "Peer is in ha mode.");
+    assertFalse(config.isSingleMode(RaftPeerId.valueOf("3")), "Peer is in ha mode.");
+    assertFalse(config.isSingleMode(RaftPeerId.valueOf("4")), "Peer is in ha mode.");
   }
 
   @Test
@@ -96,8 +96,8 @@
     RaftConfigurationImpl config = RaftConfigurationImpl.newBuilder()
         .setConf(new PeerConfiguration(raftPeersWithPriority(1)))
         .build();
-    assertFalse("Change from single mode to ha mode is not considered as changing majority.",
-        config.changeMajority(raftPeersWithPriority(1, 2)));
+    assertFalse(config.changeMajority(raftPeersWithPriority(1, 2)),
+        "Change from single mode to ha mode is not considered as changing majority.");
 
     // Case 2: {1} --> {2}.
     assertTrue(config.changeMajority(raftPeersWithPriority(2)));
diff --git a/ratis-test/src/test/java/org/apache/ratis/server/impl/TestRaftServerJmx.java b/ratis-test/src/test/java/org/apache/ratis/server/impl/TestRaftServerJmx.java
index 01d8392..39a1f88 100644
--- a/ratis-test/src/test/java/org/apache/ratis/server/impl/TestRaftServerJmx.java
+++ b/ratis-test/src/test/java/org/apache/ratis/server/impl/TestRaftServerJmx.java
@@ -24,8 +24,9 @@
 import org.apache.ratis.server.RaftServerMXBean;
 import org.apache.ratis.server.simulation.MiniRaftClusterWithSimulatedRpc;
 import org.apache.ratis.util.JmxRegister;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
 
 import javax.management.JMException;
 import javax.management.MBeanServer;
@@ -38,7 +39,8 @@
 import static org.apache.ratis.RaftTestUtil.waitForLeader;
 
 public class TestRaftServerJmx extends BaseTest {
-  @Test(timeout = 30000)
+  @Test
+  @Timeout(value = 30000)
   public void testJmxBeans() throws Exception {
     final int NUM_SERVERS = 3;
     final MiniRaftClusterWithSimulatedRpc cluster
@@ -48,16 +50,17 @@
 
     MBeanServer platformMBeanServer = ManagementFactory.getPlatformMBeanServer();
     Set<ObjectInstance> objectInstances = platformMBeanServer.queryMBeans(new ObjectName("Ratis:*"), null);
-    Assert.assertEquals(NUM_SERVERS, objectInstances.size());
+    Assertions.assertEquals(NUM_SERVERS, objectInstances.size());
 
     for (ObjectInstance instance : objectInstances) {
       Object groupId = platformMBeanServer.getAttribute(instance.getObjectName(), "GroupId");
-      Assert.assertEquals(cluster.getGroupId().toString(), groupId);
+      Assertions.assertEquals(cluster.getGroupId().toString(), groupId);
     }
     cluster.shutdown();
   }
 
-  @Test(timeout = 30000)
+  @Test
+  @Timeout(value = 30000)
   public void testRegister() throws JMException {
     {
       final JmxRegister jmx = new JmxRegister();
@@ -102,11 +105,11 @@
     final String id = RaftPeerId.valueOf(name).toString();
     final String groupId = RaftGroupId.randomId().toString();
     final boolean succeeded = RaftServerJmxAdapter.registerMBean(id, groupId, mBean, jmx);
-    Assert.assertEquals(expectToSucceed, succeeded);
+    Assertions.assertEquals(expectToSucceed, succeeded);
   }
 
   static void runUnregister(boolean expectToSucceed, JmxRegister jmx) throws JMException {
     final boolean succeeded = jmx.unregister();
-    Assert.assertEquals(expectToSucceed, succeeded);
+    Assertions.assertEquals(expectToSucceed, succeeded);
   }
 }
diff --git a/ratis-test/src/test/java/org/apache/ratis/server/raftlog/TestRaftLogIndex.java b/ratis-test/src/test/java/org/apache/ratis/server/raftlog/TestRaftLogIndex.java
index ac65522..d3b4b5c 100644
--- a/ratis-test/src/test/java/org/apache/ratis/server/raftlog/TestRaftLogIndex.java
+++ b/ratis-test/src/test/java/org/apache/ratis/server/raftlog/TestRaftLogIndex.java
@@ -18,8 +18,8 @@
 package org.apache.ratis.server.raftlog;
 
 import org.apache.ratis.BaseTest;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 
 import java.util.function.BiFunction;
 import java.util.function.Consumer;
@@ -34,10 +34,10 @@
 
   static void assertUpdate(RaftLogIndex index, BiFunction<RaftLogIndex, LongUnaryOperator, Boolean> update,
       long oldValue, LongUnaryOperator op, boolean expectUpdate) {
-    Assert.assertEquals(oldValue, index.get());
+    Assertions.assertEquals(oldValue, index.get());
     final boolean updated = update.apply(index, op);
-    Assert.assertEquals(expectUpdate, updated);
-    Assert.assertEquals(expectUpdate? op.applyAsLong(oldValue): oldValue, index.get());
+    Assertions.assertEquals(expectUpdate, updated);
+    Assertions.assertEquals(expectUpdate? op.applyAsLong(oldValue): oldValue, index.get());
   }
 
 
@@ -45,7 +45,7 @@
   public void testIndex() {
     final int initialValue = 900;
     final RaftLogIndex index = new RaftLogIndex("index", initialValue);
-    Assert.assertEquals(initialValue, index.get());
+    Assertions.assertEquals(initialValue, index.get());
 
     final Consumer<Object> log = System.out::println;
     { // test updateIncreasingly
diff --git a/ratis-test/src/test/java/org/apache/ratis/server/raftlog/TestRaftLogMetrics.java b/ratis-test/src/test/java/org/apache/ratis/server/raftlog/TestRaftLogMetrics.java
index 70b185e..65493d7 100644
--- a/ratis-test/src/test/java/org/apache/ratis/server/raftlog/TestRaftLogMetrics.java
+++ b/ratis-test/src/test/java/org/apache/ratis/server/raftlog/TestRaftLogMetrics.java
@@ -36,8 +36,8 @@
 import org.apache.ratis.statemachine.impl.BaseStateMachine;
 import org.apache.ratis.util.JavaUtils;
 import org.apache.ratis.util.TimeDuration;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 
 import javax.management.ObjectName;
 import java.lang.management.ManagementFactory;
@@ -116,7 +116,7 @@
   static void assertCommitCount(RaftServer.Division server, int expectedMsgs) {
     final RatisMetricRegistry rlm = ((RatisMetrics)server.getRaftLog().getRaftLogMetrics()).getRegistry();
     long stmCount = rlm.counter(STATE_MACHINE_LOG_ENTRY_COUNT).getCount();
-    Assert.assertEquals(expectedMsgs, stmCount);
+    Assertions.assertEquals(expectedMsgs, stmCount);
   }
 
   static RatisMetricRegistryImpl getRegistry(RaftGroupMemberId memberId) {
@@ -127,21 +127,21 @@
     final String flushTimeMetric = RaftStorageTestUtils.getLogFlushTimeMetric(server.getMemberId().toString());
     final RatisMetricRegistryImpl ratisMetricRegistry = getRegistry(server.getMemberId());
     Timer tm = (Timer) ratisMetricRegistry.get(RAFT_LOG_FLUSH_TIME);
-    Assert.assertNotNull(tm);
+    Assertions.assertNotNull(tm);
 
     final MetricsStateMachine stateMachine = MetricsStateMachine.get(server);
     final int expectedFlush = stateMachine.getFlushCount();
 
     JavaUtils.attemptRepeatedly(() -> {
-      Assert.assertEquals(expectedFlush, tm.getCount());
+      Assertions.assertEquals(expectedFlush, tm.getCount());
       return null;
     }, 50, HUNDRED_MILLIS, "expectedFlush == tm.getCount()", null);
 
-    Assert.assertTrue(tm.getMeanRate() > 0);
+    Assertions.assertTrue(tm.getMeanRate() > 0);
 
     // Test jmx
     ObjectName oname = new ObjectName(RATIS_APPLICATION_NAME_METRICS, "name", flushTimeMetric);
-    Assert.assertEquals(expectedFlush,
+    Assertions.assertEquals(expectedFlush,
         ((Long) ManagementFactory.getPlatformMBeanServer().getAttribute(oname, "Count"))
             .intValue());
   }
@@ -152,42 +152,42 @@
 
     //Test sync count
     Timer tm = (Timer) ratisMetricRegistry.get(RAFT_LOG_SYNC_TIME);
-    Assert.assertNotNull(tm);
+    Assertions.assertNotNull(tm);
     final MetricsStateMachine stateMachine = MetricsStateMachine.get(server);
     final int expectedFlush = stateMachine.getFlushCount();
-    Assert.assertEquals(expectedFlush, tm.getCount()); // Ideally, flushCount should be same as syncCount.
-    Assert.assertTrue(tm.getMeanRate() > 0);
+    Assertions.assertEquals(expectedFlush, tm.getCount()); // Ideally, flushCount should be same as syncCount.
+    Assertions.assertTrue(tm.getMeanRate() > 0);
 
     // Test jmx. Just testing one metric's JMX is good enough.
     ObjectName oname = new ObjectName(RATIS_APPLICATION_NAME_METRICS, "name", syncTimeMetric);
-    Assert.assertEquals(expectedFlush,
+    Assertions.assertEquals(expectedFlush,
         ((Long) ManagementFactory.getPlatformMBeanServer().getAttribute(oname, "Count"))
             .intValue());
 
     long cacheMissCount = ratisMetricRegistry.counter(RAFT_LOG_CACHE_MISS_COUNT).getCount();
-    Assert.assertEquals(0, cacheMissCount);
+    Assertions.assertEquals(0, cacheMissCount);
 
     long cacheHitsCount = ratisMetricRegistry.counter(RAFT_LOG_CACHE_HIT_COUNT).getCount();
-    Assert.assertTrue(cacheHitsCount > 0);
+    Assertions.assertTrue(cacheHitsCount > 0);
 
-    Assert.assertTrue(ratisMetricRegistry.counter(RAFT_LOG_FLUSH_COUNT).getCount() > 0);
-    Assert.assertTrue(ratisMetricRegistry.counter(RAFT_LOG_APPEND_ENTRY_COUNT).getCount() > 0);
+    Assertions.assertTrue(ratisMetricRegistry.counter(RAFT_LOG_FLUSH_COUNT).getCount() > 0);
+    Assertions.assertTrue(ratisMetricRegistry.counter(RAFT_LOG_APPEND_ENTRY_COUNT).getCount() > 0);
 
     final DefaultTimekeeperImpl appendEntry = (DefaultTimekeeperImpl) ratisMetricRegistry.timer(RAFT_LOG_APPEND_ENTRY_LATENCY);
-    Assert.assertTrue(appendEntry.getTimer().getMeanRate() > 0);
+    Assertions.assertTrue(appendEntry.getTimer().getMeanRate() > 0);
 
     final DefaultTimekeeperImpl taskQueue = (DefaultTimekeeperImpl) ratisMetricRegistry.timer(RAFT_LOG_TASK_QUEUE_TIME);
-    Assert.assertTrue(taskQueue.getTimer().getMeanRate() > 0);
+    Assertions.assertTrue(taskQueue.getTimer().getMeanRate() > 0);
 
     final DefaultTimekeeperImpl enqueueDelay = (DefaultTimekeeperImpl) ratisMetricRegistry.timer(RAFT_LOG_TASK_ENQUEUE_DELAY);
-    Assert.assertTrue(enqueueDelay.getTimer().getMeanRate() > 0);
+    Assertions.assertTrue(enqueueDelay.getTimer().getMeanRate() > 0);
 
     final DefaultTimekeeperImpl write = (DefaultTimekeeperImpl) ratisMetricRegistry.timer(
         String.format(RAFT_LOG_TASK_EXECUTION_TIME, "writelog"));
-    Assert.assertTrue(write.getTimer().getMeanRate() > 0);
+    Assertions.assertTrue(write.getTimer().getMeanRate() > 0);
 
-    Assert.assertNotNull(ratisMetricRegistry.get(RAFT_LOG_DATA_QUEUE_SIZE));
-    Assert.assertNotNull(ratisMetricRegistry.get(RAFT_LOG_WORKER_QUEUE_SIZE));
-    Assert.assertNotNull(ratisMetricRegistry.get(RAFT_LOG_SYNC_BATCH_SIZE));
+    Assertions.assertNotNull(ratisMetricRegistry.get(RAFT_LOG_DATA_QUEUE_SIZE));
+    Assertions.assertNotNull(ratisMetricRegistry.get(RAFT_LOG_WORKER_QUEUE_SIZE));
+    Assertions.assertNotNull(ratisMetricRegistry.get(RAFT_LOG_SYNC_BATCH_SIZE));
   }
 }
\ No newline at end of file
diff --git a/ratis-test/src/test/java/org/apache/ratis/server/raftlog/memory/MemoryRaftLogTest.java b/ratis-test/src/test/java/org/apache/ratis/server/raftlog/memory/MemoryRaftLogTest.java
index 503de34..e88699b 100644
--- a/ratis-test/src/test/java/org/apache/ratis/server/raftlog/memory/MemoryRaftLogTest.java
+++ b/ratis-test/src/test/java/org/apache/ratis/server/raftlog/memory/MemoryRaftLogTest.java
@@ -17,7 +17,7 @@
  */
 package org.apache.ratis.server.raftlog.memory;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -35,7 +35,7 @@
 import org.apache.ratis.statemachine.StateMachine;
 import org.apache.ratis.util.ReferenceCountedObject;
 import org.apache.ratis.util.Slf4jUtils;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.slf4j.event.Level;
 
 public class MemoryRaftLogTest extends BaseTest {
diff --git a/ratis-test/src/test/java/org/apache/ratis/server/raftlog/segmented/TestBufferedWriteChannel.java b/ratis-test/src/test/java/org/apache/ratis/server/raftlog/segmented/TestBufferedWriteChannel.java
index c9d7928..cefd5f6 100644
--- a/ratis-test/src/test/java/org/apache/ratis/server/raftlog/segmented/TestBufferedWriteChannel.java
+++ b/ratis-test/src/test/java/org/apache/ratis/server/raftlog/segmented/TestBufferedWriteChannel.java
@@ -18,9 +18,8 @@
 package org.apache.ratis.server.raftlog.segmented;
 
 import org.apache.ratis.BaseTest;
-import org.apache.ratis.util.StringUtils;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 
 import java.io.IOException;
 import java.nio.ByteBuffer;
@@ -40,8 +39,8 @@
     private long forcedPosition = 0;
 
     void assertValues(long expectedPosition, long expectedForcedPosition) {
-      Assert.assertEquals(expectedPosition, position);
-      Assert.assertEquals(expectedForcedPosition, forcedPosition);
+      Assertions.assertEquals(expectedPosition, position);
+      Assertions.assertEquals(expectedForcedPosition, forcedPosition);
     }
 
     @Override
@@ -200,7 +199,7 @@
       AtomicInteger pos, AtomicInteger force) throws IOException {
     final int existing = out.writeBufferPosition();
     out.flush();
-    Assert.assertEquals(0, out.writeBufferPosition());
+    Assertions.assertEquals(0, out.writeBufferPosition());
     pos.addAndGet(existing);
     force.set(pos.get());
     fake.assertValues(pos.get(), force.get());
@@ -213,9 +212,9 @@
     out.writeToBuffer(n, b -> b.put(buffer));
     if (existing + n > bufferCapacity) {
       pos.addAndGet(existing);
-      Assert.assertEquals(n, out.writeBufferPosition());
+      Assertions.assertEquals(n, out.writeBufferPosition());
     } else {
-      Assert.assertEquals(existing + n, out.writeBufferPosition());
+      Assertions.assertEquals(existing + n, out.writeBufferPosition());
     }
     fake.assertValues(pos.get(), force.get());
   }
diff --git a/ratis-test/src/test/java/org/apache/ratis/server/raftlog/segmented/TestCacheEviction.java b/ratis-test/src/test/java/org/apache/ratis/server/raftlog/segmented/TestCacheEviction.java
index 675df51..ee73a70 100644
--- a/ratis-test/src/test/java/org/apache/ratis/server/raftlog/segmented/TestCacheEviction.java
+++ b/ratis-test/src/test/java/org/apache/ratis/server/raftlog/segmented/TestCacheEviction.java
@@ -40,8 +40,8 @@
 import org.apache.ratis.util.JavaUtils;
 import org.apache.ratis.util.ReferenceCountedObject;
 import org.apache.ratis.util.SizeInBytes;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 import org.mockito.Mockito;
 
 import java.io.File;
@@ -56,7 +56,7 @@
   private static final CacheInvalidationPolicy policy = new CacheInvalidationPolicyDefault();
 
   static LogSegmentList prepareSegments(int numSegments, boolean[] cached, long start, long size) {
-    Assert.assertEquals(numSegments, cached.length);
+    Assertions.assertEquals(numSegments, cached.length);
     final LogSegmentList segments = new LogSegmentList(JavaUtils.getClassSimpleName(TestCacheEviction.class));
     for (int i = 0; i < numSegments; i++) {
       LogSegment s = LogSegment.newCloseSegment(null, start, start + size - 1, MAX_OP_SIZE, null);
@@ -78,35 +78,35 @@
 
     // case 1, make sure we do not evict cache for segments behind local flushed index
     List<LogSegment> evicted = policy.evict(null, 5, 15, segments, maxCached);
-    Assert.assertEquals(0, evicted.size());
+    Assertions.assertEquals(0, evicted.size());
 
     // case 2, suppose the local flushed index is in the 3rd segment, then we
     // can evict the first two segment
     evicted = policy.evict(null, 25, 30, segments, maxCached);
-    Assert.assertEquals(2, evicted.size());
-    Assert.assertSame(evicted.get(0), segments.get(0));
-    Assert.assertSame(evicted.get(1), segments.get(1));
+    Assertions.assertEquals(2, evicted.size());
+    Assertions.assertSame(evicted.get(0), segments.get(0));
+    Assertions.assertSame(evicted.get(1), segments.get(1));
 
     // case 3, similar with case 2, but the local applied index is less than
     // the local flushed index.
     evicted = policy.evict(null, 25, 15, segments, maxCached);
-    Assert.assertEquals(1, evicted.size());
-    Assert.assertSame(evicted.get(0), segments.get(0));
+    Assertions.assertEquals(1, evicted.size());
+    Assertions.assertSame(evicted.get(0), segments.get(0));
 
     // case 4, the local applied index is very small, then evict cache behind it
     // first and let the state machine load the segments later
     evicted = policy.evict(null, 35, 5, segments, maxCached);
-    Assert.assertEquals(1, evicted.size());
-    Assert.assertSame(evicted.get(0), segments.get(2));
+    Assertions.assertEquals(1, evicted.size());
+    Assertions.assertSame(evicted.get(0), segments.get(2));
 
     Mockito.when(segments.get(2).hasCache()).thenReturn(false);
     evicted = policy.evict(null, 35, 5, segments, maxCached);
-    Assert.assertEquals(1, evicted.size());
-    Assert.assertSame(evicted.get(0), segments.get(1));
+    Assertions.assertEquals(1, evicted.size());
+    Assertions.assertSame(evicted.get(0), segments.get(1));
 
     Mockito.when(segments.get(1).hasCache()).thenReturn(false);
     evicted = policy.evict(null, 35, 5, segments, maxCached);
-    Assert.assertEquals(0, evicted.size());
+    Assertions.assertEquals(0, evicted.size());
   }
 
   @Test
@@ -119,37 +119,37 @@
     // flushed index
     List<LogSegment> evicted = policy.evict(new long[]{20, 40, 40}, 5, 15, segments,
         maxCached);
-    Assert.assertEquals(0, evicted.size());
+    Assertions.assertEquals(0, evicted.size());
 
     // case 2, the follower indices are behind the local flushed index
     evicted = policy.evict(new long[]{30, 40, 45}, 25, 30, segments, maxCached);
-    Assert.assertEquals(2, evicted.size());
-    Assert.assertSame(evicted.get(0), segments.get(0));
-    Assert.assertSame(evicted.get(1), segments.get(1));
+    Assertions.assertEquals(2, evicted.size());
+    Assertions.assertSame(evicted.get(0), segments.get(0));
+    Assertions.assertSame(evicted.get(1), segments.get(1));
 
     // case 3, similar with case 3 in basic eviction test
     evicted = policy.evict(new long[]{30, 40, 45}, 25, 15, segments, maxCached);
-    Assert.assertEquals(1, evicted.size());
-    Assert.assertSame(evicted.get(0), segments.get(0));
+    Assertions.assertEquals(1, evicted.size());
+    Assertions.assertSame(evicted.get(0), segments.get(0));
 
     // case 4, the followers are slower than local flush
     evicted = policy.evict(new long[]{15, 45, 45}, 55, 50, segments, maxCached);
-    Assert.assertEquals(1, evicted.size());
-    Assert.assertSame(evicted.get(0), segments.get(0));
+    Assertions.assertEquals(1, evicted.size());
+    Assertions.assertSame(evicted.get(0), segments.get(0));
 
     Mockito.when(segments.get(0).hasCache()).thenReturn(false);
     evicted = policy.evict(new long[]{15, 45, 45}, 55, 50, segments, maxCached);
-    Assert.assertEquals(1, evicted.size());
-    Assert.assertSame(evicted.get(0), segments.get(2));
+    Assertions.assertEquals(1, evicted.size());
+    Assertions.assertSame(evicted.get(0), segments.get(2));
 
     Mockito.when(segments.get(2).hasCache()).thenReturn(false);
     evicted = policy.evict(new long[]{15, 45, 45}, 55, 50, segments, maxCached);
-    Assert.assertEquals(1, evicted.size());
-    Assert.assertSame(evicted.get(0), segments.get(3));
+    Assertions.assertEquals(1, evicted.size());
+    Assertions.assertSame(evicted.get(0), segments.get(3));
 
     Mockito.when(segments.get(3).hasCache()).thenReturn(false);
     evicted = policy.evict(new long[]{15, 45, 45}, 55, 50, segments, maxCached);
-    Assert.assertEquals(0, evicted.size());
+    Assertions.assertEquals(0, evicted.size());
   }
 
   @Test
@@ -178,7 +178,7 @@
     raftLog.append(ReferenceCountedObject.wrap(entries)).forEach(CompletableFuture::join);
 
     // check the current cached segment number: the last segment is still open
-    Assert.assertEquals(maxCachedNum - 1,
+    Assertions.assertEquals(maxCachedNum - 1,
         raftLog.getRaftLogCache().getCachedSegmentNum());
 
     Mockito.when(info.getLastAppliedIndex()).thenReturn(35L);
@@ -189,7 +189,7 @@
 
     // check the cached segment number again. since the slowest follower is on
     // index 21, the eviction should happen and evict 3 segments
-    Assert.assertEquals(maxCachedNum + 1 - 3,
+    Assertions.assertEquals(maxCachedNum + 1 - 3,
         raftLog.getRaftLogCache().getCachedSegmentNum());
   }
 
diff --git a/ratis-test/src/test/java/org/apache/ratis/server/raftlog/segmented/TestLogSegment.java b/ratis-test/src/test/java/org/apache/ratis/server/raftlog/segmented/TestLogSegment.java
index ece17a0..8355c67 100644
--- a/ratis-test/src/test/java/org/apache/ratis/server/raftlog/segmented/TestLogSegment.java
+++ b/ratis-test/src/test/java/org/apache/ratis/server/raftlog/segmented/TestLogSegment.java
@@ -37,10 +37,10 @@
 import org.apache.ratis.util.ReferenceCountedObject;
 import org.apache.ratis.util.SizeInBytes;
 import org.apache.ratis.util.TraditionalBinaryPrefix;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 import java.io.File;
 import java.io.IOException;
@@ -65,7 +65,7 @@
   private long preallocatedSize;
   private int bufferSize;
 
-  @Before
+  @BeforeEach
   public void setup() {
     RaftProperties properties = new RaftProperties();
     storageDir = getTestDir();
@@ -78,7 +78,7 @@
         RaftServerConfigKeys.Log.writeBufferSize(properties).getSizeInt();
   }
 
-  @After
+  @AfterEach
   public void tearDown() throws Exception {
     if (storageDir != null) {
       FileUtils.deleteFully(storageDir.getParentFile());
@@ -110,11 +110,11 @@
       // 0 < truncatedEntrySize < entrySize
       final long fileLength = file.length();
       final long truncatedFileLength = fileLength - (entrySize - truncatedEntrySize);
-      Assert.assertTrue(truncatedFileLength < fileLength);
+      Assertions.assertTrue(truncatedFileLength < fileLength);
       LOG.info("truncate last entry: entry(size={}, truncated={}), file(length={}, truncated={})",
           entrySize, truncatedEntrySize, fileLength, truncatedFileLength);
       FileUtils.truncateFile(file, truncatedFileLength);
-      Assert.assertEquals(truncatedFileLength, file.length());
+      Assertions.assertEquals(truncatedFileLength, file.length());
     }
 
     storage.close();
@@ -128,18 +128,18 @@
 
   static void checkLogSegment(LogSegment segment, long start, long end,
       boolean isOpen, long totalSize, long term) throws Exception {
-    Assert.assertEquals(start, segment.getStartIndex());
-    Assert.assertEquals(end, segment.getEndIndex());
-    Assert.assertEquals(isOpen, segment.isOpen());
-    Assert.assertEquals(totalSize, segment.getTotalFileSize());
+    Assertions.assertEquals(start, segment.getStartIndex());
+    Assertions.assertEquals(end, segment.getEndIndex());
+    Assertions.assertEquals(isOpen, segment.isOpen());
+    Assertions.assertEquals(totalSize, segment.getTotalFileSize());
 
     long offset = SegmentedRaftLogFormat.getHeaderLength();
     for (long i = start; i <= end; i++) {
       LogSegment.LogRecord record = segment.getLogRecord(i);
       final TermIndex ti = record.getTermIndex();
-      Assert.assertEquals(i, ti.getIndex());
-      Assert.assertEquals(term, ti.getTerm());
-      Assert.assertEquals(offset, record.getOffset());
+      Assertions.assertEquals(i, ti.getIndex());
+      Assertions.assertEquals(term, ti.getTerm());
+      Assertions.assertEquals(offset, record.getOffset());
 
       LogEntryProto entry = segment.getEntryFromCache(ti);
       if (entry == null) {
@@ -179,7 +179,7 @@
     checkLogSegment(openSegment, 0, 99 - delta, true, openSegmentFile.length(), 0);
     storage.close();
     // for open segment we currently always keep log entries in the memory
-    Assert.assertEquals(0, openSegment.getLoadingTimes());
+    Assertions.assertEquals(0, openSegment.getLoadingTimes());
 
     // load a closed segment (1000-1099)
     final File closedSegmentFile = prepareLog(false, 1000, 100, 1, false);
@@ -187,7 +187,7 @@
         LogSegmentStartEnd.valueOf(1000, 1099L), MAX_OP_SIZE, loadInitial, null, null);
     checkLogSegment(closedSegment, 1000, 1099, false,
         closedSegment.getTotalFileSize(), 1);
-    Assert.assertEquals(loadInitial ? 0 : 1, closedSegment.getLoadingTimes());
+    Assertions.assertEquals(loadInitial ? 0 : 1, closedSegment.getLoadingTimes());
   }
 
   @Test
@@ -208,7 +208,7 @@
       segment.appendToOpenSegment(Op.WRITE_CACHE_WITHOUT_STATE_MACHINE_CACHE, ReferenceCountedObject.wrap(entry));
     }
 
-    Assert.assertTrue(segment.getTotalFileSize() >= max);
+    Assertions.assertTrue(segment.getTotalFileSize() >= max);
     checkLogSegment(segment, start, i - 1 + start, true, size, term);
   }
 
@@ -224,9 +224,9 @@
     storage.close();
 
     final DefaultTimekeeperImpl readEntryTimer = (DefaultTimekeeperImpl) raftLogMetrics.getReadEntryTimer();
-    Assert.assertNotNull(readEntryTimer);
-    Assert.assertEquals(100, readEntryTimer.getTimer().getCount());
-    Assert.assertTrue(readEntryTimer.getTimer().getMeanRate() > 0);
+    Assertions.assertNotNull(readEntryTimer);
+    Assertions.assertEquals(100, readEntryTimer.getTimer().getCount());
+    Assertions.assertTrue(readEntryTimer.getTimer().getMeanRate() > 0);
   }
 
 
@@ -238,7 +238,7 @@
     try {
       LogEntryProto entry = LogProtoUtils.toLogEntryProto(m, 0, 1001);
       segment.appendToOpenSegment(Op.WRITE_CACHE_WITHOUT_STATE_MACHINE_CACHE, ReferenceCountedObject.wrap(entry));
-      Assert.fail("should fail since the entry's index needs to be 1000");
+      Assertions.fail("should fail since the entry's index needs to be 1000");
     } catch (IllegalStateException e) {
       // the exception is expected.
     }
@@ -249,7 +249,7 @@
     try {
       entry = LogProtoUtils.toLogEntryProto(m, 0, 1002);
       segment.appendToOpenSegment(Op.WRITE_CACHE_WITHOUT_STATE_MACHINE_CACHE, ReferenceCountedObject.wrap(entry));
-      Assert.fail("should fail since the entry's index needs to be 1001");
+      Assertions.fail("should fail since the entry's index needs to be 1001");
     } catch (IllegalStateException e) {
       // the exception is expected.
     }
@@ -269,18 +269,18 @@
     // truncate an open segment (remove 1080~1099)
     long newSize = segment.getLogRecord(start + 80).getOffset();
     segment.truncate(start + 80);
-    Assert.assertEquals(80, segment.numOfEntries());
+    Assertions.assertEquals(80, segment.numOfEntries());
     checkLogSegment(segment, start, start + 79, false, newSize, term);
 
     // truncate a closed segment (remove 1050~1079)
     newSize = segment.getLogRecord(start + 50).getOffset();
     segment.truncate(start + 50);
-    Assert.assertEquals(50, segment.numOfEntries());
+    Assertions.assertEquals(50, segment.numOfEntries());
     checkLogSegment(segment, start, start + 49, false, newSize, term);
 
     // truncate all the remaining entries
     segment.truncate(start);
-    Assert.assertEquals(0, segment.numOfEntries());
+    Assertions.assertEquals(0, segment.numOfEntries());
     checkLogSegment(segment, start, start - 1, false,
         SegmentedRaftLogFormat.getHeaderLength(), term);
   }
@@ -300,12 +300,12 @@
       for (int a : preallocated) {
         try(SegmentedRaftLogOutputStream ignored =
                 new SegmentedRaftLogOutputStream(file, false, max, a, ByteBuffer.allocateDirect(bufferSize))) {
-          Assert.assertEquals("max=" + max + ", a=" + a, file.length(), Math.min(max, a));
+          Assertions.assertEquals(file.length(), Math.min(max, a), "max=" + max + ", a=" + a);
         }
         try(SegmentedRaftLogInputStream in = SegmentedRaftLogTestUtils.newSegmentedRaftLogInputStream(
             file, 0, INVALID_LOG_INDEX, true)) {
           LogEntryProto entry = in.nextEntry();
-          Assert.assertNull(entry);
+          Assertions.assertNull(entry);
         }
       }
     }
@@ -321,14 +321,14 @@
       size = LogSegment.getEntrySize(entry, Op.WRITE_CACHE_WITHOUT_STATE_MACHINE_CACHE);
       out.write(entry);
     }
-    Assert.assertEquals(file.length(),
+    Assertions.assertEquals(file.length(),
         size + SegmentedRaftLogFormat.getHeaderLength());
     try (SegmentedRaftLogInputStream in = SegmentedRaftLogTestUtils.newSegmentedRaftLogInputStream(
         file, 0, INVALID_LOG_INDEX, true)) {
       LogEntryProto entry = in.nextEntry();
-      Assert.assertArrayEquals(content,
+      Assertions.assertArrayEquals(content,
           entry.getStateMachineLogEntry().getLogData().toByteArray());
-      Assert.assertNull(in.nextEntry());
+      Assertions.assertNull(in.nextEntry());
     }
   }
 
@@ -351,19 +351,19 @@
     long preallocated = 16 * 1024;
     try (SegmentedRaftLogOutputStream out = new SegmentedRaftLogOutputStream(file, false,
         max.getSize(), 16 * 1024, ByteBuffer.allocateDirect(10 * 1024))) {
-      Assert.assertEquals(preallocated, file.length());
+      Assertions.assertEquals(preallocated, file.length());
       while (totalSize + entrySize < max.getSize()) {
         totalSize += entrySize;
         out.write(entry);
         if (totalSize > preallocated) {
-          Assert.assertEquals("totalSize==" + totalSize,
-              preallocated + 16 * 1024, file.length());
+          Assertions.assertEquals(preallocated + 16 * 1024, file.length(),
+              "totalSize==" + totalSize);
           preallocated += 16 * 1024;
         }
       }
     }
 
-    Assert.assertEquals(totalSize, file.length());
+    Assertions.assertEquals(totalSize, file.length());
   }
 
   @Test
@@ -374,14 +374,14 @@
 
     // create zero size in-progress file
     LOG.info("file: " + file);
-    Assert.assertTrue(file.createNewFile());
+    Assertions.assertTrue(file.createNewFile());
     final Path path = file.toPath();
-    Assert.assertTrue(Files.exists(path));
-    Assert.assertEquals(0, Files.size(path));
+    Assertions.assertTrue(Files.exists(path));
+    Assertions.assertEquals(0, Files.size(path));
 
     // getLogSegmentPaths should remove it.
     final List<LogSegmentPath> logs = LogSegmentPath.getLogSegmentPaths(storage);
-    Assert.assertEquals(0, logs.size());
-    Assert.assertFalse(Files.exists(path));
+    Assertions.assertEquals(0, logs.size());
+    Assertions.assertFalse(Files.exists(path));
   }
 }
diff --git a/ratis-test/src/test/java/org/apache/ratis/server/raftlog/segmented/TestRaftLogReadWrite.java b/ratis-test/src/test/java/org/apache/ratis/server/raftlog/segmented/TestRaftLogReadWrite.java
index a020b43..4f151c7 100644
--- a/ratis-test/src/test/java/org/apache/ratis/server/raftlog/segmented/TestRaftLogReadWrite.java
+++ b/ratis-test/src/test/java/org/apache/ratis/server/raftlog/segmented/TestRaftLogReadWrite.java
@@ -29,10 +29,10 @@
 import org.apache.ratis.thirdparty.com.google.protobuf.CodedOutputStream;
 import org.apache.ratis.proto.RaftProtos.LogEntryProto;
 import org.apache.ratis.util.FileUtils;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 import java.io.File;
 import java.io.IOException;
@@ -53,7 +53,7 @@
   private long preallocatedSize;
   private int bufferSize;
 
-  @Before
+  @BeforeEach
   public void setup() {
     storageDir = getTestDir();
     RaftProperties properties = new RaftProperties();
@@ -66,7 +66,7 @@
         RaftServerConfigKeys.Log.writeBufferSize(properties).getSizeInt();
   }
 
-  @After
+  @AfterEach
   public void tearDown() throws Exception {
     if (storageDir != null) {
       FileUtils.deleteFully(storageDir.getParentFile());
@@ -116,10 +116,10 @@
       storage.close();
     }
 
-    Assert.assertEquals(size, openSegment.length());
+    Assertions.assertEquals(size, openSegment.length());
 
     final LogEntryProto[] readEntries = readLog(openSegment, 0, RaftLog.INVALID_LOG_INDEX, true);
-    Assert.assertArrayEquals(entries, readEntries);
+    Assertions.assertArrayEquals(entries, readEntries);
   }
 
   @Test
@@ -146,7 +146,7 @@
     }
 
     final LogEntryProto[] readEntries = readLog(openSegment, 0, RaftLog.INVALID_LOG_INDEX, true);
-    Assert.assertArrayEquals(entries, readEntries);
+    Assertions.assertArrayEquals(entries, readEntries);
 
     storage.close();
   }
@@ -168,16 +168,16 @@
     out.flush();
 
     // make sure the file contains padding
-    Assert.assertEquals(
+    Assertions.assertEquals(
         RaftServerConfigKeys.Log.PREALLOCATED_SIZE_DEFAULT.getSize(),
         openSegment.length());
 
     // check if the reader can correctly read the log file
     final LogEntryProto[] readEntries = readLog(openSegment, 0, RaftLog.INVALID_LOG_INDEX, true);
-    Assert.assertArrayEquals(entries, readEntries);
+    Assertions.assertArrayEquals(entries, readEntries);
 
     out.close();
-    Assert.assertEquals(size, openSegment.length());
+    Assertions.assertEquals(size, openSegment.length());
   }
 
   /**
@@ -200,12 +200,12 @@
     out.flush();
 
     // make sure the file contains padding
-    Assert.assertEquals(4 * 1024 * 1024, openSegment.length());
+    Assertions.assertEquals(4 * 1024 * 1024, openSegment.length());
 
     try (FileChannel fout = FileUtils.newFileChannel(openSegment, StandardOpenOption.WRITE)) {
       final byte[] array = {-1, 1};
       final int written = fout.write(ByteBuffer.wrap(array), 16 * 1024 * 1024 - 10);
-      Assert.assertEquals(array.length, written);
+      Assertions.assertEquals(array.length, written);
     }
 
     List<LogEntryProto> list = new ArrayList<>();
@@ -215,7 +215,7 @@
       while ((entry = in.nextEntry()) != null) {
         list.add(entry);
       }
-      Assert.fail("should fail since we corrupt the padding");
+      Assertions.fail("should fail since we corrupt the padding");
     } catch (IOException e) {
       boolean findVerifyTerminator = false;
       for (StackTraceElement s : e.getStackTrace()) {
@@ -224,9 +224,9 @@
           break;
         }
       }
-      Assert.assertTrue(findVerifyTerminator);
+      Assertions.assertTrue(findVerifyTerminator);
     }
-    Assert.assertArrayEquals(entries,
+    Assertions.assertArrayEquals(entries,
         list.toArray(new LogEntryProto[list.size()]));
   }
 
@@ -259,7 +259,7 @@
 
     try {
       readLog(openSegment, 0, RaftLog.INVALID_LOG_INDEX, true);
-      Assert.fail("The read of corrupted log file should fail");
+      Assertions.fail("The read of corrupted log file should fail");
     } catch (ChecksumException e) {
       LOG.info("Caught ChecksumException as expected", e);
     }
diff --git a/ratis-test/src/test/java/org/apache/ratis/server/raftlog/segmented/TestSegmentedRaftLog.java b/ratis-test/src/test/java/org/apache/ratis/server/raftlog/segmented/TestSegmentedRaftLog.java
index 38341e0..55fd6fb 100644
--- a/ratis-test/src/test/java/org/apache/ratis/server/raftlog/segmented/TestSegmentedRaftLog.java
+++ b/ratis-test/src/test/java/org/apache/ratis/server/raftlog/segmented/TestSegmentedRaftLog.java
@@ -17,8 +17,6 @@
  */
 package org.apache.ratis.server.raftlog.segmented;
 
-import static org.junit.Assert.assertTrue;
-
 import org.apache.ratis.BaseTest;
 import org.apache.ratis.RaftTestUtil.SimpleOperation;
 import org.apache.ratis.conf.RaftProperties;
@@ -50,18 +48,12 @@
 import org.apache.ratis.util.JavaUtils;
 import org.apache.ratis.util.SizeInBytes;
 import org.apache.ratis.util.TimeDuration;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
 
 import java.io.File;
 import java.io.IOException;
 import java.nio.ByteBuffer;
-import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 import java.util.concurrent.CompletableFuture;
@@ -69,12 +61,22 @@
 import java.util.concurrent.TimeUnit;
 import java.util.function.LongSupplier;
 import java.util.function.Supplier;
+import java.util.stream.Stream;
 
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
 import org.slf4j.event.Level;
 
-@RunWith(Parameterized.class)
+import static java.lang.Boolean.FALSE;
+import static java.lang.Boolean.TRUE;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.params.provider.Arguments.arguments;
+
 public class TestSegmentedRaftLog extends BaseTest {
   static {
     Slf4jUtils.setLogLevel(SegmentedRaftLogWorker.LOG, Level.INFO);
@@ -82,18 +84,12 @@
     Slf4jUtils.setLogLevel(SegmentedRaftLog.LOG, Level.INFO);
   }
 
-  private final Boolean smSyncFlush;
-  private final Boolean useAsyncFlush;
-
-  public TestSegmentedRaftLog(Boolean raftLogAsync, Boolean smSync) {
-    this.useAsyncFlush = raftLogAsync;
-    this.smSyncFlush = smSync;
-  }
-
-  @Parameterized.Parameters
-  public static Collection<Boolean[]> data() {
-    return Arrays.asList((new Boolean[][] {{Boolean.FALSE, Boolean.FALSE}, {Boolean.FALSE, Boolean.TRUE},
-        {Boolean.TRUE, Boolean.FALSE}, {Boolean.TRUE, Boolean.TRUE}}));
+  public static Stream<Arguments> data() {
+    return Stream.of(
+        arguments(FALSE, FALSE),
+        arguments(FALSE, TRUE),
+        arguments(TRUE, FALSE),
+        arguments(TRUE, TRUE));
   }
 
   public static long getOpenSegmentSize(RaftLog raftLog) {
@@ -155,13 +151,11 @@
         .build();
   }
 
-  @Before
+  @BeforeEach
   public void setup() throws Exception {
     storageDir = getTestDir();
     properties = new RaftProperties();
     RaftServerConfigKeys.setStorageDir(properties,  Collections.singletonList(storageDir));
-    RaftServerConfigKeys.Log.setAsyncFlushEnabled(properties, useAsyncFlush);
-    RaftServerConfigKeys.Log.StateMachineData.setSync(properties, smSyncFlush);
     storage = RaftStorageTestUtils.newRaftStorage(storageDir);
     this.segmentMaxSize =
         RaftServerConfigKeys.Log.segmentSizeMax(properties).getSize();
@@ -171,7 +165,7 @@
         RaftServerConfigKeys.Log.writeBufferSize(properties).getSizeInt();
   }
 
-  @After
+  @AfterEach
   public void tearDown() throws Exception {
     if (storageDir != null) {
       FileUtils.deleteFully(storageDir.getParentFile());
@@ -213,8 +207,11 @@
     return raftLog.get(raftLog.getLastEntryTermIndex().getIndex());
   }
 
-  @Test
-  public void testLoadLogSegments() throws Exception {
+  @ParameterizedTest
+  @MethodSource("data")
+  public void testLoadLogSegments(Boolean useAsyncFlush, Boolean smSyncFlush) throws Exception {
+    RaftServerConfigKeys.Log.setAsyncFlushEnabled(properties, useAsyncFlush);
+    RaftServerConfigKeys.Log.StateMachineData.setSync(properties, smSyncFlush);
     // first generate log files
     List<SegmentRange> ranges = prepareRanges(0, 5, 100, 0);
     LogEntryProto[] entries = prepareLog(ranges);
@@ -225,7 +222,7 @@
       // check if log entries are loaded correctly
       for (LogEntryProto e : entries) {
         LogEntryProto entry = raftLog.get(e.getIndex());
-        Assert.assertEquals(e, entry);
+        Assertions.assertEquals(e, entry);
       }
 
       final LogEntryHeader[] termIndices = raftLog.getEntries(0, 500);
@@ -238,8 +235,8 @@
             }
           })
           .toArray(LogEntryProto[]::new);
-      Assert.assertArrayEquals(entries, entriesFromLog);
-      Assert.assertEquals(entries[entries.length - 1], getLastEntry(raftLog));
+      Assertions.assertArrayEquals(entries, entriesFromLog);
+      Assertions.assertEquals(entries[entries.length - 1], getLastEntry(raftLog));
 
       final RatisMetricRegistry metricRegistryForLogWorker = RaftLogMetricsBase.createRegistry(memberId);
 
@@ -278,8 +275,11 @@
   /**
    * Append entry one by one and check if log state is correct.
    */
-  @Test
-  public void testAppendEntry() throws Exception {
+  @ParameterizedTest
+  @MethodSource("data")
+  public void testAppendEntry(Boolean useAsyncFlush, Boolean smSyncFlush) throws Exception {
+    RaftServerConfigKeys.Log.setAsyncFlushEnabled(properties, useAsyncFlush);
+    RaftServerConfigKeys.Log.StateMachineData.setSync(properties, smSyncFlush);
     List<SegmentRange> ranges = prepareRanges(0, 5, 200, 0);
     List<LogEntryProto> entries = prepareLogEntries(ranges, null);
 
@@ -333,8 +333,11 @@
     }
   }
 
-  @Test
-  public void testAppendEntryAfterPurge() throws Exception {
+  @ParameterizedTest
+  @MethodSource("data")
+  public void testAppendEntryAfterPurge(Boolean useAsyncFlush, Boolean smSyncFlush) throws Exception {
+    RaftServerConfigKeys.Log.setAsyncFlushEnabled(properties, useAsyncFlush);
+    RaftServerConfigKeys.Log.StateMachineData.setSync(properties, smSyncFlush);
     List<SegmentRange> ranges = prepareRanges(0, 5, 200, 0);
     List<LogEntryProto> entries = prepareLogEntries(ranges, null);
 
@@ -364,8 +367,11 @@
   /**
    * Keep appending entries, make sure the rolling is correct.
    */
-  @Test
-  public void testAppendAndRoll() throws Exception {
+  @ParameterizedTest
+  @MethodSource("data")
+  public void testAppendAndRoll(Boolean useAsyncFlush, Boolean smSyncFlush) throws Exception {
+    RaftServerConfigKeys.Log.setAsyncFlushEnabled(properties, useAsyncFlush);
+    RaftServerConfigKeys.Log.StateMachineData.setSync(properties, smSyncFlush);
     RaftServerConfigKeys.Log.setPreallocatedSize(properties, SizeInBytes.valueOf("16KB"));
     RaftServerConfigKeys.Log.setSegmentSizeMax(properties, SizeInBytes.valueOf("128KB"));
 
@@ -384,12 +390,15 @@
       raftLog.open(RaftLog.INVALID_LOG_INDEX, null);
       // check if the raft log is correct
       checkEntries(raftLog, entries, 0, entries.size());
-      Assert.assertEquals(9, raftLog.getRaftLogCache().getNumOfSegments());
+      Assertions.assertEquals(9, raftLog.getRaftLogCache().getNumOfSegments());
     }
   }
 
-  @Test
-  public void testTruncate() throws Exception {
+  @ParameterizedTest
+  @MethodSource("data")
+  public void testTruncate(Boolean useAsyncFlush, Boolean smSyncFlush) throws Exception {
+    RaftServerConfigKeys.Log.setAsyncFlushEnabled(properties, useAsyncFlush);
+    RaftServerConfigKeys.Log.StateMachineData.setSync(properties, smSyncFlush);
     // prepare the log for truncation
     List<SegmentRange> ranges = prepareRanges(0, 5, 200, 0);
     List<LogEntryProto> entries = prepareLogEntries(ranges, null);
@@ -420,10 +429,10 @@
       raftLog.open(RaftLog.INVALID_LOG_INDEX, null);
       // check if the raft log is correct
       if (fromIndex > 0) {
-        Assert.assertEquals(entries.get((int) (fromIndex - 1)),
+        Assertions.assertEquals(entries.get((int) (fromIndex - 1)),
             getLastEntry(raftLog));
       } else {
-        Assert.assertNull(raftLog.getLastEntryTermIndex());
+        Assertions.assertNull(raftLog.getLastEntryTermIndex());
       }
       checkEntries(raftLog, entries, 0, (int) fromIndex);
     }
@@ -434,7 +443,7 @@
     if (size > 0) {
       for (int i = offset; i < size + offset; i++) {
         LogEntryProto entry = raftLog.get(expected.get(i).getIndex());
-        Assert.assertEquals(expected.get(i), entry);
+        Assertions.assertEquals(expected.get(i), entry);
       }
       final LogEntryHeader[] termIndices = raftLog.getEntries(
           expected.get(offset).getIndex(),
@@ -450,7 +459,7 @@
           .toArray(LogEntryProto[]::new);
       LogEntryProto[] expectedArray = expected.subList(offset, offset + size)
           .stream().toArray(LogEntryProto[]::new);
-      Assert.assertArrayEquals(expectedArray, entriesFromLog);
+      Assertions.assertArrayEquals(expectedArray, entriesFromLog);
     }
   }
 
@@ -519,15 +528,18 @@
       final CompletableFuture<Long> f = raftLog.purge(purgeIndex);
       final Long purged = f.get();
       LOG.info("purgeIndex = {}, purged = {}", purgeIndex, purged);
-      Assert.assertEquals(expectedIndex, raftLog.getRaftLogCache().getStartIndex());
+      Assertions.assertEquals(expectedIndex, raftLog.getRaftLogCache().getStartIndex());
     }
   }
 
   /**
    * Test append with inconsistent entries
    */
-  @Test
-  public void testAppendEntriesWithInconsistency() throws Exception {
+  @ParameterizedTest
+  @MethodSource("data")
+  public void testAppendEntriesWithInconsistency(Boolean useAsyncFlush, Boolean smSyncFlush) throws Exception {
+    RaftServerConfigKeys.Log.setAsyncFlushEnabled(properties, useAsyncFlush);
+    RaftServerConfigKeys.Log.StateMachineData.setSync(properties, smSyncFlush);
     // prepare the log for truncation
     List<SegmentRange> ranges = prepareRanges(0, 5, 200, 0);
     List<LogEntryProto> entries = prepareLogEntries(ranges, null);
@@ -558,9 +570,9 @@
       checkFailedEntries(entries, 650, retryCache);
       checkEntries(raftLog, entries, 0, 650);
       checkEntries(raftLog, newEntries, 100, 100);
-      Assert.assertEquals(newEntries.get(newEntries.size() - 1),
+      Assertions.assertEquals(newEntries.get(newEntries.size() - 1),
           getLastEntry(raftLog));
-      Assert.assertEquals(newEntries.get(newEntries.size() - 1).getIndex(),
+      Assertions.assertEquals(newEntries.get(newEntries.size() - 1).getIndex(),
           raftLog.getFlushIndex());
     }
 
@@ -569,18 +581,21 @@
       raftLog.open(RaftLog.INVALID_LOG_INDEX, null);
       checkEntries(raftLog, entries, 0, 650);
       checkEntries(raftLog, newEntries, 100, 100);
-      Assert.assertEquals(newEntries.get(newEntries.size() - 1),
+      Assertions.assertEquals(newEntries.get(newEntries.size() - 1),
           getLastEntry(raftLog));
-      Assert.assertEquals(newEntries.get(newEntries.size() - 1).getIndex(),
+      Assertions.assertEquals(newEntries.get(newEntries.size() - 1).getIndex(),
           raftLog.getFlushIndex());
 
       SegmentedRaftLogCache cache = raftLog.getRaftLogCache();
-      Assert.assertEquals(5, cache.getNumOfSegments());
+      Assertions.assertEquals(5, cache.getNumOfSegments());
     }
   }
 
-  @Test
-  public void testSegmentedRaftLogStateMachineData() throws Exception {
+  @ParameterizedTest
+  @MethodSource("data")
+  public void testSegmentedRaftLogStateMachineData(Boolean useAsyncFlush, Boolean smSyncFlush) throws Exception {
+    RaftServerConfigKeys.Log.setAsyncFlushEnabled(properties, useAsyncFlush);
+    RaftServerConfigKeys.Log.StateMachineData.setSync(properties, smSyncFlush);
     final SegmentRange range = new SegmentRange(0, 10, 1, true);
     final List<LogEntryProto> entries = prepareLogEntries(range, null, true, new ArrayList<>());
 
@@ -624,8 +639,11 @@
     }
   }
 
-  @Test(expected = TimeoutIOException.class)
-  public void testServerShutdownOnTimeoutIOException() throws Throwable {
+  @ParameterizedTest
+  @MethodSource("data")
+  public void testServerShutdownOnTimeoutIOException(Boolean useAsyncFlush, Boolean smSyncFlush) throws Throwable {
+    RaftServerConfigKeys.Log.setAsyncFlushEnabled(properties, useAsyncFlush);
+    RaftServerConfigKeys.Log.StateMachineData.setSync(properties, smSyncFlush);
     RaftServerConfigKeys.Log.StateMachineData.setSync(properties, true);
     final TimeDuration syncTimeout = TimeDuration.valueOf(100, TimeUnit.MILLISECONDS);
     RaftServerConfigKeys.Log.StateMachineData.setSyncTimeout(properties, syncTimeout);
@@ -647,14 +665,14 @@
         LOG.info("Test StateMachine: Ratis log failed notification received as expected.", cause);
 
         LOG.info("Test StateMachine: Transition to PAUSED state.");
-        Assert.assertNotNull(entry);
+        Assertions.assertNotNull(entry);
 
         getLifeCycle().transition(LifeCycle.State.PAUSING);
         getLifeCycle().transition(LifeCycle.State.PAUSED);
       }
     };
 
-    Throwable ex = null; // TimeoutIOException
+    ExecutionException ex;
     try (SegmentedRaftLog raftLog = SegmentedRaftLog.newBuilder()
         .setMemberId(memberId)
         .setStateMachine(sm)
@@ -665,15 +683,10 @@
       // SegmentedRaftLogWorker should catch TimeoutIOException
       CompletableFuture<Long> f = raftLog.appendEntry(entry);
       // Wait for async writeStateMachineData to finish
-      try {
-        f.get();
-      } catch (ExecutionException e) {
-        ex = e.getCause();
-      }
+      ex = Assertions.assertThrows(ExecutionException.class, f::get);
     }
-    Assert.assertNotNull(ex);
-    Assert.assertSame(LifeCycle.State.PAUSED, sm.getLifeCycleState());
-    throw ex;
+    Assertions.assertSame(LifeCycle.State.PAUSED, sm.getLifeCycleState());
+    Assertions.assertInstanceOf(TimeoutIOException.class, ex.getCause());
   }
 
   static Thread startAppendEntryThread(RaftLog raftLog, LogEntryProto entry) {
@@ -690,9 +703,9 @@
 
   void assertIndices(RaftLog raftLog, long expectedFlushIndex, long expectedNextIndex) {
     LOG.info("assert expectedFlushIndex={}", expectedFlushIndex);
-    Assert.assertEquals(expectedFlushIndex, raftLog.getFlushIndex());
+    Assertions.assertEquals(expectedFlushIndex, raftLog.getFlushIndex());
     LOG.info("assert expectedNextIndex={}", expectedNextIndex);
-    Assert.assertEquals(expectedNextIndex, raftLog.getNextIndex());
+    Assertions.assertEquals(expectedNextIndex, raftLog.getNextIndex());
   }
 
   void assertIndicesMultipleAttempts(RaftLog raftLog, long expectedFlushIndex, long expectedNextIndex) throws Exception {
@@ -700,8 +713,11 @@
         10, HUNDRED_MILLIS, "assertIndices", LOG);
   }
 
-  @Test
-  public void testAsyncFlushPerf1() throws Exception {
+  @ParameterizedTest
+  @MethodSource("data")
+  public void testAsyncFlushPerf1(Boolean useAsyncFlush, Boolean smSyncFlush) throws Exception {
+    RaftServerConfigKeys.Log.setAsyncFlushEnabled(properties, useAsyncFlush);
+    RaftServerConfigKeys.Log.StateMachineData.setSync(properties, smSyncFlush);
     List<SegmentRange> ranges = prepareRanges(0, 50, 20000, 0);
     List<LogEntryProto> entries = prepareLogEntries(ranges, null);
 
@@ -724,8 +740,11 @@
     }
   }
 
-  @Test
-  public void testAsyncFlushPerf2() throws Exception {
+  @ParameterizedTest
+  @MethodSource("data")
+  public void testAsyncFlushPerf2(Boolean useAsyncFlush, Boolean smSyncFlush) throws Exception {
+    RaftServerConfigKeys.Log.setAsyncFlushEnabled(properties, useAsyncFlush);
+    RaftServerConfigKeys.Log.StateMachineData.setSync(properties, smSyncFlush);
     List<SegmentRange> ranges = prepareRanges(0, 50, 20000, 0);
     List<LogEntryProto> entries = prepareLogEntries(ranges, null);
 
diff --git a/ratis-test/src/test/java/org/apache/ratis/server/raftlog/segmented/TestSegmentedRaftLogCache.java b/ratis-test/src/test/java/org/apache/ratis/server/raftlog/segmented/TestSegmentedRaftLogCache.java
index 5be3c36..fa892b2 100644
--- a/ratis-test/src/test/java/org/apache/ratis/server/raftlog/segmented/TestSegmentedRaftLogCache.java
+++ b/ratis-test/src/test/java/org/apache/ratis/server/raftlog/segmented/TestSegmentedRaftLogCache.java
@@ -37,10 +37,10 @@
 import org.apache.ratis.server.raftlog.segmented.LogSegment.Op;
 import org.apache.ratis.proto.RaftProtos.LogEntryProto;
 import org.apache.ratis.util.ReferenceCountedObject;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
 public class TestSegmentedRaftLogCache {
   private static final RaftProperties prop = new RaftProperties();
@@ -49,14 +49,14 @@
   private SegmentedRaftLogMetrics raftLogMetrics;
   private RatisMetricRegistryImpl ratisMetricRegistry;
 
-  @Before
+  @BeforeEach
   public void setup() {
     raftLogMetrics = new SegmentedRaftLogMetrics(RaftServerTestUtil.TEST_MEMBER_ID);
     ratisMetricRegistry = (RatisMetricRegistryImpl) raftLogMetrics.getRegistry();
     cache = new SegmentedRaftLogCache(null, null, prop, raftLogMetrics);
   }
 
-  @After
+  @AfterEach
   public void clear() {
     raftLogMetrics.unregister();
   }
@@ -75,14 +75,14 @@
   }
 
   private void checkCache(long start, long end, int segmentSize) {
-    Assert.assertEquals(start, cache.getStartIndex());
-    Assert.assertEquals(end, cache.getEndIndex());
+    Assertions.assertEquals(start, cache.getStartIndex());
+    Assertions.assertEquals(end, cache.getEndIndex());
 
     for (long index = start; index <= end; index++) {
       final LogSegment segment = cache.getSegment(index);
       final LogRecord record = segment.getLogRecord(index);
       final LogEntryProto entry = segment.getEntryFromCache(record.getTermIndex());
-      Assert.assertEquals(index, entry.getIndex());
+      Assertions.assertEquals(index, entry.getIndex());
     }
 
     long[] offsets = new long[]{start, start + 1, start + (end - start) / 2,
@@ -99,9 +99,9 @@
   private void checkCacheEntries(long offset, int size, long end) {
     final LogEntryHeader[] entries = cache.getTermIndices(offset, offset + size);
     long realEnd = offset + size > end + 1 ? end + 1 : offset + size;
-    Assert.assertEquals(realEnd - offset, entries.length);
+    Assertions.assertEquals(realEnd - offset, entries.length);
     for (long i = offset; i < realEnd; i++) {
-      Assert.assertEquals(i, entries[(int) (i - offset)].getIndex());
+      Assertions.assertEquals(i, entries[(int) (i - offset)].getIndex());
     }
   }
 
@@ -114,7 +114,7 @@
     try {
       LogSegment s = prepareLogSegment(102, 103, true);
       cache.addSegment(s);
-      Assert.fail("should fail since there is gap between two segments");
+      Assertions.fail("should fail since there is gap between two segments");
     } catch (IllegalStateException ignored) {
     }
 
@@ -125,7 +125,7 @@
     try {
       LogSegment s = prepareLogSegment(201, 202, true);
       cache.addSegment(s);
-      Assert.fail("should fail since there is still an open segment in cache");
+      Assertions.fail("should fail since there is still an open segment in cache");
     } catch (IllegalStateException ignored) {
     }
 
@@ -135,17 +135,17 @@
     try {
       LogSegment s = prepareLogSegment(202, 203, true);
       cache.addSegment(s);
-      Assert.fail("should fail since there is gap between two segments");
+      Assertions.fail("should fail since there is gap between two segments");
     } catch (IllegalStateException ignored) {
     }
 
     LogSegment s3 = prepareLogSegment(201, 300, true);
     cache.addSegment(s3);
-    Assert.assertNotNull(cache.getOpenSegment());
+    Assertions.assertNotNull(cache.getOpenSegment());
     checkCache(1, 300, 100);
 
     cache.rollOpenSegment(true);
-    Assert.assertNotNull(cache.getOpenSegment());
+    Assertions.assertNotNull(cache.getOpenSegment());
     checkCache(1, 300, 100);
   }
 
@@ -159,7 +159,7 @@
       LogEntryProto entry = LogProtoUtils.toLogEntryProto(m.getLogEntryContent(), 0, 0);
       cache.appendEntry(Op.WRITE_CACHE_WITHOUT_STATE_MACHINE_CACHE, ReferenceCountedObject.wrap(entry)
       );
-      Assert.fail("the open segment is null");
+      Assertions.fail("the open segment is null");
     } catch (IllegalStateException ignored) {
     }
 
@@ -171,7 +171,7 @@
       );
     }
 
-    Assert.assertNotNull(cache.getOpenSegment());
+    Assertions.assertNotNull(cache.getOpenSegment());
     checkCache(0, 199, 100);
   }
 
@@ -188,7 +188,7 @@
     cache.addSegment(s);
 
     long end = cache.getEndIndex();
-    Assert.assertEquals(599, end);
+    Assertions.assertEquals(599, end);
     int numOfSegments = 6;
     // start truncation
     for (int i = 0; i < 10; i++) { // truncate 10 times
@@ -200,46 +200,46 @@
       // check TruncationSegments
       int currentNum= (int) (end / 100 + 1);
       if (currentNum < numOfSegments) {
-        Assert.assertEquals(1, ts.getToDelete().length);
+        Assertions.assertEquals(1, ts.getToDelete().length);
         numOfSegments = currentNum;
       } else {
-        Assert.assertEquals(0, ts.getToDelete().length);
+        Assertions.assertEquals(0, ts.getToDelete().length);
       }
     }
 
     // 230 entries remaining. truncate at the segment boundary
     TruncationSegments ts = cache.truncate(200);
     checkCache(0, 199, 100);
-    Assert.assertEquals(1, ts.getToDelete().length);
-    Assert.assertEquals(200, ts.getToDelete()[0].getStartIndex());
-    Assert.assertEquals(229, ts.getToDelete()[0].getEndIndex());
-    Assert.assertEquals(0, ts.getToDelete()[0].getTargetLength());
-    Assert.assertFalse(ts.getToDelete()[0].isOpen());
-    Assert.assertNull(ts.getToTruncate());
+    Assertions.assertEquals(1, ts.getToDelete().length);
+    Assertions.assertEquals(200, ts.getToDelete()[0].getStartIndex());
+    Assertions.assertEquals(229, ts.getToDelete()[0].getEndIndex());
+    Assertions.assertEquals(0, ts.getToDelete()[0].getTargetLength());
+    Assertions.assertFalse(ts.getToDelete()[0].isOpen());
+    Assertions.assertNull(ts.getToTruncate());
 
     // add another open segment and truncate it as a whole
     LogSegment newOpen = prepareLogSegment(200, 249, true);
     cache.addSegment(newOpen);
     ts = cache.truncate(200);
     checkCache(0, 199, 100);
-    Assert.assertEquals(1, ts.getToDelete().length);
-    Assert.assertEquals(200, ts.getToDelete()[0].getStartIndex());
-    Assert.assertEquals(249, ts.getToDelete()[0].getEndIndex());
-    Assert.assertEquals(0, ts.getToDelete()[0].getTargetLength());
-    Assert.assertTrue(ts.getToDelete()[0].isOpen());
-    Assert.assertNull(ts.getToTruncate());
+    Assertions.assertEquals(1, ts.getToDelete().length);
+    Assertions.assertEquals(200, ts.getToDelete()[0].getStartIndex());
+    Assertions.assertEquals(249, ts.getToDelete()[0].getEndIndex());
+    Assertions.assertEquals(0, ts.getToDelete()[0].getTargetLength());
+    Assertions.assertTrue(ts.getToDelete()[0].isOpen());
+    Assertions.assertNull(ts.getToTruncate());
 
     // add another open segment and truncate part of it
     newOpen = prepareLogSegment(200, 249, true);
     cache.addSegment(newOpen);
     ts = cache.truncate(220);
     checkCache(0, 219, 100);
-    Assert.assertNull(cache.getOpenSegment());
-    Assert.assertEquals(0, ts.getToDelete().length);
-    Assert.assertTrue(ts.getToTruncate().isOpen());
-    Assert.assertEquals(219, ts.getToTruncate().getNewEndIndex());
-    Assert.assertEquals(200, ts.getToTruncate().getStartIndex());
-    Assert.assertEquals(249, ts.getToTruncate().getEndIndex());
+    Assertions.assertNull(cache.getOpenSegment());
+    Assertions.assertEquals(0, ts.getToDelete().length);
+    Assertions.assertTrue(ts.getToTruncate().isOpen());
+    Assertions.assertEquals(219, ts.getToTruncate().getNewEndIndex());
+    Assertions.assertEquals(200, ts.getToTruncate().getStartIndex());
+    Assertions.assertEquals(249, ts.getToTruncate().getEndIndex());
   }
 
   @Test
@@ -255,9 +255,9 @@
     int purgeIndex = sIndex;
     // open segment should never be purged
     TruncationSegments ts = cache.purge(purgeIndex);
-    Assert.assertNull(ts.getToTruncate());
-    Assert.assertEquals(end - start, ts.getToDelete().length);
-    Assert.assertEquals(sIndex, cache.getStartIndex());
+    Assertions.assertNull(ts.getToTruncate());
+    Assertions.assertEquals(end - start, ts.getToDelete().length);
+    Assertions.assertEquals(sIndex, cache.getStartIndex());
   }
 
   @Test
@@ -272,9 +272,9 @@
     // overlapped close segment will not purged. Passing in index - 1 since
     // we purge a closed segment when end index == passed in purge index.
     TruncationSegments ts = cache.purge(purgeIndex - 1);
-    Assert.assertNull(ts.getToTruncate());
-    Assert.assertEquals(end - start - 1, ts.getToDelete().length);
-    Assert.assertEquals(1, cache.getNumOfSegments());
+    Assertions.assertNull(ts.getToTruncate());
+    Assertions.assertEquals(end - start - 1, ts.getToDelete().length);
+    Assertions.assertEquals(1, cache.getNumOfSegments());
   }
 
   private void populatedSegment(int start, int end, int segmentSize, boolean isOpen) {
@@ -291,15 +291,15 @@
     TermIndex prev = null;
     while (iterator.hasNext()) {
       TermIndex termIndex = iterator.next();
-      Assert.assertEquals(cache.getLogRecord(termIndex.getIndex()).getTermIndex(), termIndex);
+      Assertions.assertEquals(cache.getLogRecord(termIndex.getIndex()).getTermIndex(), termIndex);
       if (prev != null) {
-        Assert.assertEquals(prev.getIndex() + 1, termIndex.getIndex());
+        Assertions.assertEquals(prev.getIndex() + 1, termIndex.getIndex());
       }
       prev = termIndex;
     }
     if (startIndex <= cache.getEndIndex()) {
-      Assert.assertNotNull(prev);
-      Assert.assertEquals(cache.getEndIndex(), prev.getIndex());
+      Assertions.assertNotNull(prev);
+      Assertions.assertEquals(cache.getEndIndex(), prev.getIndex());
     }
   }
 
@@ -321,7 +321,7 @@
     testIterator(299);
 
     Iterator<TermIndex> iterator = cache.iterator(300);
-    Assert.assertFalse(iterator.hasNext());
+    Assertions.assertFalse(iterator.hasNext());
   }
 
   @Test
@@ -332,14 +332,14 @@
 
     Long closedSegmentsNum = (Long) ratisMetricRegistry.getGauges((s, metric) ->
         s.contains(RAFT_LOG_CACHE_CLOSED_SEGMENTS_NUM)).values().iterator().next().getValue();
-    Assert.assertEquals(2L, closedSegmentsNum.longValue());
+    Assertions.assertEquals(2L, closedSegmentsNum.longValue());
 
     Long closedSegmentsSizeInBytes = (Long) ratisMetricRegistry.getGauges((s, metric) ->
         s.contains(RAFT_LOG_CACHE_CLOSED_SEGMENTS_SIZE_IN_BYTES)).values().iterator().next().getValue();
-    Assert.assertEquals(closedSegmentsSizeInBytes.longValue(), cache.getClosedSegmentsSizeInBytes());
+    Assertions.assertEquals(closedSegmentsSizeInBytes.longValue(), cache.getClosedSegmentsSizeInBytes());
 
     Long openSegmentSizeInBytes = (Long) ratisMetricRegistry.getGauges((s, metric) ->
         s.contains(RAFT_LOG_CACHE_OPEN_SEGMENT_SIZE_IN_BYTES)).values().iterator().next().getValue();
-    Assert.assertEquals(openSegmentSizeInBytes.longValue(), cache.getOpenSegmentSizeInBytes());
+    Assertions.assertEquals(openSegmentSizeInBytes.longValue(), cache.getOpenSegmentSizeInBytes());
   }
 }
diff --git a/ratis-test/src/test/java/org/apache/ratis/server/storage/TestRaftStorage.java b/ratis-test/src/test/java/org/apache/ratis/server/storage/TestRaftStorage.java
index 6e75557..eb65f34 100644
--- a/ratis-test/src/test/java/org/apache/ratis/server/storage/TestRaftStorage.java
+++ b/ratis-test/src/test/java/org/apache/ratis/server/storage/TestRaftStorage.java
@@ -32,10 +32,10 @@
 import org.apache.ratis.util.FileUtils;
 import org.apache.ratis.util.Preconditions;
 import org.apache.ratis.util.SizeInBytes;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.mockito.Mockito;
 
 import java.io.File;
@@ -65,12 +65,12 @@
 
   private File storageDir;
 
-  @Before
+  @BeforeEach
   public void setup() {
     storageDir = getTestDir();
   }
 
-  @After
+  @AfterEach
   public void tearDown() throws Exception {
     if (storageDir != null) {
       FileUtils.deleteFully(storageDir.getParentFile());
@@ -93,22 +93,22 @@
 
     // we will format the empty directory
     final RaftStorageImpl storage = newRaftStorage(storageDir);
-    Assert.assertEquals(StorageState.NORMAL, storage.getState());
+    Assertions.assertEquals(StorageState.NORMAL, storage.getState());
 
     try {
       formatRaftStorage(storageDir).close();
-      Assert.fail("the format should fail since the storage is still locked");
+      Assertions.fail("the format should fail since the storage is still locked");
     } catch (IOException e) {
-      Assert.assertTrue(e.getMessage().contains("directory is already locked"));
+      Assertions.assertTrue(e.getMessage().contains("directory is already locked"));
     }
 
     storage.close();
     FileUtils.deleteFully(storageDir);
-    Assert.assertTrue(storageDir.createNewFile());
+    Assertions.assertTrue(storageDir.createNewFile());
     try (RaftStorage ignored = newRaftStorage(storageDir)) {
-      Assert.fail();
+      Assertions.fail();
     } catch (IOException e) {
-      Assert.assertTrue(
+      Assertions.assertTrue(
           e.getMessage().contains(StorageState.NON_EXISTENT.name()));
     }
   }
@@ -121,42 +121,42 @@
     final RaftStorageDirectoryImpl sd = new RaftStorageDirectoryImpl(storageDir, SizeInBytes.ZERO);
     try {
       StorageState state = sd.analyzeStorage(true);
-      Assert.assertEquals(StorageState.NOT_FORMATTED, state);
-      Assert.assertTrue(sd.isCurrentEmpty());
+      Assertions.assertEquals(StorageState.NOT_FORMATTED, state);
+      Assertions.assertTrue(sd.isCurrentEmpty());
     } finally {
       sd.unlock();
     }
 
     RaftStorageImpl storage = newRaftStorage(storageDir);
-    Assert.assertEquals(StorageState.NORMAL, storage.getState());
+    Assertions.assertEquals(StorageState.NORMAL, storage.getState());
     storage.close();
 
-    Assert.assertEquals(StorageState.NORMAL, sd.analyzeStorage(false));
+    Assertions.assertEquals(StorageState.NORMAL, sd.analyzeStorage(false));
     assertMetadataFile(sd.getMetaFile());
 
     // test format
     storage = formatRaftStorage(storageDir);
-    Assert.assertEquals(StorageState.NORMAL, storage.getState());
+    Assertions.assertEquals(StorageState.NORMAL, storage.getState());
     final RaftStorageMetadataFile metaFile = new RaftStorageMetadataFileImpl(sd.getMetaFile());
-    Assert.assertEquals(RaftStorageMetadata.getDefault(), metaFile.getMetadata());
+    Assertions.assertEquals(RaftStorageMetadata.getDefault(), metaFile.getMetadata());
     storage.close();
   }
 
   static void assertMetadataFile(File m) throws Exception {
-    Assert.assertTrue(m.exists());
+    Assertions.assertTrue(m.exists());
     final RaftStorageMetadataFile metaFile = new RaftStorageMetadataFileImpl(m);
-    Assert.assertEquals(RaftStorageMetadata.getDefault(), metaFile.getMetadata());
+    Assertions.assertEquals(RaftStorageMetadata.getDefault(), metaFile.getMetadata());
 
     final RaftPeerId peer1 = RaftPeerId.valueOf("peer1");
     final RaftStorageMetadata metadata = RaftStorageMetadata.valueOf(123, peer1);
     metaFile.persist(metadata);
-    Assert.assertEquals(metadata.getTerm(), 123);
-    Assert.assertEquals(metadata.getVotedFor(), peer1);
-    Assert.assertEquals(metadata, metaFile.getMetadata());
+    Assertions.assertEquals(metadata.getTerm(), 123);
+    Assertions.assertEquals(metadata.getVotedFor(), peer1);
+    Assertions.assertEquals(metadata, metaFile.getMetadata());
 
     final RaftStorageMetadataFile metaFile2 = new RaftStorageMetadataFileImpl(m);
-    Assert.assertNull(((AtomicReference<?>) RaftTestUtil.getDeclaredField(metaFile2, "metadata")).get());
-    Assert.assertEquals(metadata, metaFile2.getMetadata());
+    Assertions.assertNull(((AtomicReference<?>) RaftTestUtil.getDeclaredField(metaFile2, "metadata")).get());
+    Assertions.assertEquals(metadata, metaFile2.getMetadata());
   }
 
   @Test
@@ -172,27 +172,27 @@
   @Test
   public void testCleanMetaTmpFile() throws Exception {
     RaftStorageImpl storage = newRaftStorage(storageDir);
-    Assert.assertEquals(StorageState.NORMAL, storage.getState());
+    Assertions.assertEquals(StorageState.NORMAL, storage.getState());
     storage.close();
 
     final RaftStorageDirectoryImpl sd = new RaftStorageDirectoryImpl(storageDir, SizeInBytes.ZERO);
     File metaFile = sd.getMetaFile();
     FileUtils.move(metaFile, sd.getMetaTmpFile());
 
-    Assert.assertEquals(StorageState.NOT_FORMATTED, sd.analyzeStorage(false));
+    Assertions.assertEquals(StorageState.NOT_FORMATTED, sd.analyzeStorage(false));
 
     // RaftStorage initialization should succeed as the raft-meta.tmp is
     // always cleaned.
     newRaftStorage(storageDir).close();
 
-    Assert.assertTrue(sd.getMetaFile().exists());
-    Assert.assertTrue(sd.getMetaTmpFile().createNewFile());
-    Assert.assertTrue(sd.getMetaTmpFile().exists());
+    Assertions.assertTrue(sd.getMetaFile().exists());
+    Assertions.assertTrue(sd.getMetaTmpFile().createNewFile());
+    Assertions.assertTrue(sd.getMetaTmpFile().exists());
     try {
       storage = newRaftStorage(storageDir);
-      Assert.assertEquals(StorageState.NORMAL, storage.getState());
-      Assert.assertFalse(sd.getMetaTmpFile().exists());
-      Assert.assertTrue(sd.getMetaFile().exists());
+      Assertions.assertEquals(StorageState.NORMAL, storage.getState());
+      Assertions.assertFalse(sd.getMetaTmpFile().exists());
+      Assertions.assertTrue(sd.getMetaFile().exists());
     } finally {
       storage.close();
     }
@@ -207,14 +207,14 @@
     final File file = new File(storageDir, name);
     final TermIndex ti = SimpleStateMachineStorage.getTermIndexFromSnapshotFile(file);
     System.out.println("file = " + file);
-    Assert.assertEquals(term, ti.getTerm());
-    Assert.assertEquals(index, ti.getIndex());
+    Assertions.assertEquals(term, ti.getTerm());
+    Assertions.assertEquals(index, ti.getIndex());
     System.out.println("ti = " + ti);
 
     final File foo = new File(storageDir, "foo");
     try {
       SimpleStateMachineStorage.getTermIndexFromSnapshotFile(foo);
-      Assert.fail();
+      Assertions.fail();
     } catch(IllegalArgumentException iae) {
       System.out.println("Good " + iae);
     }
@@ -244,7 +244,7 @@
       final long index = ThreadLocalRandom.current().nextLong(100, 1000L);
       if (termIndexSet.add(TermIndex.valueOf(term, index))) {
         File file = simpleStateMachineStorage.getSnapshotFile(term, index);
-        Assert.assertTrue(file.createNewFile());
+        Assertions.assertTrue(file.createNewFile());
       }
     }
     // create MD5 files that will not be deleted in older version
@@ -254,7 +254,7 @@
       if (termIndexSet.add(TermIndex.valueOf(term, index))) {
         File file = simpleStateMachineStorage.getSnapshotFile(term, index);
         File snapshotFile = new File(file.getParent(), file.getName() + MD5_SUFFIX);
-        Assert.assertTrue(snapshotFile.createNewFile());
+        Assertions.assertTrue(snapshotFile.createNewFile());
       }
     }
 
@@ -274,7 +274,7 @@
       System.out.println(file.getName());
       Matcher matcher = SNAPSHOT_REGEX.matcher(file.getName());
       if (matcher.matches()) {
-        Assert.assertTrue(remainingIndices.contains(Long.parseLong(matcher.group(2))));
+        Assertions.assertTrue(remainingIndices.contains(Long.parseLong(matcher.group(2))));
       }
     }
 
@@ -288,7 +288,7 @@
       final long term = ThreadLocalRandom.current().nextLong(1, 10L);
       final long index = ThreadLocalRandom.current().nextLong(1000L);
       File file = simpleStateMachineStorage.getSnapshotFile(term, index);
-      Assert.assertTrue(file.createNewFile());
+      Assertions.assertTrue(file.createNewFile());
     }
 
     simpleStateMachineStorage.cleanupOldSnapshots(new SnapshotRetentionPolicy() { });
@@ -297,8 +297,8 @@
 
   private static File[] assertFileCount(File dir, int expected) {
     File[] files = dir.listFiles();
-    Assert.assertNotNull(files);
-    Assert.assertEquals(Arrays.toString(files), expected, files.length);
+    Assertions.assertNotNull(files);
+    Assertions.assertEquals(expected, files.length, Arrays.toString(files));
     return files;
   }
 
@@ -309,6 +309,6 @@
 
     final RaftStorageDirectoryImpl sd = new RaftStorageDirectoryImpl(mockStorageDir, SizeInBytes.valueOf("100M"));
     StorageState state = sd.analyzeStorage(false);
-    Assert.assertEquals(StorageState.NO_SPACE, state);
+    Assertions.assertEquals(StorageState.NO_SPACE, state);
   }
 }
diff --git a/ratis-test/src/test/java/org/apache/ratis/server/storage/TestStorageImplUtils.java b/ratis-test/src/test/java/org/apache/ratis/server/storage/TestStorageImplUtils.java
index e8661e2..4f75f79 100644
--- a/ratis-test/src/test/java/org/apache/ratis/server/storage/TestStorageImplUtils.java
+++ b/ratis-test/src/test/java/org/apache/ratis/server/storage/TestStorageImplUtils.java
@@ -22,9 +22,9 @@
 import org.apache.ratis.server.RaftServerConfigKeys;
 import org.apache.ratis.util.FileUtils;
 import org.apache.ratis.util.JavaUtils;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 
 import java.io.File;
 import java.io.IOException;
@@ -55,7 +55,7 @@
     return new File(vol, sub);
   }
 
-  @AfterClass
+  @AfterAll
   public static void tearDown() throws IOException {
     FileUtils.deleteFully(rootTestDir.get());
   }
@@ -75,9 +75,9 @@
     final File storageDirTwo = chooseNewStorageDir(directories, subDirTwo);
     File expectedOne = new File(testDir, subDirOne);
     File expectedTwo = new File(testDir, subDirTwo);
-    Assert.assertEquals(expectedOne.getCanonicalPath(),
+    Assertions.assertEquals(expectedOne.getCanonicalPath(),
         storageDirOne.getCanonicalPath());
-    Assert.assertEquals(expectedTwo.getCanonicalPath(),
+    Assertions.assertEquals(expectedTwo.getCanonicalPath(),
         storageDirTwo.getCanonicalPath());
   }
 
@@ -113,7 +113,7 @@
     String subDir = UUID.randomUUID().toString();
     final File storageDirectory = chooseNewStorageDir(directories, subDir);
     File expected = new File(directories.get(6), subDir);
-    Assert.assertEquals(expected.getCanonicalPath(),
+    Assertions.assertEquals(expected.getCanonicalPath(),
         storageDirectory.getCanonicalPath());
   }
 
@@ -124,10 +124,10 @@
   public void testChooseStorageDirWithNoVolume() {
     try {
       chooseNewStorageDir(Collections.emptyList(), UUID.randomUUID().toString());
-      Assert.fail();
+      Assertions.fail();
     } catch (IOException ex) {
       String expectedErrMsg = "No storage directory found.";
-      Assert.assertEquals(expectedErrMsg, ex.getMessage());
+      Assertions.assertEquals(expectedErrMsg, ex.getMessage());
     }
   }
 
@@ -144,7 +144,7 @@
 
     final RaftStorageImpl storage = StorageImplUtils.initRaftStorage(
         "group-1", RaftStorage.StartupOption.RECOVER, properties);
-    Assert.assertNotNull(storage);
+    Assertions.assertNotNull(storage);
     storage.close();
   }
 
@@ -172,6 +172,6 @@
         () -> StorageImplUtils.initRaftStorage(
             "group-1", RaftStorage.StartupOption.RECOVER, properties),
         IOException.class);
-    Assert.assertTrue(ioe.getMessage().contains("Failed to RECOVER: Storage directory not found"));
+    Assertions.assertTrue(ioe.getMessage().contains("Failed to RECOVER: Storage directory not found"));
   }
 }
\ No newline at end of file
diff --git a/ratis-test/src/test/java/org/apache/ratis/shell/cli/sh/ElectionCommandIntegrationTest.java b/ratis-test/src/test/java/org/apache/ratis/shell/cli/sh/ElectionCommandIntegrationTest.java
index e708153..a61bb19 100644
--- a/ratis-test/src/test/java/org/apache/ratis/shell/cli/sh/ElectionCommandIntegrationTest.java
+++ b/ratis-test/src/test/java/org/apache/ratis/shell/cli/sh/ElectionCommandIntegrationTest.java
@@ -30,8 +30,8 @@
 import org.apache.ratis.util.Slf4jUtils;
 import org.apache.ratis.util.SizeInBytes;
 import org.apache.ratis.util.TimeDuration;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 import org.slf4j.event.Level;
 
 import java.util.concurrent.TimeUnit;
@@ -63,13 +63,13 @@
     RaftServer.Division newLeader = cluster.getFollowers().get(0);
     final StringPrintStream out = new StringPrintStream();
     RatisShell shell = new RatisShell(out.getPrintStream());
-    Assert.assertNotEquals(cluster.getLeader().getId(), newLeader.getId());
+    Assertions.assertNotEquals(cluster.getLeader().getId(), newLeader.getId());
     int ret = shell.run("election", "transfer", "-peers", address, "-address",
         newLeader.getPeer().getAddress());
 
-    Assert.assertEquals(0, ret);
+    Assertions.assertEquals(0, ret);
     JavaUtils.attempt(() -> {
-      Assert.assertEquals(cluster.getLeader().getId(), newLeader.getId());
+      Assertions.assertEquals(cluster.getLeader().getId(), newLeader.getId());
     }, 10, TimeDuration.valueOf(1, TimeUnit.SECONDS), "testElectionTransferCommand", LOG);
   }
 
@@ -85,28 +85,28 @@
     RaftServer.Division newLeader = cluster.getFollowers().get(0);
     final StringPrintStream out = new StringPrintStream();
     RatisShell shell = new RatisShell(out.getPrintStream());
-    Assert.assertTrue(cluster.getFollowers().contains(newLeader));
+    Assertions.assertTrue(cluster.getFollowers().contains(newLeader));
 
     // set current leader's priority to 2
     int ret = shell.run("peer", "setPriority", "-peers", address, "-addressPriority",
         leader.getPeer().getAddress()+ "|" + 2);
-    Assert.assertEquals(0, ret);
+    Assertions.assertEquals(0, ret);
 
     // transfer to new leader will set its priority to 2 (with timeout 1s)
     ret = shell.run("election", "transfer", "-peers", address, "-address",
         newLeader.getPeer().getAddress(), "-timeout", "1");
-    Assert.assertEquals(0, ret);
+    Assertions.assertEquals(0, ret);
 
-    JavaUtils.attempt(() -> Assert.assertEquals(cluster.getLeader().getId(), newLeader.getId()),
+    JavaUtils.attempt(() -> Assertions.assertEquals(cluster.getLeader().getId(), newLeader.getId()),
         10, TimeDuration.valueOf(1, TimeUnit.SECONDS), "testElectionTransferLeaderCommand", LOG);
 
     // verify that priorities of new leader and old leader are both 2
     ret = shell.run("group", "info", "-peers", address);
-    Assert.assertEquals(0 , ret);
+    Assertions.assertEquals(0 , ret);
     String expected = String.format("\"%s\"%n  priority: %d", newLeader.getPeer().getAddress(), 2);
     String expected2 = String.format("\"%s\"%n  priority: %d", leader.getPeer().getAddress(), 2);
-    Assert.assertTrue(out.toString().contains(expected));
-    Assert.assertTrue(out.toString().contains(expected2));
+    Assertions.assertTrue(out.toString().contains(expected));
+    Assertions.assertTrue(out.toString().contains(expected2));
   }
 
   @Test
@@ -120,25 +120,25 @@
     RaftServer.Division newLeader = cluster.getFollowers().get(0);
     final StringPrintStream out = new StringPrintStream();
     RatisShell shell = new RatisShell(out.getPrintStream());
-    Assert.assertNotEquals(cluster.getLeader().getId(), newLeader.getId());
+    Assertions.assertNotEquals(cluster.getLeader().getId(), newLeader.getId());
     int ret = shell.run("election", "pause", "-peers", sb.toString(), "-address",
         newLeader.getPeer().getAddress());
 
-    Assert.assertEquals(0, ret);
+    Assertions.assertEquals(0, ret);
     ret = shell.run("peer", "setPriority", "-peers", sb.toString(), "-addressPriority",
         newLeader.getPeer().getAddress() + "|" + 2);
-    Assert.assertEquals(0, ret);
+    Assertions.assertEquals(0, ret);
 
     JavaUtils.attempt(() -> {
-      Assert.assertNotEquals(cluster.getLeader().getId(), newLeader.getId());
+      Assertions.assertNotEquals(cluster.getLeader().getId(), newLeader.getId());
     }, 10, TimeDuration.valueOf(1, TimeUnit.SECONDS), "testElectionPauseResumeCommand", LOG);
 
     ret = shell.run("election", "resume", "-peers", sb.toString(), "-address",
         newLeader.getPeer().getAddress());
-    Assert.assertEquals(0, ret);
+    Assertions.assertEquals(0, ret);
 
     JavaUtils.attempt(() -> {
-      Assert.assertEquals(cluster.getLeader().getId(), newLeader.getId());
+      Assertions.assertEquals(cluster.getLeader().getId(), newLeader.getId());
     }, 10, TimeDuration.valueOf(1, TimeUnit.SECONDS), "testElectionPauseResumeCommand", LOG);
   }
 
@@ -153,10 +153,10 @@
     RaftServer.Division newLeader = cluster.getFollowers().get(0);
     final StringPrintStream out = new StringPrintStream();
     RatisShell shell = new RatisShell(out.getPrintStream());
-    Assert.assertNotEquals(cluster.getLeader().getId(), newLeader.getId());
-    Assert.assertEquals(2, cluster.getFollowers().size());
+    Assertions.assertNotEquals(cluster.getLeader().getId(), newLeader.getId());
+    Assertions.assertEquals(2, cluster.getFollowers().size());
     int ret = shell.run("election", "stepDown", "-peers", sb.toString());
-    Assert.assertEquals(0, ret);
-    Assert.assertEquals(3, cluster.getFollowers().size());
+    Assertions.assertEquals(0, ret);
+    Assertions.assertEquals(3, cluster.getFollowers().size());
   }
 }
diff --git a/ratis-test/src/test/java/org/apache/ratis/shell/cli/sh/GroupCommandIntegrationTest.java b/ratis-test/src/test/java/org/apache/ratis/shell/cli/sh/GroupCommandIntegrationTest.java
index c745307..83c05bf 100644
--- a/ratis-test/src/test/java/org/apache/ratis/shell/cli/sh/GroupCommandIntegrationTest.java
+++ b/ratis-test/src/test/java/org/apache/ratis/shell/cli/sh/GroupCommandIntegrationTest.java
@@ -29,8 +29,8 @@
 import org.apache.ratis.util.Slf4jUtils;
 import org.apache.ratis.util.SizeInBytes;
 
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 import org.slf4j.event.Level;
 
 public abstract class GroupCommandIntegrationTest<CLUSTER extends MiniRaftCluster>
@@ -64,11 +64,11 @@
     RatisShell shell = new RatisShell(out.getPrintStream());
     int ret = shell.run("group", "list", "-peers", address, "-peerId",
         leader.getPeer().getId().toString());
-    Assert.assertEquals(0, ret);
+    Assertions.assertEquals(0, ret);
     String info = out.toString().trim();
     String expected = String.format("The peerId %s (server %s) is in 1 groups, and the groupIds is: [%s]",
         leader.getId(), leader.getPeer().getAddress(), leader.getGroup().getGroupId());
-    Assert.assertEquals(expected, info);
+    Assertions.assertEquals(expected, info);
   }
 
   @Test
@@ -82,12 +82,12 @@
     final StringPrintStream out = new StringPrintStream();
     RatisShell shell = new RatisShell(out.getPrintStream());
     int ret = shell.run("group", "info", "-peers", address);
-    Assert.assertEquals(0 , ret);
+    Assertions.assertEquals(0 , ret);
     String result = out.toString().trim();
     String hearder = String.format("group id: %s%sleader info: %s(%s)%s%s",
         cluster.getGroupId().getUuid(), NEW_LINE, leader.getId(),
         cluster.getLeader().getPeer().getAddress(), NEW_LINE, NEW_LINE);
     String info = result.substring(0, hearder.length());
-    Assert.assertEquals(hearder, info);
+    Assertions.assertEquals(hearder, info);
   }
 }
diff --git a/ratis-test/src/test/java/org/apache/ratis/shell/cli/sh/PeerCommandIntegrationTest.java b/ratis-test/src/test/java/org/apache/ratis/shell/cli/sh/PeerCommandIntegrationTest.java
index 8040030..b3c3514 100644
--- a/ratis-test/src/test/java/org/apache/ratis/shell/cli/sh/PeerCommandIntegrationTest.java
+++ b/ratis-test/src/test/java/org/apache/ratis/shell/cli/sh/PeerCommandIntegrationTest.java
@@ -33,8 +33,8 @@
 import org.apache.ratis.util.Slf4jUtils;
 import org.apache.ratis.util.SizeInBytes;
 import org.apache.ratis.util.TimeDuration;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 import org.slf4j.event.Level;
 
 import java.util.concurrent.TimeUnit;
@@ -68,11 +68,11 @@
     RaftPeer[] peers = new RaftPeer[]{cluster.getFollowers().get(1).getPeer(), leader.getPeer()};
     final StringPrintStream out = new StringPrintStream();
     RatisShell shell = new RatisShell(out.getPrintStream());
-    Assert.assertTrue(cluster.getFollowers().contains(toRemove));
+    Assertions.assertTrue(cluster.getFollowers().contains(toRemove));
     int ret = shell.run("peer", "remove", "-peers", address, "-peerId",
         toRemove.getPeer().getId().toString());
 
-    Assert.assertEquals(0, ret);
+    Assertions.assertEquals(0, ret);
     RaftServerTestUtil.waitAndCheckNewConf(cluster, peers,1, null);
   }
 
@@ -95,7 +95,7 @@
     int ret = shell.run("peer", "add", "-peers", sb.toString(), "-address",
         newPeers[0].getAdminAddress(), "-peerId", newPeers[0].getId().toString());
 
-    Assert.assertEquals(0, ret);
+    Assertions.assertEquals(0, ret);
     RaftServerTestUtil.waitAndCheckNewConf(cluster, ObjectArrays.concat(peers, newPeers[0]), 0, null);
 
   }
@@ -112,12 +112,12 @@
     RaftServer.Division newLeader = cluster.getFollowers().get(0);
     final StringPrintStream out = new StringPrintStream();
     RatisShell shell = new RatisShell(out.getPrintStream());
-    Assert.assertTrue(cluster.getFollowers().contains(newLeader));
+    Assertions.assertTrue(cluster.getFollowers().contains(newLeader));
     int ret = shell.run("peer", "setPriority", "-peers", address, "-addressPriority",
         newLeader.getPeer().getAddress()+ "|" + 2);
-    Assert.assertEquals(0, ret);
+    Assertions.assertEquals(0, ret);
     JavaUtils.attempt(() -> {
-      Assert.assertEquals(cluster.getLeader().getId(), newLeader.getId());
+      Assertions.assertEquals(cluster.getLeader().getId(), newLeader.getId());
     }, 10, TimeDuration.valueOf(1, TimeUnit.SECONDS), "testPeerSetPriorityCommand", LOG);
   }
 
diff --git a/ratis-test/src/test/java/org/apache/ratis/shell/cli/sh/SnapshotCommandIntegrationTest.java b/ratis-test/src/test/java/org/apache/ratis/shell/cli/sh/SnapshotCommandIntegrationTest.java
index 3c0ee97..f3f4e43 100644
--- a/ratis-test/src/test/java/org/apache/ratis/shell/cli/sh/SnapshotCommandIntegrationTest.java
+++ b/ratis-test/src/test/java/org/apache/ratis/shell/cli/sh/SnapshotCommandIntegrationTest.java
@@ -30,8 +30,8 @@
 import org.apache.ratis.statemachine.StateMachine;
 import org.apache.ratis.util.Slf4jUtils;
 import org.apache.ratis.util.SizeInBytes;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 import org.slf4j.event.Level;
 
 import java.io.File;
@@ -67,7 +67,7 @@
     try (final RaftClient client = cluster.createClient(leaderId)) {
       for (int i = 0; i < RaftServerConfigKeys.Snapshot.creationGap(getProperties()); i++) {
         RaftClientReply reply = client.io().send(new RaftTestUtil.SimpleMessage("m" + i));
-        Assert.assertTrue(reply.isSuccess());
+        Assertions.assertTrue(reply.isSuccess());
       }
     }
     final String address = getClusterAddress(cluster);
@@ -75,14 +75,14 @@
     RatisShell shell = new RatisShell(out.getPrintStream());
     int ret = shell.run("snapshot", "create", "-peers", address, "-peerId",
         leader.getPeer().getId().toString());
-    Assert.assertEquals(0, ret);
+    Assertions.assertEquals(0, ret);
     String[] str = out.toString().trim().split(" ");
     int snapshotIndex = Integer.parseInt(str[str.length-1]);
     LOG.info("snapshotIndex = {}", snapshotIndex);
 
     final File snapshotFile = SimpleStateMachine4Testing.get(leader)
         .getStateMachineStorage().getSnapshotFile(leader.getInfo().getCurrentTerm(), snapshotIndex);
-    Assert.assertTrue(snapshotFile.exists());
+    Assertions.assertTrue(snapshotFile.exists());
   }
 
   void runTestSnapshotCreateCommandOnSpecificServer(MiniRaftCluster cluster) throws Exception {
@@ -91,16 +91,16 @@
     try (final RaftClient client = cluster.createClient(leaderId)) {
       for (int i = 0; i < RaftServerConfigKeys.Snapshot.creationGap(getProperties()); i++) {
         RaftClientReply reply = client.io().send(new RaftTestUtil.SimpleMessage("m" + i));
-        Assert.assertTrue(reply.isSuccess());
+        Assertions.assertTrue(reply.isSuccess());
       }
     }
     final String address = getClusterAddress(cluster);
     final StringPrintStream out = new StringPrintStream();
     RatisShell shell = new RatisShell(out.getPrintStream());
-    Assert.assertEquals(2, cluster.getFollowers().size());
+    Assertions.assertEquals(2, cluster.getFollowers().size());
     int ret = shell.run("snapshot", "create", "-peers", address, "-peerId",
         cluster.getFollowers().get(0).getId().toString());
-    Assert.assertEquals(0, ret);
+    Assertions.assertEquals(0, ret);
     String[] str = out.toString().trim().split(" ");
     int snapshotIndex = Integer.parseInt(str[str.length-1]);
     LOG.info("snapshotIndex = {}", snapshotIndex);
@@ -108,7 +108,7 @@
     final File snapshotFile = SimpleStateMachine4Testing.get(cluster.getFollowers().get(0))
         .getStateMachineStorage()
         .getSnapshotFile(cluster.getFollowers().get(0).getInfo().getCurrentTerm(), snapshotIndex);
-    Assert.assertTrue(snapshotFile.exists());
+    Assertions.assertTrue(snapshotFile.exists());
   }
 
 }
diff --git a/ratis-test/src/test/java/org/apache/ratis/shell/cli/sh/TestRatisShell.java b/ratis-test/src/test/java/org/apache/ratis/shell/cli/sh/TestRatisShell.java
index 6e22276..21f4685 100644
--- a/ratis-test/src/test/java/org/apache/ratis/shell/cli/sh/TestRatisShell.java
+++ b/ratis-test/src/test/java/org/apache/ratis/shell/cli/sh/TestRatisShell.java
@@ -27,8 +27,8 @@
 import org.apache.ratis.shell.cli.sh.command.PeerCommand;
 import org.apache.ratis.shell.cli.sh.command.SnapshotCommand;
 import org.apache.ratis.util.ReflectionUtils;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 import org.reflections.Reflections;
 
 import java.io.PrintStream;
@@ -49,12 +49,12 @@
   static final Class<?>[] ARG_CLASSES = new Class[] {Context.class};
 
   static void assertCommand(String message, Command expected, Command computed) {
-    Assert.assertEquals(message, expected.getClass(), computed.getClass());
-    Assert.assertEquals(message, expected.getCommandName(), computed.getCommandName());
+    Assertions.assertEquals(expected.getClass(), computed.getClass(), message);
+    Assertions.assertEquals(expected.getCommandName(), computed.getCommandName(), message);
   }
 
   static void assertCommands(List<Command> expected, List<Command> computed) {
-    Assert.assertEquals(expected.size(), computed.size());
+    Assertions.assertEquals(expected.size(), computed.size());
     for(int i = 0; i < expected.size(); i++) {
       assertCommand("Command " + i, expected.get(i), computed.get(i));
     }
@@ -103,7 +103,7 @@
     final List<Command> computed = new ArrayList<>(parent.getSubCommands().values());
     Collections.sort(computed);
 
-    Assert.assertFalse(computed.isEmpty());
+    Assertions.assertFalse(computed.isEmpty());
 
     final Package pkg = computed.iterator().next().getClass().getPackage();
     final List<Command> expected = new ArrayList<>(loadCommands(pkg));
diff --git a/ratis-test/src/test/java/org/apache/ratis/statemachine/TestStateMachine.java b/ratis-test/src/test/java/org/apache/ratis/statemachine/TestStateMachine.java
index 8e37947..0941898 100644
--- a/ratis-test/src/test/java/org/apache/ratis/statemachine/TestStateMachine.java
+++ b/ratis-test/src/test/java/org/apache/ratis/statemachine/TestStateMachine.java
@@ -35,7 +35,8 @@
 import org.apache.ratis.server.simulation.MiniRaftClusterWithSimulatedRpc;
 import org.apache.ratis.statemachine.impl.SimpleStateMachine4Testing;
 import org.apache.ratis.util.Slf4jUtils;
-import org.junit.*;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
 import org.slf4j.event.Level;
 
 import java.util.Collections;
@@ -48,7 +49,10 @@
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.concurrent.atomic.AtomicReference;
 
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 /**
  * Test StateMachine related functionality
@@ -162,9 +166,9 @@
     final SMTransactionContext sm = SMTransactionContext.get(raftServer);
     final List<Long> ll = new ArrayList<>(sm.applied);
     Collections.sort(ll);
-    assertEquals(ll.toString(), ll.size(), numTrx);
+    assertEquals(ll.size(), numTrx, ll.toString());
     for (int i=0; i < numTrx; i++) {
-      assertEquals(ll.toString(), Long.valueOf(i+1), ll.get(i));
+      assertEquals(Long.valueOf(i+1), ll.get(i), ll.toString());
     }
   }
 
@@ -193,7 +197,7 @@
 
       final RaftServer server = cluster.getServer(id);
       for(Map.Entry<RaftGroupId, StateMachine> e: registry.entrySet()) {
-        Assert.assertSame(e.getValue(), server.getDivision(e.getKey()).getStateMachine());
+        Assertions.assertSame(e.getValue(), server.getDivision(e.getKey()).getStateMachine());
       }
     }
   }
diff --git a/ratis-test/src/test/java/org/apache/ratis/util/TestDataBlockingQueue.java b/ratis-test/src/test/java/org/apache/ratis/util/TestDataBlockingQueue.java
index df0dd2f..e9dcf61 100644
--- a/ratis-test/src/test/java/org/apache/ratis/util/TestDataBlockingQueue.java
+++ b/ratis-test/src/test/java/org/apache/ratis/util/TestDataBlockingQueue.java
@@ -17,8 +17,9 @@
  */
 package org.apache.ratis.util;
 
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -36,34 +37,38 @@
   final TimeDuration slow = TimeDuration.valueOf(100, TimeUnit.MILLISECONDS);
   final TimeDuration fast = TimeDuration.valueOf(10, TimeUnit.MILLISECONDS);
 
-  @Test(timeout = 1000)
+  @Test
+  @Timeout(value = 1000)
   public void testElementLimit() {
     TestDataQueue.runTestElementLimit(q);
   }
 
-  @Test(timeout = 1000)
+  @Test
+  @Timeout(value = 1000)
   public void testByteLimit() {
     TestDataQueue.runTestByteLimit(q);
   }
 
-  @Test(timeout = 10_000)
+  @Test
+  @Timeout(value = 1000)
   public void testSlowOfferFastPoll() throws Exception {
     runTestBlockingCalls(slow, fast, q);
   }
 
-  @Test(timeout = 10_000)
+  @Test
+  @Timeout(value = 1000)
   public void testFastOfferSlowPoll() throws Exception {
     runTestBlockingCalls(fast, slow, q);
   }
 
   static void assertOfferPull(long offering, long polled, long elementLimit) {
-    Assert.assertTrue(offering >= polled);
-    Assert.assertTrue(offering - polled <= elementLimit + 1);
+    Assertions.assertTrue(offering >= polled);
+    Assertions.assertTrue(offering - polled <= elementLimit + 1);
   }
 
   static void runTestBlockingCalls(TimeDuration offerSleepTime, TimeDuration pollSleepTime,
       DataBlockingQueue<Long> q) throws Exception {
-    Assert.assertTrue(q.isEmpty());
+    Assertions.assertTrue(q.isEmpty());
     ExitUtils.disableSystemExit();
     final int elementLimit = q.getElementLimit();
     final TimeDuration timeout = CollectionUtils.min(offerSleepTime, pollSleepTime);
@@ -74,11 +79,11 @@
 
     final Thread pollThread = new Thread(() -> {
       try {
-        for(; polledValue.get() < endValue;) {
+        while (polledValue.get() < endValue) {
           pollSleepTime.sleep();
           final Long polled = q.poll(timeout);
           if (polled != null) {
-            Assert.assertEquals(polledValue.incrementAndGet(), polled.intValue());
+            Assertions.assertEquals(polledValue.incrementAndGet(), polled.intValue());
             LOG.info("polled {}", polled);
           }
           assertOfferPull(offeringValue.get(), polledValue.get(), elementLimit);
@@ -109,10 +114,10 @@
     offerThread.join();
     pollThread.join();
 
-    Assert.assertEquals(endValue + 1, offeringValue.get());
-    Assert.assertEquals(endValue, polledValue.get());
+    Assertions.assertEquals(endValue + 1, offeringValue.get());
+    Assertions.assertEquals(endValue, polledValue.get());
 
-    Assert.assertTrue(q.isEmpty());
+    Assertions.assertTrue(q.isEmpty());
     ExitUtils.assertNotTerminated();
   }
 }
diff --git a/ratis-test/src/test/java/org/apache/ratis/util/TestDataQueue.java b/ratis-test/src/test/java/org/apache/ratis/util/TestDataQueue.java
index fe8a7ac..2dafa7e 100644
--- a/ratis-test/src/test/java/org/apache/ratis/util/TestDataQueue.java
+++ b/ratis-test/src/test/java/org/apache/ratis/util/TestDataQueue.java
@@ -18,8 +18,9 @@
 package org.apache.ratis.util;
 
 import org.apache.ratis.util.function.TriConsumer;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
 
 import java.util.ArrayList;
 import java.util.Collections;
@@ -37,15 +38,16 @@
   }
 
   static void assertSizes(long expectedNumElements, long expectedNumBytes, DataQueue<?> q) {
-    Assert.assertEquals(expectedNumElements, q.getNumElements());
-    Assert.assertEquals(expectedNumBytes, q.getNumBytes());
+    Assertions.assertEquals(expectedNumElements, q.getNumElements());
+    Assertions.assertEquals(expectedNumBytes, q.getNumBytes());
   }
 
   final SizeInBytes byteLimit = SizeInBytes.valueOf(100);
   final int elementLimit = 5;
   final DataQueue<Long> q = new DataQueue<>(null, byteLimit, elementLimit, Long::longValue);
 
-  @Test(timeout = 1000)
+  @Test
+  @Timeout(value = 1000)
   public void testElementLimit() {
     runTestElementLimit(q);
   }
@@ -56,30 +58,31 @@
     final int elementLimit = q.getElementLimit();
     long numBytes = 0;
     for (long i = 0; i < elementLimit; i++) {
-      Assert.assertEquals(i, q.getNumElements());
-      Assert.assertEquals(numBytes, q.getNumBytes());
+      Assertions.assertEquals(i, q.getNumElements());
+      Assertions.assertEquals(numBytes, q.getNumBytes());
       final boolean offered = q.offer(i);
-      Assert.assertTrue(offered);
+      Assertions.assertTrue(offered);
       numBytes += i;
       assertSizes(i+1, numBytes, q);
     }
     {
       final boolean offered = q.offer(0L);
-      Assert.assertFalse(offered);
+      Assertions.assertFalse(offered);
       assertSizes(elementLimit, numBytes, q);
     }
 
     { // poll all elements
       final List<Long> polled = q.pollList(100, (i, timeout) -> i, getTimeoutHandler(false));
-      Assert.assertEquals(elementLimit, polled.size());
+      Assertions.assertEquals(elementLimit, polled.size());
       for (int i = 0; i < polled.size(); i++) {
-        Assert.assertEquals(i, polled.get(i).intValue());
+        Assertions.assertEquals(i, polled.get(i).intValue());
       }
     }
     assertSizes(0, 0, q);
   }
 
-  @Test(timeout = 1000)
+  @Test
+  @Timeout(value = 1000)
   public void testByteLimit() {
     runTestByteLimit(q);
   }
@@ -90,53 +93,54 @@
     final long byteLimit = q.getByteLimit();
     try {
       q.offer(byteLimit + 1);
-      Assert.fail();
+      Assertions.fail();
     } catch (IllegalStateException ignored) {
     }
 
     final long halfBytes = byteLimit / 2;
     {
       final boolean offered = q.offer(halfBytes);
-      Assert.assertTrue(offered);
+      Assertions.assertTrue(offered);
       assertSizes(1, halfBytes, q);
     }
 
     {
       final boolean offered = q.offer(halfBytes + 1);
-      Assert.assertFalse(offered);
+      Assertions.assertFalse(offered);
       assertSizes(1, halfBytes, q);
     }
 
     {
       final boolean offered = q.offer(halfBytes);
-      Assert.assertTrue(offered);
+      Assertions.assertTrue(offered);
       assertSizes(2, byteLimit, q);
     }
 
     {
       final boolean offered = q.offer(1L);
-      Assert.assertFalse(offered);
+      Assertions.assertFalse(offered);
       assertSizes(2, byteLimit, q);
     }
 
     {
       final boolean offered = q.offer(0L);
-      Assert.assertTrue(offered);
+      Assertions.assertTrue(offered);
       assertSizes(3, byteLimit, q);
     }
 
     { // poll all elements
       final List<Long> polled = q.pollList(100, (i, timeout) -> i, getTimeoutHandler(false));
-      Assert.assertEquals(3, polled.size());
-      Assert.assertEquals(halfBytes, polled.get(0).intValue());
-      Assert.assertEquals(halfBytes, polled.get(1).intValue());
-      Assert.assertEquals(0, polled.get(2).intValue());
+      Assertions.assertEquals(3, polled.size());
+      Assertions.assertEquals(halfBytes, polled.get(0).intValue());
+      Assertions.assertEquals(halfBytes, polled.get(1).intValue());
+      Assertions.assertEquals(0, polled.get(2).intValue());
     }
 
     assertSizes(0, 0, q);
   }
 
-  @Test(timeout = 1000)
+  @Test
+  @Timeout(value = 1000)
   public void testIteratorAndRemove() {
     runTestIteratorAndRemove(q);
   }
@@ -149,7 +153,7 @@
     long numBytes = 0;
     for(long i = 0; i < elementLimit; i++) {
       final boolean offered = q.offer(i);
-      Assert.assertTrue(offered);
+      Assertions.assertTrue(offered);
       numElements++;
       numBytes += i;
       assertSizes(numElements, numBytes, q);
@@ -158,7 +162,7 @@
     { // test iterator()
       final Iterator<Long> i = q.iterator();
       for (long expected = 0; expected < elementLimit; expected++) {
-        Assert.assertEquals(expected, i.next().longValue());
+        Assertions.assertEquals(expected, i.next().longValue());
       }
     }
 
@@ -180,23 +184,24 @@
     assertSizes(0, 0, q);
   }
 
-  @Test(timeout = 1000)
+  @Test
+  @Timeout(value = 1000)
   public void testTimeout() {
     assertSizes(0, 0, q);
 
     long numBytes = 0;
     for (long i = 0; i < elementLimit; i++) {
-      Assert.assertEquals(i, q.getNumElements());
-      Assert.assertEquals(numBytes, q.getNumBytes());
+      Assertions.assertEquals(i, q.getNumElements());
+      Assertions.assertEquals(numBytes, q.getNumBytes());
       final boolean offered = q.offer(i);
-      Assert.assertTrue(offered);
+      Assertions.assertTrue(offered);
       numBytes += i;
       assertSizes(i+1, numBytes, q);
     }
 
     { // poll with zero time
       final List<Long> polled = q.pollList(0, (i, timeout) -> i, getTimeoutHandler(false));
-      Assert.assertTrue(polled.isEmpty());
+      Assertions.assertTrue(polled.isEmpty());
       assertSizes(elementLimit, numBytes, q);
     }
 
@@ -209,9 +214,9 @@
         }
         return i;
       }, getTimeoutHandler(true));
-      Assert.assertEquals(halfElements, polled.size());
+      Assertions.assertEquals(halfElements, polled.size());
       for (int i = 0; i < polled.size(); i++) {
-        Assert.assertEquals(i, polled.get(i).intValue());
+        Assertions.assertEquals(i, polled.get(i).intValue());
         numBytes -= i;
       }
       assertSizes(elementLimit - halfElements, numBytes, q);
@@ -219,9 +224,9 @@
 
     { // poll the remaining elements
       final List<Long> polled = q.pollList(100, (i, timeout) -> i, getTimeoutHandler(false));
-      Assert.assertEquals(elementLimit - halfElements, polled.size());
+      Assertions.assertEquals(elementLimit - halfElements, polled.size());
       for (int i = 0; i < polled.size(); i++) {
-        Assert.assertEquals(halfElements + i, polled.get(i).intValue());
+        Assertions.assertEquals(halfElements + i, polled.get(i).intValue());
       }
     }
     assertSizes(0, 0, q);
diff --git a/ratis-test/src/test/java/org/apache/ratis/util/TestExitUtils.java b/ratis-test/src/test/java/org/apache/ratis/util/TestExitUtils.java
index 25b05fd..1dd5b27 100644
--- a/ratis-test/src/test/java/org/apache/ratis/util/TestExitUtils.java
+++ b/ratis-test/src/test/java/org/apache/ratis/util/TestExitUtils.java
@@ -19,15 +19,17 @@
 
 import org.apache.ratis.BaseTest;
 import org.apache.ratis.util.ExitUtils.ExitException;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
 
 public class TestExitUtils extends BaseTest {
   /** Test if {@link BaseTest} can handle uncaught exception. */
-  @Test(timeout = 1000)
+  @Test
+  @Timeout(value = 1000)
   public void testUncaughtException() throws Exception {
-    Assert.assertFalse(ExitUtils.isTerminated());
-    Assert.assertFalse(ExitUtils.clear());
+    Assertions.assertFalse(ExitUtils.isTerminated());
+    Assertions.assertFalse(ExitUtils.clear());
 
     final Thread t = new Thread(null, () -> {
       throw new AssertionError("Testing");
@@ -35,25 +37,26 @@
     t.start();
     t.join();
 
-    Assert.assertTrue(ExitUtils.isTerminated());
-    Assert.assertTrue(ExitUtils.clear());
+    Assertions.assertTrue(ExitUtils.isTerminated());
+    Assertions.assertTrue(ExitUtils.clear());
   }
 
   /** Test if {@link BaseTest} can handle ExitUtils.terminate(..). */
-  @Test(timeout = 1000)
+  @Test
+  @Timeout(value = 1000)
   public void testExitStatus() {
-    Assert.assertFalse(ExitUtils.isTerminated());
-    Assert.assertFalse(ExitUtils.clear());
+    Assertions.assertFalse(ExitUtils.isTerminated());
+    Assertions.assertFalse(ExitUtils.clear());
 
     final int status = -1;
     try {
       ExitUtils.terminate(status, "testExitStatus", LOG);
-      Assert.fail();
+      Assertions.fail();
     } catch (ExitException e) {
-      Assert.assertEquals(status, e.getStatus());
+      Assertions.assertEquals(status, e.getStatus());
     }
 
-    Assert.assertTrue(ExitUtils.isTerminated());
-    Assert.assertTrue(ExitUtils.clear());
+    Assertions.assertTrue(ExitUtils.isTerminated());
+    Assertions.assertTrue(ExitUtils.clear());
   }
 }
diff --git a/ratis-test/src/test/java/org/apache/ratis/util/TestLifeCycle.java b/ratis-test/src/test/java/org/apache/ratis/util/TestLifeCycle.java
index 3faf2a4..f817449 100644
--- a/ratis-test/src/test/java/org/apache/ratis/util/TestLifeCycle.java
+++ b/ratis-test/src/test/java/org/apache/ratis/util/TestLifeCycle.java
@@ -18,12 +18,13 @@
 package org.apache.ratis.util;
 
 import org.apache.ratis.util.function.TriConsumer;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
 
 import static org.apache.ratis.util.LifeCycle.State.*;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.*;
 
@@ -33,7 +34,8 @@
    * {@link LifeCycle} uses predecessors to validate transitions
    * while this test uses successors.
    */
-  @Test(timeout = 1000)
+  @Test
+  @Timeout(value = 1000)
   public void testIsValid() {
     final Map<LifeCycle.State, List<LifeCycle.State>> successors
         = new EnumMap<>(LifeCycle.State.class);
@@ -49,9 +51,8 @@
     final List<LifeCycle.State> states = Arrays.asList(LifeCycle.State.values());
     states.forEach(
         from -> states.forEach(
-            to -> assertEquals(from + " -> " + to,
-                successors.get(from).contains(to),
-                isValid(from, to))));
+            to -> assertEquals(successors.get(from).contains(to),
+                isValid(from, to), from + " -> " + to)));
   }
 
   @Test
@@ -90,7 +91,7 @@
         assertFalse(shouldThrow);
       } catch (IllegalStateException e) {
         assertTrue(shouldThrow);
-        assertEquals("Should be in original state", from, subject.getCurrentState());
+        assertEquals(from, subject.getCurrentState(), "Should be in original state");
       }
     }
   }
diff --git a/ratis-test/src/test/java/org/apache/ratis/util/TestMinMax.java b/ratis-test/src/test/java/org/apache/ratis/util/TestMinMax.java
index 8d315b7..050d997 100644
--- a/ratis-test/src/test/java/org/apache/ratis/util/TestMinMax.java
+++ b/ratis-test/src/test/java/org/apache/ratis/util/TestMinMax.java
@@ -17,8 +17,9 @@
  */
 package org.apache.ratis.util;
 
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -27,7 +28,8 @@
 import java.util.stream.LongStream;
 
 public class TestMinMax {
-  @Test(timeout = 1000)
+  @Test
+  @Timeout(value = 1000)
   public void testMinMax() {
     runTestMinMax(LongStream.empty());
     runTestMinMax(LongStream.iterate(0, n -> n).limit(10));
@@ -43,11 +45,11 @@
     final List<Long> list = stream.collect(ArrayList::new, List::add, List::addAll);
     final LongMinMax longMinMax = toLongStream(list).collect(LongMinMax::new, LongMinMax::accumulate, LongMinMax::combine);
     if (longMinMax.isInitialized()) {
-      Assert.assertEquals(toLongStream(list).min().getAsLong(), longMinMax.getMin());
-      Assert.assertEquals(toLongStream(list).max().getAsLong(), longMinMax.getMax());
+      Assertions.assertEquals(toLongStream(list).min().getAsLong(), longMinMax.getMin());
+      Assertions.assertEquals(toLongStream(list).max().getAsLong(), longMinMax.getMax());
     } else {
-      Assert.assertEquals(OptionalLong.empty(), toLongStream(list).min());
-      Assert.assertEquals(OptionalLong.empty(), toLongStream(list).max());
+      Assertions.assertEquals(OptionalLong.empty(), toLongStream(list).min());
+      Assertions.assertEquals(OptionalLong.empty(), toLongStream(list).max());
     }
   }
 
diff --git a/ratis-test/src/test/java/org/apache/ratis/util/TestPeerProxyMap.java b/ratis-test/src/test/java/org/apache/ratis/util/TestPeerProxyMap.java
index 549fbc5..118830b 100644
--- a/ratis-test/src/test/java/org/apache/ratis/util/TestPeerProxyMap.java
+++ b/ratis-test/src/test/java/org/apache/ratis/util/TestPeerProxyMap.java
@@ -20,8 +20,9 @@
 import org.apache.ratis.BaseTest;
 import org.apache.ratis.protocol.RaftPeer;
 import org.apache.ratis.protocol.RaftPeerId;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
 
 import java.io.Closeable;
 import java.io.IOException;
@@ -51,7 +52,8 @@
     }
   }
 
-  @Test(timeout = 10_000)
+  @Test
+  @Timeout(value = 10_000)
   public void testCloseDeadLock() throws Exception {
     final PeerProxyMap<DummyProxy> map = new PeerProxyMap<>("test", DummyProxy::new);
     final RaftPeerId id = RaftPeerId.valueOf("s0");
@@ -68,7 +70,7 @@
           HUNDRED_MILLIS.sleep();
           LOG.info("Try getProxy");
           final DummyProxy newProxy = map.getProxy(id);
-          Assert.assertNotSame(proxy, newProxy);
+          Assertions.assertNotSame(proxy, newProxy);
         } catch (Exception e) {
           setFirstException(e);
         }
@@ -115,7 +117,8 @@
     }
   }
 
-  @Test(timeout = 1000)
+  @Test
+  @Timeout(value = 1000)
   public void testStackTrace() {
     final RaftPeerId id = RaftPeerId.valueOf("s0");
     final RaftPeer peer = RaftPeer.newBuilder().setId(id).build();
@@ -123,7 +126,7 @@
         final ExceptionProxy ignored = map.computeIfAbsent(peer).get()) {
     } catch (IOException e) {
       assertThrowable("closeProxy", e, AnnotatedConnectException.class, LOG, ConnectException.class);
-      Assert.assertEquals(0, e.getStackTrace().length);
+      Assertions.assertEquals(0, e.getStackTrace().length);
     }
   }
 }
diff --git a/ratis-test/src/test/java/org/apache/ratis/util/TestPreconditions.java b/ratis-test/src/test/java/org/apache/ratis/util/TestPreconditions.java
index 884c1e5..e99c11f 100644
--- a/ratis-test/src/test/java/org/apache/ratis/util/TestPreconditions.java
+++ b/ratis-test/src/test/java/org/apache/ratis/util/TestPreconditions.java
@@ -18,7 +18,8 @@
 package org.apache.ratis.util;
 
 import org.apache.ratis.BaseTest;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
 
 import java.util.Arrays;
 import java.util.Collections;
@@ -28,7 +29,8 @@
 import java.util.Set;
 
 public class TestPreconditions extends BaseTest {
-  @Test(timeout = 1000)
+  @Test
+  @Timeout(value = 1000)
   public void testAssertUnique() {
     final Set<Integer> empty = Collections.emptySet();
     Preconditions.assertUnique(empty);
@@ -53,7 +55,8 @@
     Preconditions.assertUnique(three, Arrays.asList(4, 5, 6));
   }
 
-  @Test(timeout = 1000)
+  @Test
+  @Timeout(value = 1000)
   public void testAssertNull() {
     final Map<String, String> map = new HashMap<>();
     final String key = "abc1234";
diff --git a/ratis-test/src/test/java/org/apache/ratis/util/TestReferenceCountedObject.java b/ratis-test/src/test/java/org/apache/ratis/util/TestReferenceCountedObject.java
index fe58b92..502261e 100644
--- a/ratis-test/src/test/java/org/apache/ratis/util/TestReferenceCountedObject.java
+++ b/ratis-test/src/test/java/org/apache/ratis/util/TestReferenceCountedObject.java
@@ -18,8 +18,9 @@
 package org.apache.ratis.util;
 
 import org.apache.ratis.util.function.UncheckedAutoCloseableSupplier;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
 
 import java.util.concurrent.atomic.AtomicInteger;
 
@@ -27,8 +28,8 @@
   static void assertValues(
       AtomicInteger retained, int expectedRetained,
       AtomicInteger released, int expectedReleased) {
-    Assert.assertEquals("retained", expectedRetained, retained.get());
-    Assert.assertEquals("released", expectedReleased, released.get());
+    Assertions.assertEquals(expectedRetained, retained.get(), "retained");
+    Assertions.assertEquals(expectedReleased, released.get(), "retained");
   }
 
   static void assertRelease(ReferenceCountedObject<?> ref,
@@ -36,10 +37,11 @@
       AtomicInteger released, int expectedReleased) {
     final boolean returned = ref.release();
     assertValues(retained, expectedRetained, released, expectedReleased);
-    Assert.assertEquals(expectedRetained == expectedReleased, returned);
+    Assertions.assertEquals(expectedRetained == expectedReleased, returned);
   }
 
-  @Test(timeout = 1000)
+  @Test
+  @Timeout(value = 1000)
   public void testWrap() {
     final String value = "testWrap";
     final AtomicInteger retained = new AtomicInteger();
@@ -50,19 +52,19 @@
     assertValues(retained, 0, released, 0);
     try {
       ref.get();
-      Assert.fail();
+      Assertions.fail();
     } catch (IllegalStateException e) {
       e.printStackTrace(System.out);
     }
     assertValues(retained, 0, released, 0);
 
-    Assert.assertEquals(value, ref.retain());
+    Assertions.assertEquals(value, ref.retain());
     assertValues(retained, 1, released, 0);
 
     try(UncheckedAutoCloseableSupplier<String> auto = ref.retainAndReleaseOnClose()) {
       final String got = auto.get();
-      Assert.assertEquals(value, got);
-      Assert.assertSame(got, auto.get()); // it should return the same object.
+      Assertions.assertEquals(value, got);
+      Assertions.assertSame(got, auto.get()); // it should return the same object.
       assertValues(retained, 2, released, 0);
     } catch (IllegalStateException e) {
       e.printStackTrace(System.out);
@@ -70,12 +72,12 @@
     assertValues(retained, 2, released, 1);
 
     final UncheckedAutoCloseableSupplier<String> notClosing = ref.retainAndReleaseOnClose();
-    Assert.assertEquals(value, notClosing.get());
+    Assertions.assertEquals(value, notClosing.get());
     assertValues(retained, 3, released, 1);
     assertRelease(ref, retained, 3, released, 2);
 
     final UncheckedAutoCloseableSupplier<String> auto = ref.retainAndReleaseOnClose();
-    Assert.assertEquals(value, auto.get());
+    Assertions.assertEquals(value, auto.get());
     assertValues(retained, 4, released, 2);
     auto.close();
     assertValues(retained, 4, released, 3);
@@ -87,59 +89,60 @@
 
     try {
       ref.get();
-      Assert.fail();
+      Assertions.fail();
     } catch (IllegalStateException e) {
       e.printStackTrace(System.out);
     }
 
     try {
       ref.retain();
-      Assert.fail();
+      Assertions.fail();
     } catch (IllegalStateException e) {
       e.printStackTrace(System.out);
     }
 
     try(UncheckedAutoCloseable ignore = ref.retainAndReleaseOnClose()) {
-      Assert.fail();
+      Assertions.fail();
     } catch (IllegalStateException e) {
       e.printStackTrace(System.out);
     }
 
     try {
       ref.release();
-      Assert.fail();
+      Assertions.fail();
     } catch (IllegalStateException e) {
       e.printStackTrace(System.out);
     }
   }
 
-  @Test(timeout = 1000)
+  @Test
+  @Timeout(value = 1000)
   public void testReleaseWithoutRetaining() {
     final ReferenceCountedObject<String> ref = ReferenceCountedObject.wrap("");
 
     try {
       ref.release();
-      Assert.fail();
+      Assertions.fail();
     } catch (IllegalStateException e) {
       e.printStackTrace(System.out);
     }
 
     try {
       ref.get();
-      Assert.fail();
+      Assertions.fail();
     } catch (IllegalStateException e) {
       e.printStackTrace(System.out);
     }
 
     try {
       ref.retain();
-      Assert.fail();
+      Assertions.fail();
     } catch (IllegalStateException e) {
       e.printStackTrace(System.out);
     }
 
     try(UncheckedAutoCloseable ignore = ref.retainAndReleaseOnClose()) {
-      Assert.fail();
+      Assertions.fail();
     } catch (IllegalStateException e) {
       e.printStackTrace(System.out);
     }
diff --git a/ratis-test/src/test/java/org/apache/ratis/util/TestResourceSemaphore.java b/ratis-test/src/test/java/org/apache/ratis/util/TestResourceSemaphore.java
index 6fe1aed..0f3612d 100644
--- a/ratis-test/src/test/java/org/apache/ratis/util/TestResourceSemaphore.java
+++ b/ratis-test/src/test/java/org/apache/ratis/util/TestResourceSemaphore.java
@@ -19,15 +19,17 @@
 
 import org.apache.ratis.BaseTest;
 import org.apache.ratis.RaftTestUtil;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
 
 import java.util.concurrent.TimeoutException;
 
 import static org.apache.ratis.util.ResourceSemaphore.Group.SUCCESS;
 
 public class TestResourceSemaphore extends BaseTest {
-  @Test(timeout = 5000)
+  @Test
+  @Timeout(value = 5000)
   public void testGroup() throws InterruptedException, TimeoutException {
     final int FAILED_IN_ELEMENT_LIMIT = 0;
     final int FAILED_IN_BYTE_SIZE_LIMIT = 1;
@@ -80,15 +82,15 @@
   }
 
   static void assertUsed(ResourceSemaphore.Group g, int... expected) {
-    Assert.assertEquals(expected.length, g.resourceSize());
+    Assertions.assertEquals(expected.length, g.resourceSize());
     for(int i = 0; i < expected.length; i++) {
-      Assert.assertEquals(expected[i], g.get(i).used());
+      Assertions.assertEquals(expected[i], g.get(i).used());
     }
   }
 
   static void assertAcquire(ResourceSemaphore.Group g, int expected, int... permits) {
     final int computed = g.tryAcquire(permits);
-    Assert.assertEquals(expected, computed);
+    Assertions.assertEquals(expected, computed);
   }
 
   static Runnable acquire(ResourceSemaphore.Group g, int... permits) {
diff --git a/ratis-test/src/test/java/org/apache/ratis/util/TestTimeDuration.java b/ratis-test/src/test/java/org/apache/ratis/util/TestTimeDuration.java
index a2c180d..f2d58f4 100644
--- a/ratis-test/src/test/java/org/apache/ratis/util/TestTimeDuration.java
+++ b/ratis-test/src/test/java/org/apache/ratis/util/TestTimeDuration.java
@@ -17,8 +17,9 @@
  */
 package org.apache.ratis.util;
 
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
 import org.slf4j.event.Level;
 
 import java.util.Arrays;
@@ -28,17 +29,18 @@
 
 import static org.apache.ratis.util.TimeDuration.Abbreviation;
 import static org.apache.ratis.util.TimeDuration.parse;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 public class TestTimeDuration {
   {
     Slf4jUtils.setLogLevel(TimeDuration.LOG, Level.DEBUG);
   }
 
-  @Test(timeout = 1000)
+  @Test
+  @Timeout(value = 1000)
   public void testAbbreviation() {
     Arrays.asList(TimeUnit.values())
         .forEach(a -> assertNotNull(Abbreviation.valueOf(a.name())));
@@ -51,10 +53,11 @@
     Arrays.asList(TimeUnit.values()).forEach(unit ->
         allSymbols.stream()
             .map(s -> "0" + s)
-            .forEach(s -> assertEquals(s, 0L, parse(s, unit))));
+            .forEach(s -> assertEquals(0L, parse(s, unit), s)));
   }
 
-  @Test(timeout = 1000)
+  @Test
+  @Timeout(value = 1000)
   public void testParse() {
     assertEquals(1L, parse("1_000_000 ns", TimeUnit.MILLISECONDS));
     assertEquals(10L, parse("10_000_000 nanos", TimeUnit.MILLISECONDS));
@@ -93,7 +96,8 @@
     assertEquals(2400, parse("100 days", TimeUnit.HOURS));
   }
 
-  @Test(timeout = 1000)
+  @Test
+  @Timeout(value = 1000)
   public void testRoundUp() {
     final long nanosPerSecond = 1_000_000_000L;
     final TimeDuration oneSecond = TimeDuration.valueOf(1, TimeUnit.SECONDS);
@@ -108,7 +112,8 @@
     assertEquals(2*nanosPerSecond, oneSecond.roundUpNanos(nanosPerSecond + 1));
   }
 
-  @Test(timeout = 1000)
+  @Test
+  @Timeout(value = 1000)
   public void testTo() {
     final TimeDuration oneSecond = TimeDuration.valueOf(1, TimeUnit.SECONDS);
     assertTo(1000, "1000ms", oneSecond, TimeUnit.MILLISECONDS);
@@ -131,7 +136,8 @@
     return computed;
   }
 
-  @Test(timeout = 1000)
+  @Test
+  @Timeout(value = 1000)
   public void testAddAndSubtract() {
     final TimeDuration oneSecond = TimeDuration.valueOf(1, TimeUnit.SECONDS);
     final TimeDuration tenSecond = TimeDuration.valueOf(10, TimeUnit.SECONDS);
@@ -184,28 +190,30 @@
     }
   }
 
-  @Test(timeout = 1000)
+  @Test
+  @Timeout(value = 1000)
   public void testNegate() {
     assertNegate(0);
     assertNegate(1);
     assertNegate(-1);
     assertNegate(Long.MAX_VALUE);
 
-    Assert.assertEquals(
+    Assertions.assertEquals(
         TimeDuration.valueOf(Long.MAX_VALUE, TimeUnit.SECONDS),
         TimeDuration.valueOf(Long.MIN_VALUE, TimeUnit.SECONDS).negate());
   }
 
   private static void assertNegate(long n) {
-    Assert.assertEquals(
+    Assertions.assertEquals(
         TimeDuration.valueOf(-n, TimeUnit.SECONDS),
         TimeDuration.valueOf(n, TimeUnit.SECONDS).negate());
-    Assert.assertEquals(
+    Assertions.assertEquals(
         TimeDuration.valueOf(n, TimeUnit.SECONDS),
         TimeDuration.valueOf(-n, TimeUnit.SECONDS).negate());
   }
 
-  @Test(timeout = 1000)
+  @Test
+  @Timeout(value = 1000)
   public void testMultiply() {
     assertMultiply(0, TimeDuration.ONE_SECOND, TimeDuration.valueOf(0, TimeUnit.SECONDS));
     assertMultiply(0.001, TimeDuration.ONE_SECOND, TimeDuration.ONE_MILLISECOND);
@@ -230,12 +238,13 @@
   private static void assertMultiply(TimeDuration t, double multiplier, TimeDuration expected) {
     final TimeDuration computed = t.multiply(multiplier);
     TimeDuration.LOG.info("assertMultiply: {} x {} = {} ?= {}\n\n", t, multiplier, computed, expected);
-    Assert.assertEquals(expected.getUnit(), computed.getUnit());
+    Assertions.assertEquals(expected.getUnit(), computed.getUnit());
     final long d = Math.abs(computed.getDuration() - expected.getDuration());
-    Assert.assertTrue(d <= Math.abs(expected.getDuration()) * TimeDuration.ERROR_THRESHOLD);
+    Assertions.assertTrue(d <= Math.abs(expected.getDuration()) * TimeDuration.ERROR_THRESHOLD);
   }
 
-  @Test(timeout = 1000)
+  @Test
+  @Timeout(value = 1000)
   public void testHigherLower() {
     final TimeUnit[] units = {TimeUnit.NANOSECONDS, TimeUnit.MICROSECONDS, TimeUnit.MILLISECONDS,
         TimeUnit.SECONDS, TimeUnit.MINUTES, TimeUnit.HOURS, TimeUnit.DAYS};
@@ -243,11 +252,12 @@
       assertHigherLower(units[i-1], units[i]);
     }
 
-    Assert.assertSame(TimeUnit.NANOSECONDS, TimeDuration.lowerUnit(TimeUnit.NANOSECONDS));
-    Assert.assertSame(TimeUnit.DAYS, TimeDuration.higherUnit(TimeUnit.DAYS));
+    Assertions.assertSame(TimeUnit.NANOSECONDS, TimeDuration.lowerUnit(TimeUnit.NANOSECONDS));
+    Assertions.assertSame(TimeUnit.DAYS, TimeDuration.higherUnit(TimeUnit.DAYS));
   }
 
-  @Test(timeout = 1000)
+  @Test
+  @Timeout(value = 1000)
   public void testCompareTo() {
     assertTimeDurationCompareTo(TimeDuration.ONE_MINUTE, TimeDuration.ONE_SECOND);
 
@@ -281,7 +291,7 @@
   }
 
   private static void assertHigherLower(TimeUnit lower, TimeUnit higher) {
-    Assert.assertSame(lower, TimeDuration.lowerUnit(higher));
-    Assert.assertSame(higher, TimeDuration.higherUnit(lower));
+    Assertions.assertSame(lower, TimeDuration.lowerUnit(higher));
+    Assertions.assertSame(higher, TimeDuration.higherUnit(lower));
   }
 }
diff --git a/ratis-test/src/test/java/org/apache/ratis/util/TestTimeoutScheduler.java b/ratis-test/src/test/java/org/apache/ratis/util/TestTimeoutScheduler.java
index 848428f..79c97a6 100644
--- a/ratis-test/src/test/java/org/apache/ratis/util/TestTimeoutScheduler.java
+++ b/ratis-test/src/test/java/org/apache/ratis/util/TestTimeoutScheduler.java
@@ -18,8 +18,9 @@
 package org.apache.ratis.util;
 
 import org.apache.ratis.BaseTest;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
 import org.slf4j.event.Level;
 
 import java.util.concurrent.TimeUnit;
@@ -41,52 +42,54 @@
     }
 
     void assertNoError() {
-      Assert.assertFalse(hasError.get());
+      Assertions.assertFalse(hasError.get());
     }
   }
 
-  @Test(timeout = 1000)
+  @Test
+  @Timeout(value = 1000)
   public void testSingleTask() throws Exception {
     final TimeoutScheduler scheduler = TimeoutScheduler.newInstance();
     final TimeDuration grace = TimeDuration.valueOf(100, TimeUnit.MILLISECONDS);
     scheduler.setGracePeriod(grace);
-    Assert.assertFalse(scheduler.hasScheduler());
+    Assertions.assertFalse(scheduler.hasScheduler());
 
     final ErrorHandler errorHandler = new ErrorHandler();
 
     final AtomicBoolean fired = new AtomicBoolean(false);
     scheduler.onTimeout(TimeDuration.valueOf(250, TimeUnit.MILLISECONDS), () -> {
-      Assert.assertFalse(fired.get());
+      Assertions.assertFalse(fired.get());
       fired.set(true);
     }, errorHandler);
-    Assert.assertTrue(scheduler.hasScheduler());
+    Assertions.assertTrue(scheduler.hasScheduler());
 
     Thread.sleep(100);
-    Assert.assertFalse(fired.get());
-    Assert.assertTrue(scheduler.hasScheduler());
+    Assertions.assertFalse(fired.get());
+    Assertions.assertTrue(scheduler.hasScheduler());
 
     Thread.sleep(100);
-    Assert.assertFalse(fired.get());
-    Assert.assertTrue(scheduler.hasScheduler());
+    Assertions.assertFalse(fired.get());
+    Assertions.assertTrue(scheduler.hasScheduler());
 
     Thread.sleep(100);
-    Assert.assertTrue(fired.get());
-    Assert.assertTrue(scheduler.hasScheduler());
+    Assertions.assertTrue(fired.get());
+    Assertions.assertTrue(scheduler.hasScheduler());
 
     Thread.sleep(100);
-    Assert.assertTrue(fired.get());
-    Assert.assertFalse(scheduler.hasScheduler());
+    Assertions.assertTrue(fired.get());
+    Assertions.assertFalse(scheduler.hasScheduler());
 
     errorHandler.assertNoError();
     scheduler.setGracePeriod(grace);
   }
 
-  @Test(timeout = 1000)
+  @Test
+  @Timeout(value = 1000)
   public void testMultipleTasks() throws Exception {
     final TimeoutScheduler scheduler = TimeoutScheduler.newInstance();
     final TimeDuration grace = TimeDuration.valueOf(100, TimeUnit.MILLISECONDS);
     scheduler.setGracePeriod(grace);
-    Assert.assertFalse(scheduler.hasScheduler());
+    Assertions.assertFalse(scheduler.hasScheduler());
 
     final ErrorHandler errorHandler = new ErrorHandler();
 
@@ -94,126 +97,129 @@
     for(int i = 0; i < fired.length; i++) {
       final AtomicBoolean f = fired[i] = new AtomicBoolean(false);
       scheduler.onTimeout(TimeDuration.valueOf(100*i + 50, TimeUnit.MILLISECONDS), () -> {
-        Assert.assertFalse(f.get());
+        Assertions.assertFalse(f.get());
         f.set(true);
       }, errorHandler);
-      Assert.assertTrue(scheduler.hasScheduler());
+      Assertions.assertTrue(scheduler.hasScheduler());
     }
 
     Thread.sleep(100);
-    Assert.assertTrue(fired[0].get());
-    Assert.assertFalse(fired[1].get());
-    Assert.assertFalse(fired[2].get());
-    Assert.assertTrue(scheduler.hasScheduler());
+    Assertions.assertTrue(fired[0].get());
+    Assertions.assertFalse(fired[1].get());
+    Assertions.assertFalse(fired[2].get());
+    Assertions.assertTrue(scheduler.hasScheduler());
 
     Thread.sleep(100);
-    Assert.assertTrue(fired[0].get());
-    Assert.assertTrue(fired[1].get());
-    Assert.assertFalse(fired[2].get());
-    Assert.assertTrue(scheduler.hasScheduler());
+    Assertions.assertTrue(fired[0].get());
+    Assertions.assertTrue(fired[1].get());
+    Assertions.assertFalse(fired[2].get());
+    Assertions.assertTrue(scheduler.hasScheduler());
 
     Thread.sleep(100);
-    Assert.assertTrue(fired[0].get());
-    Assert.assertTrue(fired[1].get());
-    Assert.assertTrue(fired[2].get());
-    Assert.assertTrue(scheduler.hasScheduler());
+    Assertions.assertTrue(fired[0].get());
+    Assertions.assertTrue(fired[1].get());
+    Assertions.assertTrue(fired[2].get());
+    Assertions.assertTrue(scheduler.hasScheduler());
 
     Thread.sleep(100);
-    Assert.assertTrue(fired[0].get());
-    Assert.assertTrue(fired[1].get());
-    Assert.assertTrue(fired[2].get());
-    Assert.assertFalse(scheduler.hasScheduler());
+    Assertions.assertTrue(fired[0].get());
+    Assertions.assertTrue(fired[1].get());
+    Assertions.assertTrue(fired[2].get());
+    Assertions.assertFalse(scheduler.hasScheduler());
 
     errorHandler.assertNoError();
   }
 
-  @Test(timeout = 1000)
+  @Test
+  @Timeout(value = 1000)
   public void testExtendingGracePeriod() throws Exception {
     final TimeoutScheduler scheduler = TimeoutScheduler.newInstance();
     final TimeDuration grace = TimeDuration.valueOf(100, TimeUnit.MILLISECONDS);
     scheduler.setGracePeriod(grace);
-    Assert.assertFalse(scheduler.hasScheduler());
+    Assertions.assertFalse(scheduler.hasScheduler());
 
     final ErrorHandler errorHandler = new ErrorHandler();
 
     {
       final AtomicBoolean fired = new AtomicBoolean(false);
       scheduler.onTimeout(TimeDuration.valueOf(150, TimeUnit.MILLISECONDS), () -> {
-        Assert.assertFalse(fired.get());
+        Assertions.assertFalse(fired.get());
         fired.set(true);
       }, errorHandler);
-      Assert.assertTrue(scheduler.hasScheduler());
+      Assertions.assertTrue(scheduler.hasScheduler());
 
       Thread.sleep(100);
-      Assert.assertFalse(fired.get());
-      Assert.assertTrue(scheduler.hasScheduler());
+      Assertions.assertFalse(fired.get());
+      Assertions.assertTrue(scheduler.hasScheduler());
 
       Thread.sleep(100);
-      Assert.assertTrue(fired.get());
-      Assert.assertTrue(scheduler.hasScheduler());
+      Assertions.assertTrue(fired.get());
+      Assertions.assertTrue(scheduler.hasScheduler());
     }
 
     {
       // submit another task during grace period
       final AtomicBoolean fired2 = new AtomicBoolean(false);
       scheduler.onTimeout(TimeDuration.valueOf(150, TimeUnit.MILLISECONDS), () -> {
-        Assert.assertFalse(fired2.get());
+        Assertions.assertFalse(fired2.get());
         fired2.set(true);
       }, errorHandler);
 
       Thread.sleep(100);
-      Assert.assertFalse(fired2.get());
-      Assert.assertTrue(scheduler.hasScheduler());
+      Assertions.assertFalse(fired2.get());
+      Assertions.assertTrue(scheduler.hasScheduler());
 
       Thread.sleep(100);
-      Assert.assertTrue(fired2.get());
-      Assert.assertTrue(scheduler.hasScheduler());
+      Assertions.assertTrue(fired2.get());
+      Assertions.assertTrue(scheduler.hasScheduler());
 
       Thread.sleep(100);
-      Assert.assertTrue(fired2.get());
-      Assert.assertFalse(scheduler.hasScheduler());
+      Assertions.assertTrue(fired2.get());
+      Assertions.assertFalse(scheduler.hasScheduler());
     }
 
     errorHandler.assertNoError();
   }
 
-  @Test(timeout = 1000)
+  @Test
+  @Timeout(value = 1000)
   public void testRestartingScheduler() throws Exception {
     final TimeoutScheduler scheduler = TimeoutScheduler.newInstance();
     final TimeDuration grace = TimeDuration.valueOf(100, TimeUnit.MILLISECONDS);
     scheduler.setGracePeriod(grace);
-    Assert.assertFalse(scheduler.hasScheduler());
+    Assertions.assertFalse(scheduler.hasScheduler());
 
     final ErrorHandler errorHandler = new ErrorHandler();
 
     for(int i = 0; i < 2; i++) {
       final AtomicBoolean fired = new AtomicBoolean(false);
       scheduler.onTimeout(TimeDuration.valueOf(150, TimeUnit.MILLISECONDS), () -> {
-        Assert.assertFalse(fired.get());
+        Assertions.assertFalse(fired.get());
         fired.set(true);
       }, errorHandler);
-      Assert.assertTrue(scheduler.hasScheduler());
+      Assertions.assertTrue(scheduler.hasScheduler());
 
       Thread.sleep(100);
-      Assert.assertFalse(fired.get());
-      Assert.assertTrue(scheduler.hasScheduler());
+      Assertions.assertFalse(fired.get());
+      Assertions.assertTrue(scheduler.hasScheduler());
 
       Thread.sleep(100);
-      Assert.assertTrue(fired.get());
-      Assert.assertTrue(scheduler.hasScheduler());
+      Assertions.assertTrue(fired.get());
+      Assertions.assertTrue(scheduler.hasScheduler());
 
       Thread.sleep(100);
-      Assert.assertTrue(fired.get());
-      Assert.assertFalse(scheduler.hasScheduler());
+      Assertions.assertTrue(fired.get());
+      Assertions.assertFalse(scheduler.hasScheduler());
     }
 
     errorHandler.assertNoError();
   }
 
-  @Test(timeout = 10_000)
+  @Test
+  @Timeout(value = 10_000)
   public void testShutdown() throws Exception {
     final TimeoutScheduler scheduler = TimeoutScheduler.newInstance();
-    Assert.assertEquals(TimeoutScheduler.DEFAULT_GRACE_PERIOD, scheduler.getGracePeriod());
+    Assertions.assertEquals(TimeoutScheduler.DEFAULT_GRACE_PERIOD, scheduler.getGracePeriod());
     final ErrorHandler errorHandler = new ErrorHandler();
 
     final int numTasks = 100;
@@ -223,7 +229,7 @@
     }
     HUNDRED_MILLIS.sleep();
     HUNDRED_MILLIS.sleep();
-    JavaUtils.attempt(() -> Assert.assertEquals(1, scheduler.getTaskCount()),
+    JavaUtils.attempt(() -> Assertions.assertEquals(1, scheduler.getTaskCount()),
         10, HUNDRED_MILLIS, "only 1 shutdown task is scheduled", LOG);
 
     final TimeDuration oneMillis = TimeDuration.valueOf(1, TimeUnit.MILLISECONDS);
@@ -234,7 +240,7 @@
       oneMillis.sleep();
     }
     HUNDRED_MILLIS.sleep();
-    JavaUtils.attempt(() -> Assert.assertEquals(1, scheduler.getTaskCount()),
+    JavaUtils.attempt(() -> Assertions.assertEquals(1, scheduler.getTaskCount()),
         10, HUNDRED_MILLIS, "only 1 shutdown task is scheduled", LOG);
 
     errorHandler.assertNoError();
diff --git a/ratis-test/src/test/java/org/apache/ratis/util/TestTraditionalBinaryPrefix.java b/ratis-test/src/test/java/org/apache/ratis/util/TestTraditionalBinaryPrefix.java
index 8b6b7a3..988cc5c 100644
--- a/ratis-test/src/test/java/org/apache/ratis/util/TestTraditionalBinaryPrefix.java
+++ b/ratis-test/src/test/java/org/apache/ratis/util/TestTraditionalBinaryPrefix.java
@@ -17,15 +17,18 @@
  */
 package org.apache.ratis.util;
 
-import org.junit.Test;
+
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
 
 import static org.apache.ratis.util.TraditionalBinaryPrefix.long2String;
 import static org.apache.ratis.util.TraditionalBinaryPrefix.string2long;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.fail;
 
 public class TestTraditionalBinaryPrefix {
-  @Test(timeout = 1000)
+  @Test
+  @Timeout(value = 1000)
   public void testTraditionalBinaryPrefix() {
     //test string2long(..)
     String[] symbol = {"k", "m", "g", "t", "p", "e"};
@@ -108,19 +111,19 @@
         { // n = 2^e
           final long n = 1L << e;
           final String expected = (n/p.getValue()) + " " + p.getSymbol();
-          assertEquals("n=" + n, expected, long2String(n, null, 2));
+          assertEquals(expected, long2String(n, null, 2), "n=" + n);
         }
 
         { // n = 2^e + 1
           final long n = (1L << e) + 1;
           final String expected = (n/p.getValue()) + trailingZeros + p.getSymbol();
-          assertEquals("n=" + n, expected, long2String(n, null, decimalPlace));
+          assertEquals(expected, long2String(n, null, decimalPlace), "n=" + n);
         }
 
         { // n = 2^e - 1
           final long n = (1L << e) - 1;
           final String expected = ((n+1)/p.getValue()) + trailingZeros + p.getSymbol();
-          assertEquals("n=" + n, expected, long2String(n, null, decimalPlace));
+          assertEquals(expected, long2String(n, null, decimalPlace), "n=" + n);
         }
       }
     }
@@ -143,7 +146,8 @@
     return long2String(len, "B", 2);
   }
 
-  @Test(timeout = 1000)
+  @Test
+  @Timeout(value = 1000)
   public void testUnderscore() {
     final SizeInBytes value = SizeInBytes.valueOf("1_000_000_000_000_000");
     assertEquals(1_000_000_000_000_000L, value.getSize());