@Test public void should_retry() { wireMock.stubFor(get("/health").inScenario("retry") .whenScenarioStateIs(STARTED) .willReturn(aResponse().withFixedDelay(5000)) .willSetStateTo("recovered")); wireMock.stubFor(get("/health").inScenario("retry").whenScenarioStateIs("recovered").willReturn(ok())); StepVerifier.create(eventStore) .expectSubscription() .then(() -> StepVerifier.create(updater.updateStatus(instance.getId())).verifyComplete()) .assertNext(event -> assertThat(event).isInstanceOf(InstanceStatusChangedEvent.class)) .thenCancel() .verify(); StepVerifier.create(repository.find(instance.getId())) .assertNext(app -> assertThat(app.getStatusInfo().getStatus()).isEqualTo("UP")) .verifyComplete(); }
public Mono<Void> updateStatus(InstanceId id) { return repository.computeIfPresent(id, (key, instance) -> this.doUpdateStatus(instance)).then(); }
StatusUpdater { public Mono<Void> updateStatus(InstanceId id) { return repository.computeIfPresent(id, (key, instance) -> this.doUpdateStatus(instance)).then(); } }
StatusUpdater { public Mono<Void> updateStatus(InstanceId id) { return repository.computeIfPresent(id, (key, instance) -> this.doUpdateStatus(instance)).then(); } StatusUpdater(InstanceRepository repository, InstanceWebClient instanceWebClient); }
StatusUpdater { public Mono<Void> updateStatus(InstanceId id) { return repository.computeIfPresent(id, (key, instance) -> this.doUpdateStatus(instance)).then(); } StatusUpdater(InstanceRepository repository, InstanceWebClient instanceWebClient); Mono<Void> updateStatus(InstanceId id); }
StatusUpdater { public Mono<Void> updateStatus(InstanceId id) { return repository.computeIfPresent(id, (key, instance) -> this.doUpdateStatus(instance)).then(); } StatusUpdater(InstanceRepository repository, InstanceWebClient instanceWebClient); Mono<Void> updateStatus(InstanceId id);  }