@Test
public void testEurekaRegistrationChangesTriggerStatusUpdateInEventStream() {

    ExtTestSubscriber<AgentStatus> testSubscriber = new ExtTestSubscriber<>();
    monitor.monitor().subscribe(testSubscriber);
    // UP
    mockStatusInEureka(instance, InstanceStatus.UP);
    assertThat(testSubscriber.takeNext().getStatusCode()).isEqualTo(AgentStatusCode.Healthy);
    // DOWN
    mockStatusInEureka(instance, InstanceStatus.DOWN);
    assertThat(testSubscriber.takeNext().getStatusCode()).isEqualTo(AgentStatusCode.Unhealthy);
    // Back to UP
    mockStatusInEureka(instance, InstanceStatus.UP);
    assertThat(testSubscriber.takeNext().getStatusCode()).isEqualTo(AgentStatusCode.Healthy);
}