use of com.sequenceiq.common.api.cloudstorage.old.GcsCloudStorageV1Parameters in project cloudbreak by hortonworks.
the class StorageValidationServiceTest method whenGcsConfiguredWithoutRoleShouldThrowException.
@Test
public void whenGcsConfiguredWithoutRoleShouldThrowException() {
SdxCloudStorageRequest cloudStorageRequest = new SdxCloudStorageRequest();
cloudStorageRequest.setBaseLocation("gs://example-path");
cloudStorageRequest.setFileSystemType(FileSystemType.GCS);
GcsCloudStorageV1Parameters gcs = new GcsCloudStorageV1Parameters();
gcs.setServiceAccountEmail(null);
cloudStorageRequest.setGcs(gcs);
Assertions.assertThrows(BadRequestException.class, () -> underTest.validateCloudStorage("GCP", cloudStorageRequest));
}
use of com.sequenceiq.common.api.cloudstorage.old.GcsCloudStorageV1Parameters in project cloudbreak by hortonworks.
the class EnvironmentBackupStorageConfigurationValidatorTest method validateBackupStorageConfigGcpWhenConfigValidationSuccess.
@Test
public void validateBackupStorageConfigGcpWhenConfigValidationSuccess() {
when(environment.getCloudPlatform()).thenReturn(CloudConstants.GCP);
when(environment.getBackup()).thenReturn(backup);
GcsCloudStorageV1Parameters gcp = new GcsCloudStorageV1Parameters();
gcp.setServiceAccountEmail("admin1@dev-cdp.iam.gserviceaccount.com");
when(backup.getGcs()).thenReturn(gcp);
ValidationResult result = underTest.validateBackupStorageConfiguration(environment);
assertFalse(result.hasError());
}
use of com.sequenceiq.common.api.cloudstorage.old.GcsCloudStorageV1Parameters in project cloudbreak by hortonworks.
the class EnvironmentLogStorageConfigurationValidatorTest method validateTelemetryStorageConfigGcpWhenConfigValidationFailed.
@Test
public void validateTelemetryStorageConfigGcpWhenConfigValidationFailed() {
when(environment.getCloudPlatform()).thenReturn(CloudConstants.GCP);
when(environment.getTelemetry()).thenReturn(telemetry);
when(telemetry.getLogging()).thenReturn(logging);
GcsCloudStorageV1Parameters gcp = new GcsCloudStorageV1Parameters();
gcp.setServiceAccountEmail("admin1@dev-cdp.iam.gservice-account.com");
when(logging.getGcs()).thenReturn(gcp);
ValidationResult result = underTest.validateTelemetryLoggingStorageConfiguration(environment);
assertTrue(result.hasError());
}
use of com.sequenceiq.common.api.cloudstorage.old.GcsCloudStorageV1Parameters in project cloudbreak by hortonworks.
the class EnvironmentLogStorageConfigurationValidatorTest method validateTelemetryStorageConfigGcpWhenConfigValidationSuccess.
@Test
public void validateTelemetryStorageConfigGcpWhenConfigValidationSuccess() {
when(environment.getCloudPlatform()).thenReturn(CloudConstants.GCP);
when(environment.getTelemetry()).thenReturn(telemetry);
when(telemetry.getLogging()).thenReturn(logging);
GcsCloudStorageV1Parameters gcp = new GcsCloudStorageV1Parameters();
gcp.setServiceAccountEmail("admin1@dev-cdp.iam.gserviceaccount.com");
when(logging.getGcs()).thenReturn(gcp);
ValidationResult result = underTest.validateTelemetryLoggingStorageConfiguration(environment);
assertFalse(result.hasError());
}
use of com.sequenceiq.common.api.cloudstorage.old.GcsCloudStorageV1Parameters in project cloudbreak by hortonworks.
the class CloudStorageValidationUtilTest method testIsCloudStorageConfiguredWhenGcsNotNull.
@Test
public void testIsCloudStorageConfiguredWhenGcsNotNull() {
CloudStorageRequest cloudStorageRequest = new CloudStorageRequest();
StorageIdentityBase storageIdentityBase = new StorageIdentityBase();
storageIdentityBase.setGcs(new GcsCloudStorageV1Parameters());
cloudStorageRequest.setIdentities(List.of(storageIdentityBase));
cloudStorageRequest.setLocations(List.of(new StorageLocationBase()));
boolean actual = underTest.isCloudStorageConfigured(cloudStorageRequest);
Assert.assertTrue(actual);
}
Aggregations