});
return worker;
}
};
final ViewProcessWorkerContext context = Mockito.mock(ViewProcessWorkerContext.class);
final ViewExecutionOptions options = ExecutionOptions.infinite(MarketData.live(), ExecutionFlags.none().ignoreCompilationValidity().get());
final ViewDefinition viewDefinition = Mockito.mock(ViewDefinition.class);
final ParallelRecompilationViewProcessWorker worker = new ParallelRecompilationViewProcessWorker(workerFactory, context, options, viewDefinition);
// With no worker
assertFalse(worker.triggerCycle());
// With a primary worker that responds TRUE (first time)
worker.startParallel(options);
assertTrue(worker.triggerCycle());
// With a primary worker that responds FALSE (second time)
worker.startSecondaryWorker(worker.getPrimary(), options.getExecutionSequence());
assertFalse(worker.triggerCycle());
// With a primary worker that returns FALSE, causes secondary promotion, and that returns TRUE (first time)
assertTrue(worker.triggerCycle());
// With a primary worker that responds FALSE (second time)
assertFalse(worker.triggerCycle());