### Question:
ManagementClient { public Mono<Void> stop(BackingApplication backingApplication) { return Mono.justOrEmpty(backingApplication) .flatMap(backingApp -> appManager.stop(StopApplicationRequest.builder() .name(backingApp.getName()) .properties(backingApp.getProperties()) .build()) .doOnRequest(l -> { LOG.info("Stopping application. backingAppName={}", backingApp.getName()); LOG.debug(BACKINGAPP_LOG_TEMPLATE, backingApp); }) .doOnSuccess(response -> { LOG.info("Success stopping application. backingAppName={}", backingApp.getName()); LOG.debug(BACKINGAPP_LOG_TEMPLATE, backingApp); }) .doOnError(e -> { LOG.error(String.format("Error stopping application. backingAppName=%s, error=%s", backingApp.getName(), e.getMessage()), e); LOG.debug(BACKINGAPP_LOG_TEMPLATE, backingApp); })); } ManagementClient(AppManager appManager); Mono<Void> start(BackingApplication backingApplication); Mono<Void> stop(BackingApplication backingApplication); Mono<Void> restart(BackingApplication backingApplication); Mono<Void> restage(BackingApplication backingApplication);  }### Answer:
@Test void stopApplication() { given(appManager.stop(any(StopApplicationRequest.class))) .willReturn(Mono.empty()); StepVerifier.create(managementClient.stop(backingApplication)) .verifyComplete(); verify(appManager).stop(argThat(request -> "foo-app".equals(request.getName()) && Collections.singletonMap("foo", "bar").equals(request.getProperties()))); verifyNoMoreInteractions(appManager); }
@Test void stopNullApplication() { StepVerifier.create(managementClient.stop(null)) .verifyComplete(); verifyNoInteractions(appManager); }