import akka.actor.Status.Failure;
import akka.actor.Terminated;
import akka.testkit.javadsl.TestKit;
+import java.time.Duration;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.opendaylight.controller.cluster.raft.client.messages.GetSnapshotReply;
import org.opendaylight.controller.cluster.raft.persisted.ByteState;
import org.opendaylight.controller.cluster.raft.persisted.Snapshot;
-import scala.concurrent.duration.Duration;
import scala.concurrent.duration.FiniteDuration;
/**
TestKit kit = new TestKit(getSystem());
List<String> shardList = Arrays.asList("shard1", "shard2", "shard3");
- ShardManagerSnapshot shardManagerSnapshot = new ShardManagerSnapshot(shardList, Collections.emptyMap());
+ ShardManagerSnapshot shardManagerSnapshot = new ShardManagerSnapshot(shardList);
ActorRef replyActor = getSystem().actorOf(ShardManagerGetSnapshotReplyActor.props(
shardList, "config", shardManagerSnapshot, kit.getRef(),
- "shard-manager", Duration.create(100, TimeUnit.SECONDS)), "testSuccess");
+ "shard-manager", FiniteDuration.create(100, TimeUnit.SECONDS)), "testSuccess");
kit.watch(replyActor);
Snapshot.create(shard2SnapshotState, Collections.<ReplicatedLogEntry>emptyList(),
2, 1, 2, 1, 1, "member-1", null)), ActorRef.noSender());
- kit.expectNoMessage(FiniteDuration.create(500, TimeUnit.MILLISECONDS));
+ kit.expectNoMessage(Duration.ofMillis(500));
ByteState shard3SnapshotState = ByteState.of(new byte[]{7,8,9});
replyActor.tell(new GetSnapshotReply(ShardIdentifier.create("shard3", MEMBER_1, "config").toString(),
ActorRef replyActor = getSystem().actorOf(ShardManagerGetSnapshotReplyActor.props(
Arrays.asList("shard1", "shard2"), "config", null, kit.getRef(), "shard-manager",
- Duration.create(100, TimeUnit.SECONDS)), "testGetSnapshotFailureReply");
+ FiniteDuration.create(100, TimeUnit.SECONDS)), "testGetSnapshotFailureReply");
kit.watch(replyActor);
ActorRef replyActor = getSystem().actorOf(ShardManagerGetSnapshotReplyActor.props(
Arrays.asList("shard1"), "config", null, kit.getRef(), "shard-manager",
- Duration.create(100, TimeUnit.MILLISECONDS)), "testGetSnapshotTimeout");
+ FiniteDuration.create(100, TimeUnit.MILLISECONDS)), "testGetSnapshotTimeout");
kit.watch(replyActor);