@Test
public void testExportDocumentViewOutputStream() throws Exception {

    Session delegate = mock(Session.class);
    SessionFacade<Session> facade = getFacade(delegate);
    final OutputStream handler = mock(OutputStream.class);
    final String path = "/correct/path";
    final CompletableFuture<String> latch = new CompletableFuture<>();
    doAnswer(invoked -> latch.complete("done")).when(delegate)
            .exportDocumentView(path, handler, true, true);
    assertFalse("should not be done", latch.isDone());
    facade.exportDocumentView(path, handler, true, true);
    assertEquals("should be done", "done", latch.getNow(""));
}