in future/src/main/java/com/spotify/hamcrest/future/SuccessfullyCompletedBlockingCompletionStage.java [44:64]
protected boolean matchesSafely(
final CompletionStage<? extends T> future, final Description mismatchDescription) {
try {
final T item = future.toCompletableFuture().get();
if (matcher.matches(item)) {
return true;
} else {
mismatchDescription.appendText("a stage that completed with a value that ");
matcher.describeMismatch(item, mismatchDescription);
return false;
}
} catch (InterruptedException e) {
mismatchDescription.appendText("a stage that was interrupted");
return false;
} catch (ExecutionException e) {
mismatchDescription
.appendText("a stage that completed exceptionally with ")
.appendText(Utils.getStackTraceAsString(e.getCause()));
return false;
}
}