use of com.sequenceiq.common.api.cloudstorage.old.GcsCloudStorageV1Parameters in project cloudbreak by hortonworks.
the class StorageIdentityValidatorTest method testCloudStorageValidationWithMoreThanOneStorageParameter.
@Test
void testCloudStorageValidationWithMoreThanOneStorageParameter() {
StorageIdentityBase storage = new StorageIdentityBase();
storage.setType(CloudIdentityType.LOG);
S3CloudStorageV1Parameters s3 = new S3CloudStorageV1Parameters();
s3.setInstanceProfile("instace::profile");
storage.setS3(s3);
GcsCloudStorageV1Parameters gcs = new GcsCloudStorageV1Parameters();
gcs.setServiceAccountEmail("service.account@googlecloud.com");
storage.setGcs(gcs);
Set<ConstraintViolation<StorageIdentityBase>> constraintViolations = validator.validate(storage);
assertEquals(1, constraintViolations.size());
ConstraintViolation<StorageIdentityBase> violation = constraintViolations.iterator().next();
assertEquals(ValidCloudStorage.MESSAGE, violation.getMessage());
}
use of com.sequenceiq.common.api.cloudstorage.old.GcsCloudStorageV1Parameters in project cloudbreak by hortonworks.
the class EnvironmentBackupStorageConfigurationValidatorTest method validateBackupStorageConfigGcpWhenConfigValidationFailed.
@Test
public void validateBackupStorageConfigGcpWhenConfigValidationFailed() {
when(environment.getCloudPlatform()).thenReturn(CloudConstants.GCP);
when(environment.getBackup()).thenReturn(backup);
GcsCloudStorageV1Parameters gcp = new GcsCloudStorageV1Parameters();
gcp.setServiceAccountEmail("admin1@dev-cdp.iam.gservice-account.com");
when(backup.getGcs()).thenReturn(gcp);
ValidationResult result = underTest.validateBackupStorageConfiguration(environment);
assertTrue(result.hasError());
}
use of com.sequenceiq.common.api.cloudstorage.old.GcsCloudStorageV1Parameters in project cloudbreak by hortonworks.
the class BackupConverter method convertGcs.
private GcsCloudStorageV1Parameters convertGcs(GcsCloudStorageV1Parameters gcs) {
GcsCloudStorageV1Parameters gcsCloudStorageV1Parameters = null;
if (gcs != null) {
gcsCloudStorageV1Parameters = new GcsCloudStorageV1Parameters();
gcsCloudStorageV1Parameters.setServiceAccountEmail(gcs.getServiceAccountEmail());
}
return gcsCloudStorageV1Parameters;
}
use of com.sequenceiq.common.api.cloudstorage.old.GcsCloudStorageV1Parameters in project cloudbreak by hortonworks.
the class GcpCloudProvider method loggingRequest.
@Override
public LoggingRequest loggingRequest(TelemetryTestDto dto) {
GcsCloudStorageV1Parameters gcsCloudStorageV1Parameters = new GcsCloudStorageV1Parameters();
gcsCloudStorageV1Parameters.setServiceAccountEmail(getServiceAccountEmail());
LoggingRequest loggingRequest = new LoggingRequest();
loggingRequest.setGcs(gcsCloudStorageV1Parameters);
loggingRequest.setStorageLocation(getBaseLocation());
return loggingRequest;
}
use of com.sequenceiq.common.api.cloudstorage.old.GcsCloudStorageV1Parameters in project cloudbreak by hortonworks.
the class StorageValidationServiceTest method whenGcsConfiguredWithServiceAccountShouldNotThrowException.
@Test
public void whenGcsConfiguredWithServiceAccountShouldNotThrowException() {
SdxCloudStorageRequest cloudStorageRequest = new SdxCloudStorageRequest();
cloudStorageRequest.setBaseLocation("gs://example-path");
cloudStorageRequest.setFileSystemType(FileSystemType.GCS);
GcsCloudStorageV1Parameters gcs = new GcsCloudStorageV1Parameters();
gcs.setServiceAccountEmail("mail");
cloudStorageRequest.setGcs(gcs);
underTest.validateCloudStorage("GCP", cloudStorageRequest);
}
Aggregations