BUG-5903: do not rely on primary info on failure
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / test / java / org / opendaylight / controller / cluster / datastore / ShardTransactionFailureTest.java
index 757795acbece57eb8964766d8865dd28fceccf7f..de832c0b6052507fb241e76c6d7a14603ca37a0b 100644 (file)
@@ -42,8 +42,7 @@ public class ShardTransactionFailureTest extends AbstractActorTest {
     private static final ShardDataTree store = new ShardDataTree(testSchemaContext, TreeType.OPERATIONAL);
 
     private static final ShardIdentifier SHARD_IDENTIFIER =
-        ShardIdentifier.builder().memberName(MemberName.forName("member-1"))
-            .shardName("inventory").type("operational").build();
+        ShardIdentifier.create("inventory", MemberName.forName("member-1"), "operational");
 
     private final DatastoreContext datastoreContext = DatastoreContext.newBuilder().build();
 
@@ -60,8 +59,8 @@ public class ShardTransactionFailureTest extends AbstractActorTest {
     public void testNegativeReadWithReadOnlyTransactionClosed() throws Throwable {
 
         final ActorRef shard = createShard();
-        final Props props = ShardTransaction.props(RO, store.newReadOnlyTransaction("test-txn", null), shard,
-                datastoreContext, shardStats, "txn");
+        final Props props = ShardTransaction.props(RO, store.newReadOnlyTransaction(nextTransactionId()), shard,
+                datastoreContext, shardStats);
 
         final TestActorRef<ShardTransaction> subject = TestActorRef.create(getSystem(), props,
                 "testNegativeReadWithReadOnlyTransactionClosed");
@@ -82,8 +81,8 @@ public class ShardTransactionFailureTest extends AbstractActorTest {
     public void testNegativeReadWithReadWriteTransactionClosed() throws Throwable {
 
         final ActorRef shard = createShard();
-        final Props props = ShardTransaction.props(RW, store.newReadWriteTransaction("test-txn", null), shard,
-                datastoreContext, shardStats, "txn");
+        final Props props = ShardTransaction.props(RW, store.newReadWriteTransaction(nextTransactionId()), shard,
+                datastoreContext, shardStats);
 
         final TestActorRef<ShardTransaction> subject = TestActorRef.create(getSystem(), props,
                 "testNegativeReadWithReadWriteTransactionClosed");
@@ -103,8 +102,8 @@ public class ShardTransactionFailureTest extends AbstractActorTest {
     public void testNegativeExistsWithReadWriteTransactionClosed() throws Throwable {
 
         final ActorRef shard = createShard();
-        final Props props = ShardTransaction.props(RW, store.newReadWriteTransaction("test-txn", null), shard,
-                datastoreContext, shardStats, "txn");
+        final Props props = ShardTransaction.props(RW, store.newReadWriteTransaction(nextTransactionId()), shard,
+                datastoreContext, shardStats);
 
         final TestActorRef<ShardTransaction> subject = TestActorRef.create(getSystem(), props,
                 "testNegativeExistsWithReadWriteTransactionClosed");