More netconf-topology module unit tests
[netconf.git] / netconf / netconf-topology / src / test / java / org / opendaylight / netconf / topology / pipeline / tx / ProxyReadOnlyTransactionTest.java
index d7d7c94d51e16cd961315c7704cd6ee7b1963b76..afde0a0537c6d63569deb9f325a3d76249f17a5f 100644 (file)
@@ -89,6 +89,15 @@ public class ProxyReadOnlyTransactionTest {
         }
     }
 
+    @Test
+    public void testDataOnPathDoesNotExistPathRead() throws ReadFailedException {
+        when(mockedProxyDataBroker.read(any(LogicalDatastoreType.class), any(YangInstanceIdentifier.class)))
+                .thenReturn(Futures.successful(Optional.absent()));
+        CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> readResultFuture =  proxyReadOnlyTx.read(LogicalDatastoreType.CONFIGURATION, path);
+        verify(mockedProxyDataBroker).read(eq(LogicalDatastoreType.CONFIGURATION), eq(path));
+        assertTrue(readResultFuture.isDone());
+        assertTrue(!readResultFuture.checkedGet().isPresent());
+    }
 
     @Test
     public void testFailedExists() {