@Test
public void testEurekaReRegistration() {

    jobManagerStub.moveTaskToState(taskId1, TaskState.Started);
    StepVerifier.create(healthService.events(false))
            // Change state to UP
            .then(() -> registerAndRefresh(InstanceStatus.UP))
            .assertNext(event -> assertContainerHealthAndEvent(event, healthService.getHealthStatus(taskId1), taskId1, ContainerHealthState.Healthy))
            // Unregister in Eureka
            .then(() -> {
                eurekaServer.unregister(taskId1);
                eurekaServer.triggerCacheRefreshUpdate();
            })
            .assertNext(event -> assertContainerHealthAndEvent(event, healthService.getHealthStatus(taskId1), taskId1, ContainerHealthState.Unknown))
            // Register again
            .then(() -> registerAndRefresh(InstanceStatus.UP))
            .assertNext(event -> assertContainerHealthAndEvent(event, healthService.getHealthStatus(taskId1), taskId1, ContainerHealthState.Healthy))
            .thenCancel()
            .verify(Duration.ofSeconds(5));
}