use of com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters in project cloudbreak by hortonworks.
the class StorageIdentityValidatorTest method testCloudStorageValidation.
@Test
void testCloudStorageValidation() {
StorageIdentityBase storage = new StorageIdentityBase();
S3CloudStorageV1Parameters s3 = new S3CloudStorageV1Parameters();
s3.setInstanceProfile("instace::profile");
storage.setS3(s3);
storage.setType(CloudIdentityType.LOG);
Set<ConstraintViolation<StorageIdentityBase>> constraintViolations = validator.validate(storage);
assertTrue(constraintViolations.isEmpty());
}
use of com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters in project cloudbreak by hortonworks.
the class SdxServiceTest method withCloudStorage.
private void withCloudStorage(SdxClusterRequestBase sdxClusterRequest) {
SdxCloudStorageRequest cloudStorage = new SdxCloudStorageRequest();
cloudStorage.setFileSystemType(FileSystemType.S3);
cloudStorage.setBaseLocation("s3a://some/dir/");
cloudStorage.setS3(new S3CloudStorageV1Parameters());
sdxClusterRequest.setCloudStorage(cloudStorage);
}
use of com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters in project cloudbreak by hortonworks.
the class StorageValidationServiceTest method throwErrorWhenS3LocationInvalid.
@Test
public void throwErrorWhenS3LocationInvalid() {
SdxCloudStorageRequest cloudStorageRequest = new SdxCloudStorageRequest();
cloudStorageRequest.setBaseLocation("cloudbreakbucket/something");
S3CloudStorageV1Parameters params = new S3CloudStorageV1Parameters();
params.setInstanceProfile("instanceProfile");
cloudStorageRequest.setS3(params);
BadRequestException exception = Assertions.assertThrows(BadRequestException.class, () -> underTest.validateCloudStorage(CloudPlatform.AWS.toString(), cloudStorageRequest));
assertEquals(exception.getMessage(), "AWS baselocation missing protocol. please specify s3a://");
}
use of com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters in project cloudbreak by hortonworks.
the class StorageValidationServiceTest method okWhenS3LocationIsValid.
@Test
public void okWhenS3LocationIsValid() {
SdxCloudStorageRequest cloudStorageRequest = new SdxCloudStorageRequest();
cloudStorageRequest.setBaseLocation("s3a://cloudbreakbucket/something");
S3CloudStorageV1Parameters params = new S3CloudStorageV1Parameters();
params.setInstanceProfile("instanceProfile");
cloudStorageRequest.setS3(params);
underTest.validateCloudStorage(CloudPlatform.AWS.toString(), cloudStorageRequest);
}
use of com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters in project cloudbreak by hortonworks.
the class StorageValidationServiceTest method whenAwsConfiguredWithoutRoleShouldThrowException.
@Test
public void whenAwsConfiguredWithoutRoleShouldThrowException() {
SdxCloudStorageRequest cloudStorageRequest = new SdxCloudStorageRequest();
cloudStorageRequest.setBaseLocation("s3a://example-path");
cloudStorageRequest.setFileSystemType(FileSystemType.S3);
S3CloudStorageV1Parameters s3 = new S3CloudStorageV1Parameters();
s3.setInstanceProfile(null);
cloudStorageRequest.setS3(s3);
Assertions.assertThrows(BadRequestException.class, () -> underTest.validateCloudStorage("AWS", cloudStorageRequest));
}
Aggregations