use of com.sequenceiq.environment.api.v1.environment.model.response.EnvironmentStatus in project cloudbreak by hortonworks.
the class SdxServiceTest method testCreateButEnvInFailedPhase.
@ParameterizedTest
@MethodSource("failedParamProvider")
void testCreateButEnvInFailedPhase(EnvironmentStatus environmentStatus) {
SdxClusterRequest sdxClusterRequest = createSdxClusterRequest(null, MEDIUM_DUTY_HA);
DetailedEnvironmentResponse detailedEnvironmentResponse = new DetailedEnvironmentResponse();
detailedEnvironmentResponse.setName(sdxClusterRequest.getEnvironment());
detailedEnvironmentResponse.setCloudPlatform(CloudPlatform.AWS.name());
detailedEnvironmentResponse.setCrn(getCrn());
detailedEnvironmentResponse.setEnvironmentStatus(environmentStatus);
when(environmentClientService.getByName(anyString())).thenReturn(detailedEnvironmentResponse);
BadRequestException badRequestException = assertThrows(BadRequestException.class, () -> ThreadBasedUserCrnProvider.doAs(USER_CRN, () -> underTest.createSdx(USER_CRN, CLUSTER_NAME, sdxClusterRequest, null)), "BadRequestException should thrown");
assertEquals("The environment is in failed phase. Please fix the environment or create a new one first!", badRequestException.getMessage());
}
use of com.sequenceiq.environment.api.v1.environment.model.response.EnvironmentStatus in project cloudbreak by hortonworks.
the class EnvironmentServiceTest method getDetailedEnvironmentResponseWithStatus.
private DetailedEnvironmentResponse getDetailedEnvironmentResponseWithStatus(EnvironmentStatus status) {
DetailedEnvironmentResponse env = new DetailedEnvironmentResponse();
env.setName("ENV");
env.setCloudPlatform("aws");
env.setEnvironmentStatus(status);
return env;
}
Aggregations