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%2FTransactionProxyTest.java;h=2c36ca5cfae54b63797a1ac10fe8ca15fac5ccb6;hb=bdaf6bbf2576f28e77c19251dc462c394303aced;hp=7b3ba2f2fc87b80c851af88104f7c4217fabb3d9;hpb=6a7cc4dcc9909a286dad1267e633af6313bd9059;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/TransactionProxyTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/TransactionProxyTest.java index 7b3ba2f2fc..2c36ca5cfa 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/TransactionProxyTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/TransactionProxyTest.java @@ -43,6 +43,7 @@ import org.junit.Assert; import org.junit.Test; import org.mockito.InOrder; import org.mockito.Mockito; +import org.opendaylight.controller.cluster.access.concepts.MemberName; import org.opendaylight.controller.cluster.datastore.config.Configuration; import org.opendaylight.controller.cluster.datastore.exceptions.NoShardLeaderException; import org.opendaylight.controller.cluster.datastore.exceptions.NotInitializedException; @@ -754,7 +755,7 @@ public class TransactionProxyTest extends AbstractTransactionProxyTest { Object id = transactionProxy.getIdentifier(); assertNotNull("getIdentifier returned null", id); - assertTrue("Invalid identifier: " + id, id.toString().startsWith(memberName)); + assertTrue("Invalid identifier: " + id, id.toString().contains(MemberName.forName(memberName).toString())); } @Test @@ -861,7 +862,7 @@ public class TransactionProxyTest extends AbstractTransactionProxyTest { ActorRef txActorRef = actorSystem.actorOf(Props.create(DoNothingActor.class)); String actorPath = txActorRef.path().toString(); - CreateTransactionReply createTransactionReply = new CreateTransactionReply(actorPath, "txn-1", + CreateTransactionReply createTransactionReply = new CreateTransactionReply(actorPath, nextTransactionId(), DataStoreVersions.CURRENT_VERSION); doReturn(actorSystem.actorSelection(actorPath)).when(mockActorContext).actorSelection(actorPath); @@ -1489,14 +1490,14 @@ public class TransactionProxyTest extends AbstractTransactionProxyTest { setUpReadData("test", NormalizedNodeAggregatorTest.getRootNode(expectedNode1, schemaContext)); setUpReadData("cars", NormalizedNodeAggregatorTest.getRootNode(expectedNode2, schemaContext)); - doReturn(memberName).when(mockActorContext).getCurrentMemberName(); + doReturn(MemberName.forName(memberName)).when(mockActorContext).getCurrentMemberName(); doReturn(getSystem().dispatchers().defaultGlobalDispatcher()).when(mockActorContext).getClientDispatcher(); TransactionProxy transactionProxy = new TransactionProxy(mockComponentFactory, READ_ONLY); Optional> readOptional = transactionProxy.read( - YangInstanceIdentifier.builder().build()).get(5, TimeUnit.SECONDS); + YangInstanceIdentifier.EMPTY).get(5, TimeUnit.SECONDS); assertEquals("NormalizedNode isPresent", true, readOptional.isPresent()); @@ -1543,6 +1544,6 @@ public class TransactionProxyTest extends AbstractTransactionProxyTest { eqCreateTransaction(memberName, TransactionType.READ_ONLY), any(Timeout.class)); doReturn(readDataReply(expectedNode)).when(mockActorContext).executeOperationAsync( - eq(actorSelection(txActorRef)), eqReadData(YangInstanceIdentifier.builder().build()), any(Timeout.class)); + eq(actorSelection(txActorRef)), eqReadData(YangInstanceIdentifier.EMPTY), any(Timeout.class)); } }