use of com.netflix.titus.master.jobmanager.service.integration.scenario.StubbedJobStore.StoreEvent in project titus-control-plane by Netflix.
the class JobScenarioBuilder method expectTaskEvent.
private Task expectTaskEvent(int taskIdx, int resubmit, StoreEvent eventType) {
Task lastInStore = autoAdvance(() -> eventType == StoreEvent.TaskRemoved ? jobStore.expectTaskInStoreArchive(jobId, taskIdx, resubmit) : jobStore.expectTaskInStore(jobId, taskIdx, resubmit));
Pair<StoreEvent, Task> storeEventPair = storeEventsSubscriber.takeNextTaskStoreEvent(taskIdx, resubmit);
assertThat(storeEventPair.getLeft()).isEqualTo(eventType);
Task task = storeEventPair.getRight();
assertThat(task.getId()).describedAs("Task version in store different from the task in the store event: %s != %s", lastInStore.getId(), task.getId()).isEqualTo(lastInStore.getId());
return task;
}
Aggregations