use of com.sequenceiq.flow.core.model.FlowAcceptResult in project cloudbreak by hortonworks.
the class FlowComponentTest method startSecondFlowWhenFirstCompletedThenWaitForComplete.
@Test
public void startSecondFlowWhenFirstCompletedThenWaitForComplete() throws InterruptedException {
long resourceId = RESOURCE_ID_SEC.incrementAndGet();
SleepStartEvent sleepStartEvent1 = SleepStartEvent.neverFail(resourceId, SLEEP_TIME);
FlowAcceptResult acceptResult1 = startSleepFlow(sleepStartEvent1);
assertRunningInFlow(acceptResult1);
waitFlowToComplete(SLEEP_TIME.multipliedBy(WAIT_FACTOR), acceptResult1);
SleepStartEvent sleepStartEvent2 = SleepStartEvent.neverFail(resourceId, SLEEP_TIME);
FlowAcceptResult acceptResult2 = startSleepFlow(sleepStartEvent2);
assertRunningInFlow(acceptResult2);
waitFlowToComplete(SLEEP_TIME.multipliedBy(WAIT_FACTOR), acceptResult2);
}
Aggregations