add default

This commit is contained in:
@hangga 2023-10-08 20:33:43 +07:00
parent 05f4487d63
commit 92d038dc3c
1 changed files with 12 additions and 0 deletions

View File

@ -81,4 +81,16 @@ class CompletableFutureTimeoutUnitTest {
assertThrows(ExecutionException.class, completableFuture::get);
}
@Test
void whencompletableDefault_thenGetReturn() {
CompletableFuture<Integer> completableFuture = createDummyRequest();
try {
int result = completableFuture.get();
assertEquals(TIMEOUT_STATUS_CODE, result);
} catch (InterruptedException | ExecutionException e) {
//System.out.println("ERROR->"+e.getMessage());
throw new RuntimeException(e);
}
}
}