Use assertTrue/assertFalse in SnapshotManagerTest 66/93266/1
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 22 Oct 2020 18:57:19 +0000 (20:57 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 22 Oct 2020 18:57:19 +0000 (20:57 +0200)
This prevents boxing while retaining intent.

Change-Id: I6818c3197ae3a1800768d0d43fc669bee8232adb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/SnapshotManagerTest.java

index 3133c5b..9463a11 100644 (file)
@@ -114,7 +114,7 @@ public class SnapshotManagerTest extends AbstractActorTest {
 
     @Test
     public void testConstruction() {
-        assertEquals(false, snapshotManager.isCapturing());
+        assertFalse(snapshotManager.isCapturing());
     }
 
     @SuppressWarnings({ "unchecked", "rawtypes" })
@@ -125,7 +125,7 @@ public class SnapshotManagerTest extends AbstractActorTest {
         snapshotManager.captureToInstall(new SimpleReplicatedLogEntry(0, 1,
                 new MockRaftActorContext.MockPayload()), 0, "follower-1");
 
-        assertEquals(true, snapshotManager.isCapturing());
+        assertTrue(snapshotManager.isCapturing());
 
         ArgumentCaptor<Optional> outputStream = ArgumentCaptor.forClass(Optional.class);
         verify(mockProcedure).accept(outputStream.capture());
@@ -155,7 +155,7 @@ public class SnapshotManagerTest extends AbstractActorTest {
 
         assertTrue(capture);
 
-        assertEquals(true, snapshotManager.isCapturing());
+        assertTrue(snapshotManager.isCapturing());
 
         ArgumentCaptor<Optional> outputStream = ArgumentCaptor.forClass(Optional.class);
         verify(mockProcedure).accept(outputStream.capture());
@@ -185,7 +185,7 @@ public class SnapshotManagerTest extends AbstractActorTest {
 
         assertTrue(capture);
 
-        assertEquals(true, snapshotManager.isCapturing());
+        assertTrue(snapshotManager.isCapturing());
 
         ArgumentCaptor<Optional> outputStream = ArgumentCaptor.forClass(Optional.class);
         verify(mockProcedure).accept(outputStream.capture());
@@ -216,7 +216,7 @@ public class SnapshotManagerTest extends AbstractActorTest {
 
         assertFalse(capture);
 
-        assertEquals(false, snapshotManager.isCapturing());
+        assertFalse(snapshotManager.isCapturing());
 
         verify(mockProcedure).accept(any());
     }
@@ -382,7 +382,7 @@ public class SnapshotManagerTest extends AbstractActorTest {
 
         snapshotManager.persist(snapshotState, installSnapshotStream, Runtime.getRuntime().totalMemory());
 
-        assertEquals(true, snapshotManager.isCapturing());
+        assertTrue(snapshotManager.isCapturing());
 
         verify(mockDataPersistenceProvider).saveSnapshot(any(Snapshot.class));
 
@@ -435,11 +435,11 @@ public class SnapshotManagerTest extends AbstractActorTest {
 
         snapshotManager.persist(ByteState.empty(), Optional.empty(), Runtime.getRuntime().totalMemory());
 
-        assertEquals(true, snapshotManager.isCapturing());
+        assertTrue(snapshotManager.isCapturing());
 
         snapshotManager.commit(100L, 1234L);
 
-        assertEquals(false, snapshotManager.isCapturing());
+        assertFalse(snapshotManager.isCapturing());
 
         verify(mockReplicatedLog).snapshotCommit();
 
@@ -616,7 +616,7 @@ public class SnapshotManagerTest extends AbstractActorTest {
 
         assertTrue(capture);
 
-        assertEquals(true, snapshotManager.isCapturing());
+        assertTrue(snapshotManager.isCapturing());
 
         snapshotManager.trimLog(10);
 
@@ -631,7 +631,7 @@ public class SnapshotManagerTest extends AbstractActorTest {
 
         assertTrue(capture);
 
-        assertEquals(true, snapshotManager.isCapturing());
+        assertTrue(snapshotManager.isCapturing());
 
         snapshotManager.trimLog(10);
 

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.