X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatabroker%2Factors%2Fdds%2FModuleShardBackendResolverTest.java;h=f44cdf327d2d2f1a4088375545e02f00cf521e84;hp=8c0db7e392f6667994add0edc0b27799a47b2ed1;hb=f83b2d36fdd7e953ba72492ffb684cd112aa04a6;hpb=1819f12a7e562482d9328a8e4c4aeffd2b1a2c01 diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/ModuleShardBackendResolverTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/ModuleShardBackendResolverTest.java index 8c0db7e392..f44cdf327d 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/ModuleShardBackendResolverTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/ModuleShardBackendResolverTest.java @@ -45,7 +45,7 @@ import org.opendaylight.controller.cluster.datastore.shardmanager.RegisterForSha import org.opendaylight.controller.cluster.datastore.shardstrategy.DefaultShardStrategy; import org.opendaylight.controller.cluster.datastore.shardstrategy.ShardStrategy; import org.opendaylight.controller.cluster.datastore.shardstrategy.ShardStrategyFactory; -import org.opendaylight.controller.cluster.datastore.utils.ActorContext; +import org.opendaylight.controller.cluster.datastore.utils.ActorUtils; import org.opendaylight.controller.cluster.datastore.utils.PrimaryShardInfoFutureCache; import org.opendaylight.yangtools.concepts.Registration; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; @@ -79,14 +79,14 @@ public class ModuleShardBackendResolverTest { shardManagerProbe = new TestProbe(system, "ShardManager"); - final ActorContext actorContext = createActorContextMock(system, contextProbe.ref()); - when(actorContext.getShardManager()).thenReturn(shardManagerProbe.ref()); + final ActorUtils actorUtils = createActorUtilsMock(system, contextProbe.ref()); + when(actorUtils.getShardManager()).thenReturn(shardManagerProbe.ref()); - moduleShardBackendResolver = new ModuleShardBackendResolver(CLIENT_ID, actorContext); - when(actorContext.getShardStrategyFactory()).thenReturn(shardStrategyFactory); + moduleShardBackendResolver = new ModuleShardBackendResolver(CLIENT_ID, actorUtils); + when(actorUtils.getShardStrategyFactory()).thenReturn(shardStrategyFactory); when(shardStrategyFactory.getStrategy(YangInstanceIdentifier.EMPTY)).thenReturn(shardStrategy); final PrimaryShardInfoFutureCache cache = new PrimaryShardInfoFutureCache(); - when(actorContext.getPrimaryShardInfoCache()).thenReturn(cache); + when(actorUtils.getPrimaryShardInfoCache()).thenReturn(cache); } @After @@ -120,7 +120,7 @@ public class ModuleShardBackendResolverTest { final ShardBackendInfo shardBackendInfo = TestUtils.getWithTimeout(stage.toCompletableFuture()); Assert.assertEquals(0L, shardBackendInfo.getCookie().longValue()); Assert.assertEquals(dataTree, shardBackendInfo.getDataTree().get()); - Assert.assertEquals(DefaultShardStrategy.DEFAULT_SHARD, shardBackendInfo.getShardName()); + Assert.assertEquals(DefaultShardStrategy.DEFAULT_SHARD, shardBackendInfo.getName()); } @Test @@ -184,8 +184,8 @@ public class ModuleShardBackendResolverTest { verifyNoMoreInteractions(mockCallback); } - private static ActorContext createActorContextMock(final ActorSystem system, final ActorRef actor) { - final ActorContext mock = mock(ActorContext.class); + private static ActorUtils createActorUtilsMock(final ActorSystem system, final ActorRef actor) { + final ActorUtils mock = mock(ActorUtils.class); final Promise promise = new scala.concurrent.impl.Promise.DefaultPromise<>(); final ActorSelection selection = system.actorSelection(actor.path()); final PrimaryShardInfo shardInfo = new PrimaryShardInfo(selection, (short) 0);