X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fcds-access-client%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Faccess%2Fclient%2FClientActorContextTest.java;h=1eca0b563d2c47a240a6fd8a620c7f195c5d2568;hp=4dcbccbfb859d030b8313c3480c614a7302c4d4d;hb=94814a5aaa12aa5d72a7b98042d0d48bbcd92fc6;hpb=e9fc7e7ed2b13d274518d6a872ab67749ef4507a 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 4dcbccbfb8..1eca0b563d 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 @@ -17,15 +17,16 @@ import java.util.concurrent.TimeUnit; import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.junit.runner.RunWith; import org.mockito.Mock; -import org.mockito.MockitoAnnotations; +import org.mockito.junit.MockitoJUnitRunner; 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; +@RunWith(MockitoJUnitRunner.class) public class ClientActorContextTest { private static final MemberName MEMBER_NAME = MemberName.forName("member-1"); private static final FrontendType FRONTEND_TYPE = @@ -42,7 +43,6 @@ public class ClientActorContextTest { @Before public void setup() { - MockitoAnnotations.initMocks(this); system = ActorSystem.apply(); probe = new TestProbe(system); ctx = new ClientActorContext(probe.ref(), PERSISTENCE_ID, system, @@ -62,20 +62,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 { + public void tearDown() { TestKit.shutdownActorSystem(system); } }