Search in sources :

Example 11 with FlowCheckResponse

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;
}
Also used : FlowCheckResponse(com.sequenceiq.flow.api.model.FlowCheckResponse)

Example 12 with 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;
}
Also used : FlowCheckResponse(com.sequenceiq.flow.api.model.FlowCheckResponse)

Example 13 with 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;
}
Also used : FlowCheckResponse(com.sequenceiq.flow.api.model.FlowCheckResponse)

Example 14 with 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());
}
Also used : FlowCheckResponse(com.sequenceiq.flow.api.model.FlowCheckResponse)

Example 15 with FlowCheckResponse

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());
}
Also used : FlowCheckResponse(com.sequenceiq.flow.api.model.FlowCheckResponse) Test(org.junit.Test)

Aggregations

FlowCheckResponse (com.sequenceiq.flow.api.model.FlowCheckResponse)23 Test (org.junit.Test)10 FlowLog (com.sequenceiq.flow.domain.FlowLog)3 FlowChainLog (com.sequenceiq.flow.domain.FlowChainLog)2 SdxCluster (com.sequenceiq.datalake.entity.SdxCluster)1 FlowPublicEndpoint (com.sequenceiq.flow.api.FlowPublicEndpoint)1 TestFailException (com.sequenceiq.it.cloudbreak.exception.TestFailException)1 NotFoundException (javax.ws.rs.NotFoundException)1 Test (org.junit.jupiter.api.Test)1