@Test public void shouldExecuteCompletionStageAndReturnWithSuccess() throws ExecutionException, InterruptedException { // Given Bulkhead bulkhead = Bulkhead.of("test", config); BDDMockito.given(helloWorldService.returnHelloWorld()).willReturn("Hello"); // When CompletionStage<String> decoratedCompletionStage = bulkhead .executeCompletionStage(() -> CompletableFuture.supplyAsync(helloWorldService::returnHelloWorld)) .thenApply(value -> value + " world"); // Then assertThat(decoratedCompletionStage.toCompletableFuture().get()).isEqualTo("Hello world"); assertThat(bulkhead.getMetrics().getAvailableConcurrentCalls()).isEqualTo(1); BDDMockito.then(helloWorldService).should(times(1)).returnHelloWorld(); }