@Test public void deregister() { InstanceId id = registry.register(Registration.create("abc", "http: registry.deregister(id).block(); StepVerifier.create(registry.getInstance(id)) .assertNext(app -> assertThat(app.isRegistered()).isFalse()) .verifyComplete(); }
public Mono<InstanceId> deregister(InstanceId id) { return repository.computeIfPresent(id, (key, instance) -> Mono.just(instance.deregister())) .map(Instance::getId); }
InstanceRegistry { public Mono<InstanceId> deregister(InstanceId id) { return repository.computeIfPresent(id, (key, instance) -> Mono.just(instance.deregister())) .map(Instance::getId); } }
InstanceRegistry { public Mono<InstanceId> deregister(InstanceId id) { return repository.computeIfPresent(id, (key, instance) -> Mono.just(instance.deregister())) .map(Instance::getId); } InstanceRegistry(InstanceRepository repository, InstanceIdGenerator generator); }
InstanceRegistry { public Mono<InstanceId> deregister(InstanceId id) { return repository.computeIfPresent(id, (key, instance) -> Mono.just(instance.deregister())) .map(Instance::getId); } InstanceRegistry(InstanceRepository repository, InstanceIdGenerator generator); Mono<InstanceId> register(Registration registration); Flux<Instance> getInstances(); Flux<Instance> getInstances(String name); Mono<Instance> getInstance(InstanceId id); Mono<InstanceId> deregister(InstanceId id); }
InstanceRegistry { public Mono<InstanceId> deregister(InstanceId id) { return repository.computeIfPresent(id, (key, instance) -> Mono.just(instance.deregister())) .map(Instance::getId); } InstanceRegistry(InstanceRepository repository, InstanceIdGenerator generator); Mono<InstanceId> register(Registration registration); Flux<Instance> getInstances(); Flux<Instance> getInstances(String name); Mono<Instance> getInstance(InstanceId id); Mono<InstanceId> deregister(InstanceId id);  }