- @Test(expected = TestException.class)
- public void testReadWithPriorRecordingOperationFailure() throws Throwable {
- doReturn(dataStoreContextBuilder.shardBatchedModificationCount(2).build()).
- when(mockActorContext).getDatastoreContext();
-
- ActorRef actorRef = setupActorContextWithInitialCreateTransaction(getSystem(), READ_WRITE);
-
- NormalizedNode<?, ?> nodeToWrite = ImmutableNodes.containerNode(TestModel.TEST_QNAME);
-
- expectFailedBatchedModifications(actorRef);
-
- doReturn(readSerializedDataReply(null)).when(mockActorContext).executeOperationAsync(
- eq(actorSelection(actorRef)), eqSerializedReadData());
-
- TransactionProxy transactionProxy = new TransactionProxy(mockActorContext, READ_WRITE);
-
- transactionProxy.write(TestModel.TEST_PATH, nodeToWrite);
-
- transactionProxy.delete(TestModel.TEST_PATH);
-
- try {
- propagateReadFailedExceptionCause(transactionProxy.read(TestModel.TEST_PATH));
- } finally {
- verify(mockActorContext, times(0)).executeOperationAsync(
- eq(actorSelection(actorRef)), eqSerializedReadData());
- }
- }
-