import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
writeToStore(store, TestModel.TEST_PATH, container);
- final YangInstanceIdentifier root = YangInstanceIdentifier.empty();
+ final YangInstanceIdentifier root = YangInstanceIdentifier.of();
final NormalizedNode expected = readStore(store, root);
final Snapshot snapshot = Snapshot.create(new ShardSnapshotState(new MetadataShardDataTreeSnapshot(expected)),
verifyOuterListEntry(shard, 1);
}
+ @Deprecated(since = "9.0.0", forRemoval = true)
@Test(expected = IllegalStateException.class)
public void testBatchedModificationsReadyWithIncorrectTotalMessageCount() throws Exception {
final ShardTestKit testKit = new ShardTestKit(getSystem());
}
@Test
+ @Deprecated(since = "9.0.0", forRemoval = true)
public void testBatchedModificationsWithOperationFailure() {
final ShardTestKit testKit = new ShardTestKit(getSystem());
final TestActorRef<Shard> shard = actorFactory.createTestActor(
}
@Test
+ @Deprecated(since = "9.0.0", forRemoval = true)
public void testOnBatchedModificationsWhenNotLeader() {
final AtomicBoolean overrideLeaderCalls = new AtomicBoolean();
final ShardTestKit testKit = new ShardTestKit(getSystem());
}
@Test
+ @Deprecated(since = "9.0.0", forRemoval = true)
public void testTransactionMessagesWithNoLeader() {
final ShardTestKit testKit = new ShardTestKit(getSystem());
dataStoreContextBuilder.customRaftPolicyImplementation(DisableElectionsRaftPolicy.class.getName())
final Duration duration = Duration.ofSeconds(5);
final TransactionIdentifier transactionID1 = nextTransactionId();
- doThrow(new DataValidationFailedException(YangInstanceIdentifier.empty(), "mock canCommit failure"))
+ doThrow(new DataValidationFailedException(YangInstanceIdentifier.of(), "mock canCommit failure"))
.doNothing().when(dataTree).validate(any(DataTreeModification.class));
shard.tell(newBatchedModifications(transactionID1, TestModel.TEST_PATH,
ShardTestKit.waitUntilLeader(shard);
- doThrow(new DataValidationFailedException(YangInstanceIdentifier.empty(), "mock canCommit failure"))
+ doThrow(new DataValidationFailedException(YangInstanceIdentifier.of(), "mock canCommit failure"))
.doNothing().when(dataTree).validate(any(DataTreeModification.class));
final Duration duration = Duration.ofSeconds(5);
ShardTestKit.waitUntilLeader(shard);
writeToStore(shard, TestModel.TEST_PATH, ImmutableNodes.containerNode(TestModel.TEST_QNAME));
- final NormalizedNode expectedRoot = readStore(shard, YangInstanceIdentifier.empty());
+ final NormalizedNode expectedRoot = readStore(shard, YangInstanceIdentifier.of());
// Trigger creation of a snapshot by ensuring
final RaftActorContext raftActorContext = ((TestShard) shard.underlyingActor()).getRaftActorContext();
commitTransaction(store, putTransaction);
- final NormalizedNode expected = readStore(store, YangInstanceIdentifier.empty());
+ final NormalizedNode expected = readStore(store, YangInstanceIdentifier.of());
final DataTreeModification writeTransaction = store.takeSnapshot().newModification();
- writeTransaction.delete(YangInstanceIdentifier.empty());
- writeTransaction.write(YangInstanceIdentifier.empty(), expected);
+ writeTransaction.delete(YangInstanceIdentifier.of());
+ writeTransaction.write(YangInstanceIdentifier.of(), expected);
commitTransaction(store, writeTransaction);
- final NormalizedNode actual = readStore(store, YangInstanceIdentifier.empty());
+ final NormalizedNode actual = readStore(store, YangInstanceIdentifier.of());
assertEquals(expected, actual);
}
ShardLeaderStateChanged leaderStateChanged = MessageCollectorActor.expectFirstMatching(listener,
ShardLeaderStateChanged.class);
- assertTrue("getLocalShardDataTree present", leaderStateChanged.getLocalShardDataTree().isPresent());
- assertSame("getLocalShardDataTree", shard.underlyingActor().getDataStore().getDataTree(),
- leaderStateChanged.getLocalShardDataTree().orElseThrow());
+ final var dataTree = leaderStateChanged.localShardDataTree();
+ assertNotNull("getLocalShardDataTree present", dataTree);
+ assertSame("getLocalShardDataTree", shard.underlyingActor().getDataStore().getDataTree(), dataTree);
MessageCollectorActor.clearMessages(listener);
shard.tell(new RequestVote(10000, "member2", 50, 50), testKit.getRef());
leaderStateChanged = MessageCollectorActor.expectFirstMatching(listener, ShardLeaderStateChanged.class);
- assertFalse("getLocalShardDataTree present", leaderStateChanged.getLocalShardDataTree().isPresent());
+ assertNull("getLocalShardDataTree present", leaderStateChanged.localShardDataTree());
}
@Test