Leader should always apply modifications as local
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / test / java / org / opendaylight / controller / cluster / datastore / actors / ShardSnapshotActorTest.java
index 4ba5e02f33b66d38b90995646672fdbff81267af..6a0def0901ac70d413af19e201793fb4311d75b8 100644 (file)
@@ -16,6 +16,7 @@ import akka.testkit.javadsl.TestKit;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.ObjectInputStream;
+import java.time.Duration;
 import java.util.Optional;
 import org.junit.Test;
 import org.opendaylight.controller.cluster.datastore.AbstractActorTest;
@@ -42,7 +43,7 @@ public class ShardSnapshotActorTest extends AbstractActorTest {
         ShardSnapshotActor.requestSnapshot(snapshotActor, snapshot,
             Optional.ofNullable(installSnapshotStream), kit.getRef());
 
-        final CaptureSnapshotReply reply = kit.expectMsgClass(kit.duration("3 seconds"), CaptureSnapshotReply.class);
+        final CaptureSnapshotReply reply = kit.expectMsgClass(Duration.ofSeconds(3), CaptureSnapshotReply.class);
         assertNotNull("getSnapshotState is null", reply.getSnapshotState());
         assertEquals("SnapshotState type", ShardSnapshotState.class, reply.getSnapshotState().getClass());
         assertEquals("Snapshot", snapshot, ((ShardSnapshotState)reply.getSnapshotState()).getSnapshot());
@@ -51,7 +52,7 @@ public class ShardSnapshotActorTest extends AbstractActorTest {
             final ShardDataTreeSnapshot deserialized;
             try (ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(
                 installSnapshotStream.toByteArray()))) {
-                deserialized = ShardDataTreeSnapshot.deserialize(in);
+                deserialized = ShardDataTreeSnapshot.deserialize(in).getSnapshot();
             }
 
             assertEquals("Deserialized snapshot type", snapshot.getClass(), deserialized.getClass());