use of com.sequenceiq.flow.reactor.api.event.BaseFlowEvent in project cloudbreak by hortonworks.
the class HelloWorldFlowChainFactory method createFlowTriggerEventQueue.
@Override
public FlowTriggerEventQueue createFlowTriggerEventQueue(BaseFlowEvent event) {
Queue<Selectable> flowEventChain = new ConcurrentLinkedDeque<>();
flowEventChain.add(new BaseFlowEvent(HELLOWORLD_TRIGGER_EVENT.event(), event.getResourceId(), event.getResourceCrn(), event.accepted()));
return new FlowTriggerEventQueue(getName(), event, flowEventChain);
}
use of com.sequenceiq.flow.reactor.api.event.BaseFlowEvent in project cloudbreak by hortonworks.
the class ReactorNotifierTest method testNonAllowedFlowInMaintenanceMode.
@Test(expected = CloudbreakApiException.class)
public void testNonAllowedFlowInMaintenanceMode() {
Stack stack = TestUtil.stack();
stack.setCluster(TestUtil.cluster());
stack.setStackStatus(new StackStatus(stack, DetailedStackStatus.MAINTENANCE_MODE_ENABLED));
when(stackService.getByIdWithTransaction(1L)).thenReturn(stack);
BaseFlowEvent baseFlowEvent = new BaseFlowEvent("dontcare", 1L, "crn");
when(eventFactory.createEventWithErrHandler(anyMap(), any(Acceptable.class))).thenReturn(new Event<Acceptable>(baseFlowEvent));
underTest.notify(1L, "RANDOM", baseFlowEvent, stackService::getByIdWithTransaction);
verify(reactor, never()).notify(anyString(), any(Event.class));
}
use of com.sequenceiq.flow.reactor.api.event.BaseFlowEvent in project cloudbreak by hortonworks.
the class SdxReactorFlowManagerTest method setUp.
@BeforeEach
void setUp() throws InterruptedException {
sdxCluster = getValidSdxCluster();
when(acceptResultPromise.await(anyLong(), any())).thenReturn(FlowAcceptResult.runningInFlow("flowId"));
BaseFlowEvent baseFlowEvent = new BaseFlowEvent("dontcare", 1L, "crn", acceptResultPromise);
lenient().when(eventFactory.createEventWithErrHandler(anyMap(), any(Acceptable.class))).thenReturn(new Event(baseFlowEvent));
}
Aggregations