@Test(expected = IllegalStateException.class)
public void testChainedWriteTransactionsWithPreviousTxNotReady() {

    ActorRef actorRef = setupActorContextWithInitialCreateTransaction(getSystem(), WRITE_ONLY);
    expectBatchedModifications(actorRef, 1);
    try (TransactionChainProxy txChainProxy = new TransactionChainProxy(mockComponentFactory, historyId)) {
        DOMStoreWriteTransaction writeTx1 = txChainProxy.newWriteOnlyTransaction();
        NormalizedNode<?, ?> writeNode1 = ImmutableNodes.containerNode(TestModel.TEST_QNAME);
        writeTx1.write(TestModel.TEST_PATH, writeNode1);
        txChainProxy.newWriteOnlyTransaction();
    }
}