X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FRoleChangeNotifierTest.java;h=bec679c16327789106d0f8938166f6c80bf0836c;hb=4f1f2ae598588f6aa5aac59b2206d97ad402a193;hp=086bc3f0ad1512b4232a43085c3267076d2b4cb3;hpb=c3ea6ff9c64bcd51e46767a18a1370a2b3819dca;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/RoleChangeNotifierTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/RoleChangeNotifierTest.java index 086bc3f0ad..bec679c163 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/RoleChangeNotifierTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/RoleChangeNotifierTest.java @@ -17,7 +17,6 @@ import akka.actor.Props; import akka.testkit.JavaTestKit; import akka.testkit.TestActorRef; import org.junit.Test; -import org.opendaylight.controller.cluster.datastore.utils.MessageCollectorActor; import org.opendaylight.controller.cluster.notifications.LeaderStateChanged; import org.opendaylight.controller.cluster.notifications.RegisterRoleChangeListener; import org.opendaylight.controller.cluster.notifications.RegisterRoleChangeListenerReply; @@ -25,6 +24,7 @@ import org.opendaylight.controller.cluster.notifications.RoleChangeNotification; import org.opendaylight.controller.cluster.notifications.RoleChangeNotifier; import org.opendaylight.controller.cluster.notifications.RoleChanged; import org.opendaylight.controller.cluster.raft.RaftState; +import org.opendaylight.controller.cluster.raft.utils.MessageCollectorActor; public class RoleChangeNotifierTest extends AbstractActorTest { @@ -39,11 +39,11 @@ public class RoleChangeNotifierTest extends AbstractActorTest { notifierTestActorRef.tell(new RegisterRoleChangeListener(), listenerActor); - RegisterRoleChangeListenerReply reply = (RegisterRoleChangeListenerReply) + RegisterRoleChangeListenerReply reply = MessageCollectorActor.getFirstMatching(listenerActor, RegisterRoleChangeListenerReply.class); assertNotNull(reply); - RoleChangeNotification notification = (RoleChangeNotification) + RoleChangeNotification notification = MessageCollectorActor.getFirstMatching(listenerActor, RoleChangeNotification.class); assertNull(notification); }}; @@ -68,11 +68,11 @@ public class RoleChangeNotifierTest extends AbstractActorTest { // listener registers after role has been changed, ensure we sent the latest role change after a reply notifierTestActorRef.tell(new RegisterRoleChangeListener(), listenerActor); - RegisterRoleChangeListenerReply reply = (RegisterRoleChangeListenerReply) + RegisterRoleChangeListenerReply reply = MessageCollectorActor.getFirstMatching(listenerActor, RegisterRoleChangeListenerReply.class); assertNotNull(reply); - RoleChangeNotification notification = (RoleChangeNotification) + RoleChangeNotification notification = MessageCollectorActor.getFirstMatching(listenerActor, RoleChangeNotification.class); assertNotNull(notification); assertEquals(RaftState.Candidate.name(), notification.getOldRole());