Search in sources :

Example 1 with SdxCloudStorageRequest

use of com.sequenceiq.sdx.api.model.SdxCloudStorageRequest in project cloudbreak by hortonworks.

the class StorageValidationServiceTest method whenAzureNotEvenConfiguredWithManagedIdentityShouldNotThrowException.

@Test
public void whenAzureNotEvenConfiguredWithManagedIdentityShouldNotThrowException() {
    SdxCloudStorageRequest cloudStorageRequest = new SdxCloudStorageRequest();
    cloudStorageRequest.setBaseLocation("abfs://example-path");
    cloudStorageRequest.setFileSystemType(FileSystemType.ADLS_GEN_2);
    cloudStorageRequest.setAdlsGen2(null);
    Assertions.assertThrows(BadRequestException.class, () -> underTest.validateCloudStorage("AZURE", cloudStorageRequest));
}
Also used : SdxCloudStorageRequest(com.sequenceiq.sdx.api.model.SdxCloudStorageRequest) Test(org.junit.jupiter.api.Test)

Example 2 with SdxCloudStorageRequest

use of com.sequenceiq.sdx.api.model.SdxCloudStorageRequest in project cloudbreak by hortonworks.

the class StorageValidationServiceTest method whenGcsNotEvenConfiguredWithServiceAccountShouldNotThrowException.

@Test
public void whenGcsNotEvenConfiguredWithServiceAccountShouldNotThrowException() {
    SdxCloudStorageRequest cloudStorageRequest = new SdxCloudStorageRequest();
    cloudStorageRequest.setBaseLocation("gs://example-path");
    cloudStorageRequest.setFileSystemType(FileSystemType.GCS);
    cloudStorageRequest.setGcs(null);
    Assertions.assertThrows(BadRequestException.class, () -> underTest.validateCloudStorage("GCP", cloudStorageRequest));
}
Also used : SdxCloudStorageRequest(com.sequenceiq.sdx.api.model.SdxCloudStorageRequest) Test(org.junit.jupiter.api.Test)

Example 3 with SdxCloudStorageRequest

use of com.sequenceiq.sdx.api.model.SdxCloudStorageRequest in project cloudbreak by hortonworks.

the class StorageValidationServiceTest method whenAzureConfiguredWithoutManagedIdentityShouldThrowException.

@Test
public void whenAzureConfiguredWithoutManagedIdentityShouldThrowException() {
    SdxCloudStorageRequest cloudStorageRequest = new SdxCloudStorageRequest();
    cloudStorageRequest.setBaseLocation("abfs://example-path");
    cloudStorageRequest.setFileSystemType(FileSystemType.ADLS_GEN_2);
    AdlsGen2CloudStorageV1Parameters adlsGen2 = new AdlsGen2CloudStorageV1Parameters();
    adlsGen2.setManagedIdentity(null);
    cloudStorageRequest.setAdlsGen2(adlsGen2);
    Assertions.assertThrows(BadRequestException.class, () -> underTest.validateCloudStorage("AZURE", cloudStorageRequest));
}
Also used : SdxCloudStorageRequest(com.sequenceiq.sdx.api.model.SdxCloudStorageRequest) AdlsGen2CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters) Test(org.junit.jupiter.api.Test)

Example 4 with SdxCloudStorageRequest

use of com.sequenceiq.sdx.api.model.SdxCloudStorageRequest in project cloudbreak by hortonworks.

the class StorageValidationServiceTest method whenAwsNotEvenConfiguredWithRoleShouldNotThrowException.

@Test
public void whenAwsNotEvenConfiguredWithRoleShouldNotThrowException() {
    SdxCloudStorageRequest cloudStorageRequest = new SdxCloudStorageRequest();
    cloudStorageRequest.setBaseLocation("s3a://example-path");
    cloudStorageRequest.setFileSystemType(FileSystemType.S3);
    cloudStorageRequest.setS3(null);
    Assertions.assertThrows(BadRequestException.class, () -> underTest.validateCloudStorage("AWS", cloudStorageRequest));
}
Also used : SdxCloudStorageRequest(com.sequenceiq.sdx.api.model.SdxCloudStorageRequest) Test(org.junit.jupiter.api.Test)

Example 5 with SdxCloudStorageRequest

use of com.sequenceiq.sdx.api.model.SdxCloudStorageRequest 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);
}
Also used : SdxCloudStorageRequest(com.sequenceiq.sdx.api.model.SdxCloudStorageRequest) GcsCloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.GcsCloudStorageV1Parameters) Test(org.junit.jupiter.api.Test)

Aggregations

SdxCloudStorageRequest (com.sequenceiq.sdx.api.model.SdxCloudStorageRequest)20 Test (org.junit.jupiter.api.Test)16 S3CloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters)9 CloudStorageRequest (com.sequenceiq.common.api.cloudstorage.CloudStorageRequest)5 GcsCloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.GcsCloudStorageV1Parameters)4 DetailedEnvironmentResponse (com.sequenceiq.environment.api.v1.environment.model.response.DetailedEnvironmentResponse)4 SdxClusterRequest (com.sequenceiq.sdx.api.model.SdxClusterRequest)4 FileSystemParameterV4Responses (com.sequenceiq.cloudbreak.api.endpoint.v4.filesystems.responses.FileSystemParameterV4Responses)3 ClusterV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request)3 StorageLocationBase (com.sequenceiq.common.api.cloudstorage.StorageLocationBase)3 SdxCluster (com.sequenceiq.datalake.entity.SdxCluster)3 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)3 FileSystemV4Endpoint (com.sequenceiq.cloudbreak.api.endpoint.v4.filesystems.FileSystemV4Endpoint)2 FileSystemParameterV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.filesystems.responses.FileSystemParameterV4Response)2 ThreadBasedUserCrnProvider (com.sequenceiq.cloudbreak.auth.ThreadBasedUserCrnProvider)2 RegionAwareInternalCrnGenerator (com.sequenceiq.cloudbreak.auth.crn.RegionAwareInternalCrnGenerator)2 RegionAwareInternalCrnGeneratorFactory (com.sequenceiq.cloudbreak.auth.crn.RegionAwareInternalCrnGeneratorFactory)2 BadRequestException (com.sequenceiq.cloudbreak.common.exception.BadRequestException)2 LoggingResponse (com.sequenceiq.common.api.telemetry.response.LoggingResponse)2 TelemetryResponse (com.sequenceiq.common.api.telemetry.response.TelemetryResponse)2