return Futures.immediateCheckedFuture(Optional.<NormalizedNode<?, ?>> of(dummyNode));
}
+ private CheckedFuture<Boolean,ReadFailedException> wrapExistence(Boolean exists) {
+ return Futures.immediateCheckedFuture(exists);
+ }
+
+
/**
* Value of this node shouldn't be important for testing purposes
*/
CheckedFuture<Void, TransactionCommitFailedException> expFuture = mock(CheckedFuture.class);
NormalizedNode<?, ?> dummyNode2 = createDummyNode("dummy:namespace2", "2014-07-01", "dummy local name2");
+
when(rwTransaction.read(eq(LogicalDatastoreType.CONFIGURATION), any(YangInstanceIdentifier.class))).thenReturn(
wrapDummyNode(dummyNode2));
+
+ when(rwTransaction.exists(eq(LogicalDatastoreType.CONFIGURATION), any(YangInstanceIdentifier.class))).thenReturn(
+ wrapExistence(true));
+
+
when(rwTransaction.submit()).thenReturn(expFuture);
CheckedFuture<Void, TransactionCommitFailedException> actualFuture = brokerFacade.commitConfigurationDataPost(
when(wTransaction.submit()).thenReturn(expFuture);
+ NormalizedNode<?, ?> dummyNode2 = createDummyNode("dummy:namespace2", "2014-07-01", "dummy local name2");
+
+
CheckedFuture<Void, TransactionCommitFailedException> actualFuture = brokerFacade
.commitConfigurationDataDelete(instanceID);