X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fcds-access-client%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Faccess%2Fclient%2FClientActorContextTest.java;h=7df1c2f045d98fcdfa87f37c71165462d0e2d5eb;hb=refs%2Fchanges%2F49%2F78449%2F2;hp=3ecc68bdb45b3f30314573893a4a622c3fc2561b;hpb=b2ed560507ad550be22a84ebd60ad4edc14cea7d;p=controller.git diff --git a/opendaylight/md-sal/cds-access-client/src/test/java/org/opendaylight/controller/cluster/access/client/ClientActorContextTest.java b/opendaylight/md-sal/cds-access-client/src/test/java/org/opendaylight/controller/cluster/access/client/ClientActorContextTest.java index 3ecc68bdb4..7df1c2f045 100644 --- a/opendaylight/md-sal/cds-access-client/src/test/java/org/opendaylight/controller/cluster/access/client/ClientActorContextTest.java +++ b/opendaylight/md-sal/cds-access-client/src/test/java/org/opendaylight/controller/cluster/access/client/ClientActorContextTest.java @@ -10,8 +10,8 @@ package org.opendaylight.controller.cluster.access.client; import static org.junit.Assert.assertSame; import akka.actor.ActorSystem; -import akka.testkit.JavaTestKit; import akka.testkit.TestProbe; +import akka.testkit.javadsl.TestKit; import com.google.common.base.Ticker; import java.util.concurrent.TimeUnit; import org.junit.After; @@ -23,7 +23,6 @@ import org.opendaylight.controller.cluster.access.concepts.ClientIdentifier; import org.opendaylight.controller.cluster.access.concepts.FrontendIdentifier; import org.opendaylight.controller.cluster.access.concepts.FrontendType; import org.opendaylight.controller.cluster.access.concepts.MemberName; -import scala.concurrent.duration.Duration; import scala.concurrent.duration.FiniteDuration; public class ClientActorContextTest { @@ -45,8 +44,8 @@ public class ClientActorContextTest { MockitoAnnotations.initMocks(this); system = ActorSystem.apply(); probe = new TestProbe(system); - ctx = new ClientActorContext(probe.ref(), system.scheduler(), system.dispatcher(), - PERSISTENCE_ID, CLIENT_ID); + ctx = new ClientActorContext(probe.ref(), PERSISTENCE_ID, system, + CLIENT_ID, AccessClientUtil.newMockClientActorConfig()); } @Test @@ -62,20 +61,19 @@ public class ClientActorContextTest { } @Test - public void testExecuteInActor() throws Exception { + public void testExecuteInActor() { ctx.executeInActor(command); probe.expectMsg(command); } @Test - public void testExecuteInActorScheduled() throws Exception { - final FiniteDuration delay = Duration.apply(1, TimeUnit.SECONDS); - ctx.executeInActor(command, delay); + public void testExecuteInActorScheduled() { + ctx.executeInActor(command, FiniteDuration.create(1, TimeUnit.SECONDS)); probe.expectMsg(command); } @After - public void tearDown() throws Exception { - JavaTestKit.shutdownActorSystem(system); + public void tearDown() { + TestKit.shutdownActorSystem(system); } }