use of com.sequenceiq.sdx.api.model.SdxClusterResponse in project cloudbreak by hortonworks.
the class SdxPollerProviderTest method getSdxResponse.
private SdxClusterResponse getSdxResponse(SdxClusterStatusResponse status, String name) {
SdxClusterResponse stack1 = new SdxClusterResponse();
stack1.setStatus(status);
stack1.setName(name);
stack1.setCrn(name);
stack1.setStatusReason("reason");
return stack1;
}
use of com.sequenceiq.sdx.api.model.SdxClusterResponse in project cloudbreak by hortonworks.
the class SdxPollerProviderTest method testStartDatalakePoller.
@ParameterizedTest
@MethodSource("datalakeStartStatuses")
void testStartDatalakePoller(SdxClusterStatusResponse s1Status, SdxClusterStatusResponse s2Status, AttemptState attemptState, String message, List<String> remaining) throws Exception {
List<String> pollingCrn = new ArrayList<>();
pollingCrn.add("crn1");
pollingCrn.add("crn2");
SdxClusterResponse sdx1 = getSdxResponse(s1Status, "crn1");
SdxClusterResponse sdx2 = getSdxResponse(s2Status, "crn2");
when(sdxService.getByCrn("crn1")).thenReturn(sdx1);
when(sdxService.getByCrn("crn2")).thenReturn(sdx2);
AttemptResult<Void> result = underTest.startSdxClustersPoller(ENV_ID, pollingCrn).process();
assertEquals(attemptState, result.getState());
}
use of com.sequenceiq.sdx.api.model.SdxClusterResponse in project cloudbreak by hortonworks.
the class DataLakeStatusCheckerServiceTest method testValidateRunningStateShouldThrowExceptionWhenTheSdxIsInUpgradeState.
@Test(expected = BadRequestException.class)
public void testValidateRunningStateShouldThrowExceptionWhenTheSdxIsInUpgradeState() {
Stack stack = createStack();
List<SdxClusterResponse> sdxClusterResponses = createSdxResponse(SdxClusterStatusResponse.DATALAKE_UPGRADE_IN_PROGRESS, "Upgrading");
when(sdxClientService.getByEnvironmentCrn(ENVIRONMENT_CRN)).thenReturn(sdxClusterResponses);
underTest.validateRunningState(stack);
}
use of com.sequenceiq.sdx.api.model.SdxClusterResponse in project cloudbreak by hortonworks.
the class DataLakeStatusCheckerServiceTest method testValidateRunningStateShouldNotThrowExceptionWhenTheSdxIsInRunningState.
@Test
public void testValidateRunningStateShouldNotThrowExceptionWhenTheSdxIsInRunningState() {
Stack stack = createStack();
List<SdxClusterResponse> sdxClusterResponses = createSdxResponse(SdxClusterStatusResponse.RUNNING, "Running");
when(sdxClientService.getByEnvironmentCrn(ENVIRONMENT_CRN)).thenReturn(sdxClusterResponses);
underTest.validateRunningState(stack);
}
use of com.sequenceiq.sdx.api.model.SdxClusterResponse in project cloudbreak by hortonworks.
the class SdxConverterTest method testGetSharedServiceWhenSdxIsRunning.
@Test
public void testGetSharedServiceWhenSdxIsRunning() {
SdxClusterResponse sdxClusterResponse = new SdxClusterResponse();
sdxClusterResponse.setName("some-sdx");
sdxClusterResponse.setStatus(SdxClusterStatusResponse.RUNNING);
SharedServiceV4Request sdxRequest = underTest.getSharedService(sdxClusterResponse);
Assertions.assertEquals("some-sdx", sdxRequest.getDatalakeName());
}
Aggregations