Search in sources :

Example 1 with FlowLogResponse

use of com.sequenceiq.flow.api.model.FlowLogResponse in project cloudbreak by hortonworks.

the class SdxUpgradeValidationResultProviderTest method testIsValidShouldReturnFalseWhenTheFlowDoesNotContainsValidationInitState.

@Test
void testIsValidShouldReturnFalseWhenTheFlowDoesNotContainsValidationInitState() {
    FlowLogResponse flowLogResponse = createLastFlowLog();
    when(cloudbreakFlowService.getLastCloudbreakFlowChainId(sdxCluster)).thenReturn(flowLogResponse);
    when(cloudbreakFlowService.getFlowLogsByFlowId(FLOW_ID)).thenReturn(createFlowLogsWithOutValidationInitState());
    assertFalse(underTest.isValidationFailed(sdxCluster));
    verify(cloudbreakFlowService).getLastCloudbreakFlowChainId(sdxCluster);
    verify(cloudbreakFlowService).getFlowLogsByFlowId(FLOW_ID);
}
Also used : FlowLogResponse(com.sequenceiq.flow.api.model.FlowLogResponse) Test(org.junit.jupiter.api.Test)

Example 2 with FlowLogResponse

use of com.sequenceiq.flow.api.model.FlowLogResponse in project cloudbreak by hortonworks.

the class SdxUpgradeValidationResultProviderTest method testIsValidShouldReturnFalseWhenTheFlowDoesNotContainsFailedState.

@Test
void testIsValidShouldReturnFalseWhenTheFlowDoesNotContainsFailedState() {
    FlowLogResponse flowLogResponse = createLastFlowLog();
    when(cloudbreakFlowService.getLastCloudbreakFlowChainId(sdxCluster)).thenReturn(flowLogResponse);
    when(cloudbreakFlowService.getFlowLogsByFlowId(FLOW_ID)).thenReturn(createFlowLogsWithOutFailedState());
    assertFalse(underTest.isValidationFailed(sdxCluster));
    verify(cloudbreakFlowService).getLastCloudbreakFlowChainId(sdxCluster);
    verify(cloudbreakFlowService).getFlowLogsByFlowId(FLOW_ID);
}
Also used : FlowLogResponse(com.sequenceiq.flow.api.model.FlowLogResponse) Test(org.junit.jupiter.api.Test)

Example 3 with FlowLogResponse

use of com.sequenceiq.flow.api.model.FlowLogResponse in project cloudbreak by hortonworks.

the class SdxUpgradeValidationResultProviderTest method testIsValidShouldReturnTrue.

@Test
void testIsValidShouldReturnTrue() {
    FlowLogResponse flowLogResponse = createLastFlowLog();
    when(cloudbreakFlowService.getLastCloudbreakFlowChainId(sdxCluster)).thenReturn(flowLogResponse);
    when(cloudbreakFlowService.getFlowLogsByFlowId(FLOW_ID)).thenReturn(createFlowLogsWithFailedValidation());
    assertTrue(underTest.isValidationFailed(sdxCluster));
    verify(cloudbreakFlowService).getLastCloudbreakFlowChainId(sdxCluster);
    verify(cloudbreakFlowService).getFlowLogsByFlowId(FLOW_ID);
}
Also used : FlowLogResponse(com.sequenceiq.flow.api.model.FlowLogResponse) Test(org.junit.jupiter.api.Test)

Example 4 with FlowLogResponse

use of com.sequenceiq.flow.api.model.FlowLogResponse in project cloudbreak by hortonworks.

the class LoadBalancerPollerServiceTest method setupFailFlowLogResponse.

private FlowLogResponse setupFailFlowLogResponse() {
    FlowLogResponse flowLogResponse = new FlowLogResponse();
    flowLogResponse.setCurrentState(LOAD_BALANCER_UPDATE_FAILED_STATE);
    return flowLogResponse;
}
Also used : FlowLogResponse(com.sequenceiq.flow.api.model.FlowLogResponse)

Example 5 with FlowLogResponse

use of com.sequenceiq.flow.api.model.FlowLogResponse in project cloudbreak by hortonworks.

the class FlowServiceTest method setup.

@Before
public void setup() {
    when(flowLogConverter.convert(any())).thenReturn(new FlowLogResponse());
    lenient().when(failHandledEvents.contains(FAIL_HANDLED_NEXT_EVENT)).thenReturn(true);
}
Also used : FlowLogResponse(com.sequenceiq.flow.api.model.FlowLogResponse) Before(org.junit.Before)

Aggregations

FlowLogResponse (com.sequenceiq.flow.api.model.FlowLogResponse)15 Test (org.junit.jupiter.api.Test)6 SdxCluster (com.sequenceiq.datalake.entity.SdxCluster)3 NotFoundException (javax.ws.rs.NotFoundException)1 Before (org.junit.Before)1