Fix warnings in sal-akka-raft test classes
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / test / java / org / opendaylight / controller / cluster / raft / SnapshotTest.java
index a0b9cd5ee1898b99ce0ab4fe26bedf49d970ce15..88cb0d3167327f19a4fc1966bdf5fc0b0add4523 100644 (file)
@@ -9,6 +9,7 @@ package org.opendaylight.controller.cluster.raft;
 
 import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
+
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.IOException;
@@ -29,7 +30,7 @@ public class SnapshotTest {
     @Test
     public void testBackwardsCompatibleDeserializationFromLithium() throws Exception {
         Snapshot expSnapshot = newLithiumSnapshot();
-        try(FileInputStream fis = new FileInputStream("src/test/resources/lithium-serialized-Snapshot")) {
+        try (FileInputStream fis = new FileInputStream("src/test/resources/lithium-serialized-Snapshot")) {
             ObjectInputStream ois = new ObjectInputStream(fis);
 
             Snapshot snapshot = (Snapshot) ois.readObject();
@@ -39,7 +40,8 @@ public class SnapshotTest {
             assertEquals("lastTerm", expSnapshot.getLastTerm(), snapshot.getLastTerm());
             assertEquals("lastAppliedIndex", expSnapshot.getLastAppliedIndex(), snapshot.getLastAppliedIndex());
             assertEquals("lastAppliedTerm", expSnapshot.getLastAppliedTerm(), snapshot.getLastAppliedTerm());
-            assertEquals("unAppliedEntries size", expSnapshot.getUnAppliedEntries().size(), snapshot.getUnAppliedEntries().size());
+            assertEquals("unAppliedEntries size", expSnapshot.getUnAppliedEntries().size(),
+                    snapshot.getUnAppliedEntries().size());
             assertArrayEquals("state", expSnapshot.getState(), snapshot.getState());
             assertEquals("electionTerm", 0, snapshot.getElectionTerm());
             assertEquals("electionVotedFor", null, snapshot.getElectionVotedFor());
@@ -62,6 +64,7 @@ public class SnapshotTest {
      * Use this method to generate a file with a serialized Snapshot instance to be
      * used in tests that verify backwards compatible de-serialization.
      */
+    @SuppressWarnings("unused")
     private static void generateSerializedFile(Snapshot snapshot, String fileName) throws IOException {
         FileOutputStream fos = new FileOutputStream("src/test/resources/" + fileName);
         ObjectOutputStream oos = new ObjectOutputStream(fos);