use of com.sequenceiq.flow.api.model.FlowCheckResponse in project cloudbreak by hortonworks.
the class CloudbreakFlowServiceTest method createFlowCheckResponse.
private FlowCheckResponse createFlowCheckResponse(Boolean hasActiveFlow, Boolean failed) {
FlowCheckResponse flowCheckResponse = new FlowCheckResponse();
flowCheckResponse.setFlowChainId(FLOW_CHAIN_ID);
flowCheckResponse.setHasActiveFlow(hasActiveFlow);
flowCheckResponse.setLatestFlowFinalizedAndFailed(failed);
return flowCheckResponse;
}
use of com.sequenceiq.flow.api.model.FlowCheckResponse in project cloudbreak by hortonworks.
the class FlowCheckResponseToFlowStateConverterTest method getFlowCheckResponse.
private FlowCheckResponse getFlowCheckResponse(Boolean hasActiveFlow, Boolean failed) {
FlowCheckResponse flowCheckResponse = new FlowCheckResponse();
flowCheckResponse.setHasActiveFlow(hasActiveFlow);
flowCheckResponse.setLatestFlowFinalizedAndFailed(failed);
return flowCheckResponse;
}
use of com.sequenceiq.flow.api.model.FlowCheckResponse in project cloudbreak by hortonworks.
the class LoadBalancerPollerServiceTest method setupFinishedFlowCheckResponse.
private FlowCheckResponse setupFinishedFlowCheckResponse() {
FlowCheckResponse flowCheckResponse = new FlowCheckResponse();
flowCheckResponse.setHasActiveFlow(false);
return flowCheckResponse;
}
use of com.sequenceiq.flow.api.model.FlowCheckResponse in project cloudbreak by hortonworks.
the class UnboundRestartPatchService method pollFlowState.
private AttemptResult<Boolean> pollFlowState(FlowIdentifier flowIdentifier) {
FlowCheckResponse flowState = flowService.getFlowState(flowIdentifier.getPollableId());
LOGGER.debug("Salt update polling has active flow: {}, with latest fail: {}", flowState.getHasActiveFlow(), flowState.getLatestFlowFinalizedAndFailed());
return flowState.getHasActiveFlow() ? AttemptResults.justContinue() : AttemptResults.finishWith(!flowState.getLatestFlowFinalizedAndFailed());
}
use of com.sequenceiq.flow.api.model.FlowCheckResponse in project cloudbreak by hortonworks.
the class FlowServiceTest method testFailedFlowChain.
@Test
public void testFailedFlowChain() {
setUpFlowChain(flowChainLog(), false, List.of(flowLog(INTERMEDIATE_STATE, FAIL_HANDLED_NEXT_EVENT, 2), flowLog(FlowConstants.INIT_STATE, NEXT_EVENT, 1)));
FlowCheckResponse flowCheckResponse = underTest.getFlowChainState(FLOW_CHAIN_ID);
assertFalse(flowCheckResponse.getHasActiveFlow());
assertEquals(FLOW_CHAIN_ID, flowCheckResponse.getFlowChainId());
}
Aggregations