### Question:
StatusUpdateTrigger extends AbstractEventHandler<InstanceEvent> { protected Mono<Void> updateStatus(InstanceId instanceId) { return statusUpdater.updateStatus(instanceId).doFinally(s -> lastQueried.put(instanceId, Instant.now())); } StatusUpdateTrigger(StatusUpdater statusUpdater, Publisher<InstanceEvent> publisher); @Override void start(); @Override void stop(); void setUpdateInterval(Duration updateInterval); void setStatusLifetime(Duration statusLifetime);  }### Answer:
@Test public void should_update_on_instance_registered_event() { events.next(new InstanceRegisteredEvent(instance.getId(), instance.getVersion(), instance.getRegistration())); verify(updater, times(1)).updateStatus(instance.getId()); }
@Test public void should_update_on_instance_registration_update_event() { events.next( new InstanceRegistrationUpdatedEvent(instance.getId(), instance.getVersion(), instance.getRegistration())); verify(updater, times(1)).updateStatus(instance.getId()); }
@Test public void should_not_update_on_non_relevant_event() { events.next(new InstanceInfoChangedEvent(instance.getId(), instance.getVersion(), Info.empty())); verify(updater, never()).updateStatus(instance.getId()); }