Split transaction lifecycle
[netconf.git] / restconf / restconf-nb-rfc8040 / src / test / java / org / opendaylight / restconf / nb / rfc8040 / rests / utils / DeleteDataTransactionUtilTest.java
index 156100ad25b56cf5cee85fd95ccec2d62415092d..9dfd50a95c27d6e95a68720523b3809fbef124cf 100644 (file)
@@ -73,8 +73,8 @@ public class DeleteDataTransactionUtilTest {
     @Test
     public void deleteData() {
         // assert that data to delete exists
-        Mockito.when(this.transactionChain.newReadWriteTransaction().exists(LogicalDatastoreType.CONFIGURATION,
-                YangInstanceIdentifier.empty())).thenReturn(immediateTrueFluentFuture());
+        Mockito.when(readWrite.exists(LogicalDatastoreType.CONFIGURATION, YangInstanceIdentifier.empty()))
+            .thenReturn(immediateTrueFluentFuture());
         // test
         delete(new MdsalRestconfStrategy(transactionChainHandler));
         delete(new NetconfRestconfStrategy(netconfService));
@@ -86,8 +86,8 @@ public class DeleteDataTransactionUtilTest {
     @Test
     public void deleteDataNegativeTest() {
         // assert that data to delete does NOT exist
-        Mockito.when(this.transactionChain.newReadWriteTransaction().exists(LogicalDatastoreType.CONFIGURATION,
-                YangInstanceIdentifier.empty())).thenReturn(immediateFalseFluentFuture());
+        Mockito.when(readWrite.exists(LogicalDatastoreType.CONFIGURATION, YangInstanceIdentifier.empty()))
+            .thenReturn(immediateFalseFluentFuture());
         final NetconfDocumentedException exception = new NetconfDocumentedException("id",
             DocumentedException.ErrorType.RPC, DocumentedException.ErrorTag.from("data-missing"),
             DocumentedException.ErrorSeverity.ERROR);