@Test
public void testBatchedModificationsWithCommitOnReady() {

    final ShardTestKit testKit = new ShardTestKit(getSystem());
    final TestActorRef<Shard> shard = actorFactory.createTestActor(
        newShardProps().withDispatcher(Dispatchers.DefaultDispatcherId()),
        "testBatchedModificationsWithCommitOnReady");
    ShardTestKit.waitUntilLeader(shard);
    final TransactionIdentifier transactionID = nextTransactionId();
    final Duration duration = Duration.ofSeconds(5);
    // Send a BatchedModifications to start a transaction.
    shard.tell(newBatchedModifications(transactionID, TestModel.TEST_PATH,
        ImmutableNodes.containerNode(TestModel.TEST_QNAME), false, false, 1), testKit.getRef());
    testKit.expectMsgClass(duration, BatchedModificationsReply.class);
    // Send a couple more BatchedModifications.
    shard.tell(newBatchedModifications(transactionID, TestModel.OUTER_LIST_PATH,
        ImmutableNodes.mapNodeBuilder(TestModel.OUTER_LIST_QNAME).build(), false, false, 2),
        testKit.getRef());
    testKit.expectMsgClass(duration, BatchedModificationsReply.class);
    shard.tell(newBatchedModifications(transactionID,
        YangInstanceIdentifier.builder(TestModel.OUTER_LIST_PATH)
        .nodeWithKey(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, 1).build(),
        ImmutableNodes.mapEntry(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, 1), true, true, 3),
        testKit.getRef());
    testKit.expectMsgClass(duration, CommitTransactionReply.class);
    // Verify data in the data store.
    verifyOuterListEntry(shard, 1);
}