Refactor Register*ListenerReply classes 76/55176/2
authorTom Pantelis <tompantelis@gmail.com>
Tue, 18 Apr 2017 06:32:37 +0000 (02:32 -0400)
committerTom Pantelis <tompantelis@gmail.com>
Sun, 30 Apr 2017 20:19:49 +0000 (20:19 +0000)
The listener-type specific RegisterDataTreeChangeListenerReply and
RegisterChangeListenerReply classes are identical. Simplify by
replacing them with a general RegisterDataTreeNotificationListenerReply.
This also simplifies AbstractDataListenerSupport by eliminating the
abstract newRegistrationReplyMessage method.

Change-Id: I97f6cf366ae6ff858ff258ebb8479468b144c193
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/AbstractDataListenerSupport.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DataChangeListenerRegistrationProxy.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DataChangeListenerSupport.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DataTreeChangeListenerProxy.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DataTreeChangeListenerSupport.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/RegisterChangeListenerReply.java [deleted file]
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/RegisterDataTreeNotificationListenerReply.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/RegisterDataTreeChangeListenerReply.java with 69% similarity]
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DataChangeListenerRegistrationProxyTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DataTreeChangeListenerProxyTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DataTreeChangeListenerSupportTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTest.java

index 15de81e290549080b0d991a093eef5732db4eed2..5a09b87da19f1e5b360761b1e64d05f00d793737 100644 (file)
@@ -16,6 +16,7 @@ import java.util.concurrent.ConcurrentHashMap;
 import org.opendaylight.controller.cluster.datastore.actors.DataTreeNotificationListenerRegistrationActor;
 import org.opendaylight.controller.cluster.datastore.messages.EnableNotification;
 import org.opendaylight.controller.cluster.datastore.messages.ListenerRegistrationMessage;
+import org.opendaylight.controller.cluster.datastore.messages.RegisterDataTreeNotificationListenerReply;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -93,7 +94,7 @@ abstract class AbstractDataListenerSupport<L extends EventListener, M extends Li
         log.debug("{}: {} sending reply, listenerRegistrationPath = {} ", persistenceId(), logName(),
                 registrationActor.path());
 
-        tellSender(newRegistrationReplyMessage(registrationActor));
+        tellSender(new RegisterDataTreeNotificationListenerReply(registrationActor));
     }
 
     protected ActorSelection processListenerRegistrationMessage(M message) {
@@ -124,7 +125,5 @@ abstract class AbstractDataListenerSupport<L extends EventListener, M extends Li
 
     abstract void doRegistration(M message, ActorRef registrationActor);
 
-    protected abstract Object newRegistrationReplyMessage(ActorRef registrationActor);
-
     protected abstract String logName();
 }
index 3fe3933fe72c08b84f33b747760ce6e3f6f17aa9..2c0be57bc1be9c2ba6831ff05c5c2ebfe3065364 100644 (file)
@@ -17,7 +17,7 @@ import com.google.common.base.Preconditions;
 import org.opendaylight.controller.cluster.datastore.exceptions.LocalShardNotFoundException;
 import org.opendaylight.controller.cluster.datastore.messages.CloseDataTreeNotificationListenerRegistration;
 import org.opendaylight.controller.cluster.datastore.messages.RegisterChangeListener;
-import org.opendaylight.controller.cluster.datastore.messages.RegisterChangeListenerReply;
+import org.opendaylight.controller.cluster.datastore.messages.RegisterDataTreeNotificationListenerReply;
 import org.opendaylight.controller.cluster.datastore.utils.ActorContext;
 import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker;
 import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
@@ -128,7 +128,7 @@ public class DataChangeListenerRegistrationProxy implements ListenerRegistration
                     LOG.error("Failed to register DataChangeListener {} at path {}",
                             listener, path.toString(), failure);
                 } else {
-                    RegisterChangeListenerReply reply = (RegisterChangeListenerReply) result;
+                    RegisterDataTreeNotificationListenerReply reply = (RegisterDataTreeNotificationListenerReply)result;
                     setListenerRegistrationActor(actorContext.actorSelection(
                             reply.getListenerRegistrationPath()));
                 }
index fde1bf691484b35231608d552af56da88a557631..51ab2aa57d49d29cc139a30a2653b3f8c449c5a4 100644 (file)
@@ -11,7 +11,6 @@ import akka.actor.ActorRef;
 import akka.actor.ActorSelection;
 import org.opendaylight.controller.cluster.datastore.actors.DataTreeNotificationListenerRegistrationActor;
 import org.opendaylight.controller.cluster.datastore.messages.RegisterChangeListener;
-import org.opendaylight.controller.cluster.datastore.messages.RegisterChangeListenerReply;
 import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeListener;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
@@ -39,11 +38,6 @@ final class DataChangeListenerSupport extends AbstractDataListenerSupport<
                             removeListenerActor(listenerActor)), ActorRef.noSender()));
     }
 
-    @Override
-    protected Object newRegistrationReplyMessage(ActorRef registrationActor) {
-        return new RegisterChangeListenerReply(registrationActor);
-    }
-
     @Override
     protected String logName() {
         return "registerDataChangeListener";
index 5f5114d399c0485453449e08e70a6055c5accfc1..73e50803d0eb1d38dd82adc704812bea7abda04a 100644 (file)
@@ -17,7 +17,7 @@ import javax.annotation.concurrent.GuardedBy;
 import org.opendaylight.controller.cluster.datastore.exceptions.LocalShardNotFoundException;
 import org.opendaylight.controller.cluster.datastore.messages.CloseDataTreeNotificationListenerRegistration;
 import org.opendaylight.controller.cluster.datastore.messages.RegisterDataTreeChangeListener;
-import org.opendaylight.controller.cluster.datastore.messages.RegisterDataTreeChangeListenerReply;
+import org.opendaylight.controller.cluster.datastore.messages.RegisterDataTreeNotificationListenerReply;
 import org.opendaylight.controller.cluster.datastore.utils.ActorContext;
 import org.opendaylight.controller.md.sal.dom.api.ClusteredDOMDataTreeChangeListener;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataTreeChangeListener;
@@ -116,7 +116,7 @@ final class DataTreeChangeListenerProxy<T extends DOMDataTreeChangeListener> ext
                     LOG.error("{}: Failed to register DataTreeChangeListener {} at path {}", logContext(),
                             getInstance(), registeredPath, failure);
                 } else {
-                    RegisterDataTreeChangeListenerReply reply = (RegisterDataTreeChangeListenerReply) result;
+                    RegisterDataTreeNotificationListenerReply reply = (RegisterDataTreeNotificationListenerReply)result;
                     setListenerRegistrationActor(actorContext.actorSelection(
                             reply.getListenerRegistrationPath()));
                 }
index a3ed4a19c9b31de30d5c53dc569b95d6d6697566..8dba00547f6926d554f7a753a56d9c0a4869d018 100644 (file)
@@ -11,7 +11,6 @@ import akka.actor.ActorRef;
 import akka.actor.ActorSelection;
 import org.opendaylight.controller.cluster.datastore.actors.DataTreeNotificationListenerRegistrationActor;
 import org.opendaylight.controller.cluster.datastore.messages.RegisterDataTreeChangeListener;
-import org.opendaylight.controller.cluster.datastore.messages.RegisterDataTreeChangeListenerReply;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataTreeChangeListener;
 
 final class DataTreeChangeListenerSupport extends AbstractDataListenerSupport<DOMDataTreeChangeListener,
@@ -36,11 +35,6 @@ final class DataTreeChangeListenerSupport extends AbstractDataListenerSupport<DO
                             removeListenerActor(listenerActor)), ActorRef.noSender()));
     }
 
-    @Override
-    protected Object newRegistrationReplyMessage(ActorRef registrationActor) {
-        return new RegisterDataTreeChangeListenerReply(registrationActor);
-    }
-
     @Override
     protected String logName() {
         return "registerTreeChangeListener";
diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/RegisterChangeListenerReply.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/RegisterChangeListenerReply.java
deleted file mode 100644 (file)
index f7031e4..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.controller.cluster.datastore.messages;
-
-import akka.actor.ActorPath;
-import akka.actor.ActorRef;
-
-public class RegisterChangeListenerReply {
-    private final ActorRef listenerRegistration;
-
-    public RegisterChangeListenerReply(final ActorRef listenerRegistration) {
-        this.listenerRegistration = listenerRegistration;
-    }
-
-    public ActorPath getListenerRegistrationPath() {
-        return listenerRegistration.path();
-    }
-}
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
+ * Copyright (c) 2017 Inocybe Technologies and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -10,17 +10,19 @@ package org.opendaylight.controller.cluster.datastore.messages;
 import akka.actor.ActorPath;
 import akka.actor.ActorRef;
 import com.google.common.base.Preconditions;
-
 import java.io.Serializable;
 
 /**
- * Successful reply to a {@link RegisterDataTreeChangeListener} request.
+ * Successful reply to a notification listener registration request.
+ *
+ * @author Thomas Pantelis
  */
-public final class RegisterDataTreeChangeListenerReply implements Serializable {
+public class RegisterDataTreeNotificationListenerReply implements Serializable {
     private static final long serialVersionUID = 1L;
+
     private final ActorRef listenerRegistrationPath;
 
-    public RegisterDataTreeChangeListenerReply(final ActorRef listenerRegistrationPath) {
+    public RegisterDataTreeNotificationListenerReply(final ActorRef listenerRegistrationPath) {
         this.listenerRegistrationPath = Preconditions.checkNotNull(listenerRegistrationPath);
     }
 
index 17a55b9767a152379e9f02f5ad0740a22c563535..64f088f1369d6fac8b1aab9c6a601ee64982d586 100644 (file)
@@ -35,7 +35,7 @@ import org.opendaylight.controller.cluster.datastore.messages.FindLocalShard;
 import org.opendaylight.controller.cluster.datastore.messages.LocalShardFound;
 import org.opendaylight.controller.cluster.datastore.messages.LocalShardNotFound;
 import org.opendaylight.controller.cluster.datastore.messages.RegisterChangeListener;
-import org.opendaylight.controller.cluster.datastore.messages.RegisterChangeListenerReply;
+import org.opendaylight.controller.cluster.datastore.messages.RegisterDataTreeNotificationListenerReply;
 import org.opendaylight.controller.cluster.datastore.utils.ActorContext;
 import org.opendaylight.controller.cluster.datastore.utils.Dispatchers;
 import org.opendaylight.controller.cluster.raft.utils.DoNothingActor;
@@ -100,7 +100,7 @@ public class DataChangeListenerRegistrationProxyTest extends AbstractActorTest {
                 Assert.assertEquals("getScope", scope, registerMsg.getScope());
                 Assert.assertEquals("isRegisterOnAllInstances", false, registerMsg.isRegisterOnAllInstances());
 
-                reply(new RegisterChangeListenerReply(getRef()));
+                reply(new RegisterDataTreeNotificationListenerReply(getRef()));
 
                 for (int i = 0; i < 20 * 5 && proxy.getListenerRegistrationActor() == null; i++) {
                     Uninterruptibles.sleepUninterruptibly(50, TimeUnit.MILLISECONDS);
@@ -160,7 +160,7 @@ public class DataChangeListenerRegistrationProxyTest extends AbstractActorTest {
                 Assert.assertEquals("getScope", scope, registerMsg.getScope());
                 Assert.assertEquals("isRegisterOnAllInstances", true, registerMsg.isRegisterOnAllInstances());
 
-                reply(new RegisterChangeListenerReply(getRef()));
+                reply(new RegisterDataTreeNotificationListenerReply(getRef()));
 
                 for (int i = 0; i < 20 * 5 && proxy.getListenerRegistrationActor() == null; i++) {
                     Uninterruptibles.sleepUninterruptibly(50, TimeUnit.MILLISECONDS);
@@ -317,7 +317,7 @@ public class DataChangeListenerRegistrationProxyTest extends AbstractActorTest {
 
                 Answer<Future<Object>> answer = invocation -> {
                     proxy.close();
-                    return Futures.successful((Object)new RegisterChangeListenerReply(getRef()));
+                    return Futures.successful((Object)new RegisterDataTreeNotificationListenerReply(getRef()));
                 };
 
                 doAnswer(answer).when(actorContext).executeOperationAsync(any(ActorRef.class),
index 820fe5614fadaf96d970a40e0722196a2c0e8ef7..927f9297979453589d2e2fa59c96ce82910df3c1 100644 (file)
@@ -34,7 +34,7 @@ import org.opendaylight.controller.cluster.datastore.messages.FindLocalShard;
 import org.opendaylight.controller.cluster.datastore.messages.LocalShardFound;
 import org.opendaylight.controller.cluster.datastore.messages.LocalShardNotFound;
 import org.opendaylight.controller.cluster.datastore.messages.RegisterDataTreeChangeListener;
-import org.opendaylight.controller.cluster.datastore.messages.RegisterDataTreeChangeListenerReply;
+import org.opendaylight.controller.cluster.datastore.messages.RegisterDataTreeNotificationListenerReply;
 import org.opendaylight.controller.cluster.datastore.utils.ActorContext;
 import org.opendaylight.controller.cluster.datastore.utils.Dispatchers;
 import org.opendaylight.controller.cluster.raft.utils.DoNothingActor;
@@ -79,7 +79,7 @@ public class DataTreeChangeListenerProxyTest extends AbstractActorTest {
                 Assert.assertEquals("getPath", path, registerMsg.getPath());
                 Assert.assertEquals("isRegisterOnAllInstances", false, registerMsg.isRegisterOnAllInstances());
 
-                reply(new RegisterDataTreeChangeListenerReply(getRef()));
+                reply(new RegisterDataTreeNotificationListenerReply(getRef()));
 
                 for (int i = 0; i < 20 * 5 && proxy.getListenerRegistrationActor() == null; i++) {
                     Uninterruptibles.sleepUninterruptibly(50, TimeUnit.MILLISECONDS);
@@ -270,7 +270,7 @@ public class DataTreeChangeListenerProxyTest extends AbstractActorTest {
 
                 Answer<Future<Object>> answer = invocation -> {
                     proxy.close();
-                    return Futures.successful((Object) new RegisterDataTreeChangeListenerReply(getRef()));
+                    return Futures.successful((Object) new RegisterDataTreeNotificationListenerReply(getRef()));
                 };
 
                 doAnswer(answer).when(actorContext).executeOperationAsync(any(ActorRef.class), any(Object.class),
index 1426e4a243f4a35cdc4de136581ee1f1a26a7d45..c8adf06dcfb9b2152d9bac5c569cb324a34a9577 100644 (file)
@@ -36,7 +36,7 @@ import org.junit.Test;
 import org.opendaylight.controller.cluster.datastore.messages.CloseDataTreeNotificationListenerRegistration;
 import org.opendaylight.controller.cluster.datastore.messages.CloseDataTreeNotificationListenerRegistrationReply;
 import org.opendaylight.controller.cluster.datastore.messages.RegisterDataTreeChangeListener;
-import org.opendaylight.controller.cluster.datastore.messages.RegisterDataTreeChangeListenerReply;
+import org.opendaylight.controller.cluster.datastore.messages.RegisterDataTreeNotificationListenerReply;
 import org.opendaylight.controller.cluster.datastore.utils.MockDataTreeChangeListener;
 import org.opendaylight.controller.md.cluster.datastore.model.TestModel;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
@@ -161,7 +161,7 @@ public class DataTreeChangeListenerSupportTest extends AbstractShardTest {
         ActorRef dclActor = actorFactory.createActor(DataTreeChangeListenerActor.props(listener, TestModel.TEST_PATH));
 
         try {
-            RegisterDataTreeChangeListenerReply reply = (RegisterDataTreeChangeListenerReply)
+            RegisterDataTreeNotificationListenerReply reply = (RegisterDataTreeNotificationListenerReply)
                 Await.result(Patterns.ask(shardActor, new RegisterDataTreeChangeListener(path, dclActor, false),
                     new Timeout(5, TimeUnit.SECONDS)), Duration.create(5, TimeUnit.SECONDS));
             return new SimpleEntry<>(listener, getSystem().actorSelection(reply.getListenerRegistrationPath()));
index 0bd34aac3ee768eb9c4abc0f872b0e83cf67f547..ce2a43f015bbcb5ea67f791514f0eef02e7c19ae 100644 (file)
@@ -71,9 +71,8 @@ import org.opendaylight.controller.cluster.datastore.messages.ReadDataReply;
 import org.opendaylight.controller.cluster.datastore.messages.ReadyLocalTransaction;
 import org.opendaylight.controller.cluster.datastore.messages.ReadyTransactionReply;
 import org.opendaylight.controller.cluster.datastore.messages.RegisterChangeListener;
-import org.opendaylight.controller.cluster.datastore.messages.RegisterChangeListenerReply;
 import org.opendaylight.controller.cluster.datastore.messages.RegisterDataTreeChangeListener;
-import org.opendaylight.controller.cluster.datastore.messages.RegisterDataTreeChangeListenerReply;
+import org.opendaylight.controller.cluster.datastore.messages.RegisterDataTreeNotificationListenerReply;
 import org.opendaylight.controller.cluster.datastore.messages.ShardLeaderStateChanged;
 import org.opendaylight.controller.cluster.datastore.messages.UpdateSchemaContext;
 import org.opendaylight.controller.cluster.datastore.modification.MergeModification;
@@ -148,8 +147,8 @@ public class ShardTest extends AbstractShardTest {
                 shard.tell(new RegisterChangeListener(TestModel.TEST_PATH, dclActor,
                         AsyncDataBroker.DataChangeScope.BASE, true), getRef());
 
-                final RegisterChangeListenerReply reply = expectMsgClass(duration("3 seconds"),
-                        RegisterChangeListenerReply.class);
+                final RegisterDataTreeNotificationListenerReply reply = expectMsgClass(duration("3 seconds"),
+                        RegisterDataTreeNotificationListenerReply.class);
                 final String replyPath = reply.getListenerRegistrationPath().toString();
                 assertTrue("Incorrect reply path: " + replyPath,
                         replyPath.matches("akka:\\/\\/test\\/user\\/testRegisterChangeListener\\/\\$.*"));
@@ -238,8 +237,8 @@ public class ShardTest extends AbstractShardTest {
                 shard.tell(new RegisterChangeListener(path, dclActor, AsyncDataBroker.DataChangeScope.SUBTREE, false),
                         getRef());
 
-                final RegisterChangeListenerReply reply = expectMsgClass(duration("5 seconds"),
-                        RegisterChangeListenerReply.class);
+                final RegisterDataTreeNotificationListenerReply reply = expectMsgClass(duration("5 seconds"),
+                        RegisterDataTreeNotificationListenerReply.class);
                 assertNotNull("getListenerRegistrationPath", reply.getListenerRegistrationPath());
 
                 // Sanity check - verify the shard is not the leader yet.
@@ -278,8 +277,8 @@ public class ShardTest extends AbstractShardTest {
 
                 shard.tell(new RegisterDataTreeChangeListener(TestModel.TEST_PATH, dclActor, false), getRef());
 
-                final RegisterDataTreeChangeListenerReply reply = expectMsgClass(duration("3 seconds"),
-                        RegisterDataTreeChangeListenerReply.class);
+                final RegisterDataTreeNotificationListenerReply reply = expectMsgClass(duration("3 seconds"),
+                        RegisterDataTreeNotificationListenerReply.class);
                 final String replyPath = reply.getListenerRegistrationPath().toString();
                 assertTrue("Incorrect reply path: " + replyPath,
                         replyPath.matches("akka:\\/\\/test\\/user\\/testRegisterDataTreeChangeListener\\/\\$.*"));
@@ -342,8 +341,8 @@ public class ShardTest extends AbstractShardTest {
                 assertEquals("Got first ElectionTimeout", true, onFirstElectionTimeout.await(5, TimeUnit.SECONDS));
 
                 shard.tell(new RegisterDataTreeChangeListener(path, dclActor, false), getRef());
-                final RegisterDataTreeChangeListenerReply reply = expectMsgClass(duration("5 seconds"),
-                        RegisterDataTreeChangeListenerReply.class);
+                final RegisterDataTreeNotificationListenerReply reply = expectMsgClass(duration("5 seconds"),
+                        RegisterDataTreeNotificationListenerReply.class);
                 assertNotNull("getListenerRegistratioznPath", reply.getListenerRegistrationPath());
 
                 shard.tell(FindLeader.INSTANCE, getRef());
@@ -2146,8 +2145,8 @@ public class ShardTest extends AbstractShardTest {
 
                 shard.tell(new RegisterChangeListener(path, dclActor, AsyncDataBroker.DataChangeScope.BASE, true),
                         getRef());
-                final RegisterChangeListenerReply reply = expectMsgClass(duration("5 seconds"),
-                        RegisterChangeListenerReply.class);
+                final RegisterDataTreeNotificationListenerReply reply = expectMsgClass(duration("5 seconds"),
+                        RegisterDataTreeNotificationListenerReply.class);
                 assertNotNull("getListenerRegistrationPath", reply.getListenerRegistrationPath());
 
                 shard.tell(DatastoreContext.newBuilderFrom(dataStoreContextBuilder.build())
@@ -2196,9 +2195,9 @@ public class ShardTest extends AbstractShardTest {
                 followerShard.tell(
                         new RegisterChangeListener(path, dclActor, AsyncDataBroker.DataChangeScope.BASE, true),
                         getRef());
-                final RegisterChangeListenerReply reply = expectMsgClass(duration("5 seconds"),
-                        RegisterChangeListenerReply.class);
-                assertNotNull("getListenerRegistratioznPath", reply.getListenerRegistrationPath());
+                final RegisterDataTreeNotificationListenerReply reply = expectMsgClass(duration("5 seconds"),
+                        RegisterDataTreeNotificationListenerReply.class);
+                assertNotNull("getListenerRegistrationPath", reply.getListenerRegistrationPath());
 
                 writeToStore(followerShard, path, ImmutableNodes.containerNode(TestModel.TEST_QNAME));
 
@@ -2228,8 +2227,8 @@ public class ShardTest extends AbstractShardTest {
                 waitUntilNoLeader(shard);
 
                 shard.tell(new RegisterDataTreeChangeListener(TestModel.TEST_PATH, dclActor, true), getRef());
-                final RegisterDataTreeChangeListenerReply reply = expectMsgClass(duration("5 seconds"),
-                        RegisterDataTreeChangeListenerReply.class);
+                final RegisterDataTreeNotificationListenerReply reply = expectMsgClass(duration("5 seconds"),
+                        RegisterDataTreeNotificationListenerReply.class);
                 assertNotNull("getListenerRegistrationPath", reply.getListenerRegistrationPath());
 
                 shard.tell(DatastoreContext.newBuilderFrom(dataStoreContextBuilder.build())
@@ -2261,8 +2260,8 @@ public class ShardTest extends AbstractShardTest {
                 waitUntilNoLeader(shard);
 
                 shard.tell(new RegisterDataTreeChangeListener(TestModel.TEST_PATH, dclActor, true), getRef());
-                final RegisterDataTreeChangeListenerReply reply = expectMsgClass(duration("5 seconds"),
-                        RegisterDataTreeChangeListenerReply.class);
+                final RegisterDataTreeNotificationListenerReply reply = expectMsgClass(duration("5 seconds"),
+                        RegisterDataTreeNotificationListenerReply.class);
                 assertNotNull("getListenerRegistrationPath", reply.getListenerRegistrationPath());
 
                 final ActorSelection regActor = getSystem().actorSelection(reply.getListenerRegistrationPath());
@@ -2313,8 +2312,8 @@ public class ShardTest extends AbstractShardTest {
                         actorFactory.generateActorId(testName + "-DataTreeChangeListener"));
 
                 followerShard.tell(new RegisterDataTreeChangeListener(TestModel.TEST_PATH, dclActor, true), getRef());
-                final RegisterDataTreeChangeListenerReply reply = expectMsgClass(duration("5 seconds"),
-                        RegisterDataTreeChangeListenerReply.class);
+                final RegisterDataTreeNotificationListenerReply reply = expectMsgClass(duration("5 seconds"),
+                        RegisterDataTreeNotificationListenerReply.class);
                 assertNotNull("getListenerRegistrationPath", reply.getListenerRegistrationPath());
 
                 writeToStore(followerShard, path, ImmutableNodes.containerNode(TestModel.TEST_QNAME));