@Test
public void testRead() throws Exception {

    ActorRef actorRef = setupActorContextWithInitialCreateTransaction(getSystem(), READ_ONLY);
    TransactionProxy transactionProxy = new TransactionProxy(mockComponentFactory, READ_ONLY);
    doReturn(readDataReply(null)).when(mockActorContext).executeOperationAsync(
            eq(actorSelection(actorRef)), eqReadData(), any(Timeout.class));
    Optional<NormalizedNode<?, ?>> readOptional = transactionProxy.read(
            TestModel.TEST_PATH).get(5, TimeUnit.SECONDS);
    assertFalse("NormalizedNode isPresent", readOptional.isPresent());
    NormalizedNode<?, ?> expectedNode = ImmutableNodes.containerNode(TestModel.TEST_QNAME);
    doReturn(readDataReply(expectedNode)).when(mockActorContext).executeOperationAsync(
            eq(actorSelection(actorRef)), eqReadData(), any(Timeout.class));
    readOptional = transactionProxy.read(TestModel.TEST_PATH).get(5, TimeUnit.SECONDS);
    assertTrue("NormalizedNode isPresent", readOptional.isPresent());
    assertEquals("Response NormalizedNode", expectedNode, readOptional.get());
}