use of com.sequenceiq.common.api.cloudstorage.CloudStorageRequest in project cloudbreak by hortonworks.
the class CloudStorageManifester method initCloudStorageRequestFromExistingSdxCluster.
public CloudStorageRequest initCloudStorageRequestFromExistingSdxCluster(DetailedEnvironmentResponse environment, ClusterV4Response clusterV4Response, SdxCluster sdxCluster) {
boolean anyCloudStorageIsConfigured = !Strings.isNullOrEmpty(sdxCluster.getCloudStorageBaseLocation());
CloudStorageRequest cloudStorageRequest = new CloudStorageRequest();
if (anyCloudStorageIsConfigured) {
LOGGER.debug("Cloud storage configurations found in SDX cluster request.");
CloudStorageResponse cloudStorageResponse = clusterV4Response.getCloudStorage();
cloudStorageRequest.copy(cloudStorageResponse);
}
return cloudStorageRequest;
}
use of com.sequenceiq.common.api.cloudstorage.CloudStorageRequest in project cloudbreak by hortonworks.
the class CloudStorageValidatorTest method validateEnvironmentRequestCloudStorageValidationNoEntitlement.
@Test
public void validateEnvironmentRequestCloudStorageValidationNoEntitlement() {
when(environment.getCloudStorageValidation()).thenReturn(CloudStorageValidation.ENABLED);
when(entitlementService.cloudStorageValidationEnabled(any())).thenReturn(false);
ValidationResultBuilder validationResultBuilder = new ValidationResultBuilder();
ThreadBasedUserCrnProvider.doAs(USER_CRN, () -> underTest.validate(new CloudStorageRequest(), environment, validationResultBuilder));
assertFalse(validationResultBuilder.build().hasError());
}
use of com.sequenceiq.common.api.cloudstorage.CloudStorageRequest in project cloudbreak by hortonworks.
the class CloudStorageValidatorTest method validateEnvironmentRequestCloudStorageValidationMissingEntitlement.
@Test
public void validateEnvironmentRequestCloudStorageValidationMissingEntitlement() {
when(environment.getCloudStorageValidation()).thenReturn(CloudStorageValidation.ENABLED);
ValidationResultBuilder validationResultBuilder = new ValidationResultBuilder();
ThreadBasedUserCrnProvider.doAs(USER_CRN, () -> ThreadBasedUserCrnProvider.doAs(USER_CRN, () -> underTest.validate(new CloudStorageRequest(), environment, validationResultBuilder)));
assertFalse(validationResultBuilder.build().hasError());
}
use of com.sequenceiq.common.api.cloudstorage.CloudStorageRequest in project cloudbreak by hortonworks.
the class CloudStorageValidatorTest method validateEnvironmentRequestCloudStorageValidationDisabled.
@Test
public void validateEnvironmentRequestCloudStorageValidationDisabled() {
when(environment.getCloudStorageValidation()).thenReturn(CloudStorageValidation.DISABLED);
ValidationResultBuilder validationResultBuilder = new ValidationResultBuilder();
ThreadBasedUserCrnProvider.doAs(USER_CRN, () -> underTest.validate(new CloudStorageRequest(), environment, validationResultBuilder));
assertFalse(validationResultBuilder.build().hasError());
}
use of com.sequenceiq.common.api.cloudstorage.CloudStorageRequest in project cloudbreak by hortonworks.
the class StackRequestManifesterTest method setUp.
@BeforeEach
public void setUp() {
clusterV4Request = new ClusterV4Request();
cloudStorage = new CloudStorageRequest();
}
Aggregations