@Test public void testOutOfServiceJobWithRealStateNotRegistered() { jobManagerStub.moveTaskToState(taskId1, TaskState.Started); StepVerifier.create(healthService.events(false)) .then(eurekaServer::triggerCacheRefreshUpdate) .assertNext(event -> assertContainerHealthAndEvent(event, healthService.getHealthStatus(taskId1), taskId1, ContainerHealthState.Unknown)) .then(() -> jobManagerStub.changeJobEnabledStatus(job1, false)) .assertNext(event -> assertContainerHealthAndEvent(event, healthService.getHealthStatus(taskId1), taskId1, ContainerHealthState.Healthy)) .then(() -> jobManagerStub.changeJobEnabledStatus(job1, true)) .assertNext(event -> assertContainerHealthAndEvent(event, healthService.getHealthStatus(taskId1), taskId1, ContainerHealthState.Unknown)) .thenCancel() .verify(Duration.ofSeconds(5)); }
@Override public Flux<ContainerHealthEvent> events(boolean snapshot) { Preconditions.checkArgument(!snapshot, "Snapshot state is generated by AggregatingContainerHealthService"); return healthStatuses; }
EurekaContainerHealthService implements ContainerHealthService { @Override public Flux<ContainerHealthEvent> events(boolean snapshot) { Preconditions.checkArgument(!snapshot, "Snapshot state is generated by AggregatingContainerHealthService"); return healthStatuses; } }
EurekaContainerHealthService implements ContainerHealthService { @Override public Flux<ContainerHealthEvent> events(boolean snapshot) { Preconditions.checkArgument(!snapshot, "Snapshot state is generated by AggregatingContainerHealthService"); return healthStatuses; } @Inject  EurekaContainerHealthService(ReadOnlyJobOperations jobOperations, EurekaClient eurekaClient, TitusRuntime titusRuntime); }
EurekaContainerHealthService implements ContainerHealthService { @Override public Flux<ContainerHealthEvent> events(boolean snapshot) { Preconditions.checkArgument(!snapshot, "Snapshot state is generated by AggregatingContainerHealthService"); return healthStatuses; } @Inject  EurekaContainerHealthService(ReadOnlyJobOperations jobOperations, EurekaClient eurekaClient, TitusRuntime titusRuntime); @Activator void activate(); @PreDestroy void shutdown(); @Override String getName(); @Override Optional<ContainerHealthStatus> findHealthStatus(String taskId); @Override Flux<ContainerHealthEvent> events(boolean snapshot); }
EurekaContainerHealthService implements ContainerHealthService { @Override public Flux<ContainerHealthEvent> events(boolean snapshot) { Preconditions.checkArgument(!snapshot, "Snapshot state is generated by AggregatingContainerHealthService"); return healthStatuses; } @Inject  EurekaContainerHealthService(ReadOnlyJobOperations jobOperations, EurekaClient eurekaClient, TitusRuntime titusRuntime); @Activator void activate(); @PreDestroy void shutdown(); @Override String getName(); @Override Optional<ContainerHealthStatus> findHealthStatus(String taskId); @Override Flux<ContainerHealthEvent> events(boolean snapshot); static final String NAME; }