akka.actor.provider set to 'cluster'
[controller.git] / opendaylight / md-sal / sal-remoterpc-connector / src / test / java / org / opendaylight / controller / remote / rpc / registry / mbeans / RemoteRpcRegistryMXBeanImplTest.java
index 5ea18d2cb66c274b9aece6762ee10fa60a37b55b..282b7b5ee49371df7884a9002f5e50c581e8efec 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.controller.remote.rpc.registry.mbeans;
 
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.hamcrest.MatcherAssert.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
@@ -19,6 +21,7 @@ import akka.testkit.TestActorRef;
 import akka.testkit.javadsl.TestKit;
 import akka.util.Timeout;
 import com.google.common.collect.Lists;
+import com.typesafe.config.ConfigFactory;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
@@ -33,13 +36,10 @@ import org.opendaylight.controller.remote.rpc.registry.gossip.BucketStoreAccess;
 import org.opendaylight.mdsal.dom.api.DOMRpcIdentifier;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-import org.opendaylight.yangtools.yang.model.api.SchemaPath;
 
 public class RemoteRpcRegistryMXBeanImplTest {
-
     private static final QName LOCAL_QNAME = QName.create("base", "local");
-    private static final SchemaPath EMPTY_SCHEMA_PATH = SchemaPath.ROOT;
-    private static final SchemaPath LOCAL_SCHEMA_PATH = SchemaPath.create(true, LOCAL_QNAME);
+    private static final QName REMOTE_QNAME = QName.create("base", "remote");
 
     private ActorSystem system;
     private TestActorRef<RpcRegistry> testActor;
@@ -48,12 +48,12 @@ public class RemoteRpcRegistryMXBeanImplTest {
 
     @Before
     public void setUp() {
-        system = ActorSystem.create("test");
+        system = ActorSystem.create("test", ConfigFactory.load().getConfig("unit-test"));
 
         final DOMRpcIdentifier emptyRpcIdentifier = DOMRpcIdentifier.create(
-                EMPTY_SCHEMA_PATH, YangInstanceIdentifier.EMPTY);
+                REMOTE_QNAME, YangInstanceIdentifier.empty());
         final DOMRpcIdentifier localRpcIdentifier = DOMRpcIdentifier.create(
-                LOCAL_SCHEMA_PATH, YangInstanceIdentifier.of(LOCAL_QNAME));
+                LOCAL_QNAME, YangInstanceIdentifier.of(LOCAL_QNAME));
 
         buckets = Lists.newArrayList(emptyRpcIdentifier, localRpcIdentifier);
 
@@ -92,7 +92,7 @@ public class RemoteRpcRegistryMXBeanImplTest {
         assertEquals(1, globalRpc.size());
 
         final String rpc = globalRpc.iterator().next();
-        assertEquals(EMPTY_SCHEMA_PATH.toString(), rpc);
+        assertEquals(REMOTE_QNAME.toString(), rpc);
     }
 
     @Test
@@ -112,8 +112,7 @@ public class RemoteRpcRegistryMXBeanImplTest {
         assertEquals(1, localRegisteredRoutedRpc.size());
 
         final String localRpc = localRegisteredRoutedRpc.iterator().next();
-        assertTrue(localRpc.contains(LOCAL_QNAME.toString()));
-        assertTrue(localRpc.contains(LOCAL_SCHEMA_PATH.toString()));
+        assertThat(localRpc, containsString(LOCAL_QNAME.toString()));
     }
 
     @Test