Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,8 @@ void testFailed() throws Exception {
Mockito.verify(callback).failed(boom);
Mockito.verify(callback, Mockito.never()).cancelled();

try {
future.get();
} catch (final ExecutionException ex) {
Assertions.assertSame(boom, ex.getCause());
}
final ExecutionException ex = assertThrows(ExecutionException.class, future::get);
Assertions.assertSame(boom, ex.getCause());
Assertions.assertTrue(future.isDone());
Assertions.assertFalse(future.isCancelled());
}
Expand Down Expand Up @@ -162,11 +159,9 @@ void testAsyncFailed() throws Exception {
});
t.setDaemon(true);
t.start();
try {
future.get(60, TimeUnit.SECONDS);
} catch (final ExecutionException ex) {
Assertions.assertSame(boom, ex.getCause());
}
final ExecutionException ex = assertThrows(ExecutionException.class, () ->
future.get(60, TimeUnit.SECONDS));
Assertions.assertSame(boom, ex.getCause());
Assertions.assertTrue(future.isDone());
Assertions.assertFalse(future.isCancelled());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,9 @@ void testMultithreadingWriteStreamAbort() throws Exception {
});

Assertions.assertEquals(Boolean.TRUE, task2.get(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit()));
try {
task1.get(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit());
} catch (final ExecutionException ex) {
Assertions.assertInstanceOf(InterruptedIOException.class, ex.getCause());
}
final ExecutionException ex = Assertions.assertThrows(ExecutionException.class, () ->
task1.get(TIMEOUT.getDuration(), TIMEOUT.getTimeUnit()));
Assertions.assertInstanceOf(InterruptedIOException.class, ex.getCause());
}

@Test
Expand Down
Loading