Search in sources :

Example 51 with CloudStorageRequest

use of com.sequenceiq.common.api.cloudstorage.CloudStorageRequest in project cloudbreak by hortonworks.

the class AzureAdlsGen2Tests method testCreateStopAndStartClusterWithAdlsGen2AndCloudStorage.

@Test(dataProvider = TEST_CONTEXT, enabled = false)
@Description(given = "there is a running cloudbreak", when = "a valid azure stack create request with attached ADLS Gen2 cloud storage and defined storage location is sent", and = "the stack is started", then = "the stack should be available AND deletable")
public void testCreateStopAndStartClusterWithAdlsGen2AndCloudStorage(TestContext testContext) {
    String name = resourcePropertyProvider().getName();
    CloudStorageRequest cloudStorageRequest = adlsGen2CloudStorageV4RequestWithStorageLocations(name);
    testContext.given("clusterWithAdlsGen2", ClusterTestDto.class).withCloudStorage(cloudStorageRequest).withName(name).given(StackTestDto.class).withCluster("clusterWithAdlsGen2").withName(name).when(stackTestClient.createV4()).await(STACK_AVAILABLE).then(stackTestClient.deleteV4()::action).then(stackContainsStorageLocations()).then(stackContainsAdlsGen2Properties()).validate();
}
Also used : CloudStorageRequest(com.sequenceiq.common.api.cloudstorage.CloudStorageRequest) ClusterTestDto(com.sequenceiq.it.cloudbreak.dto.ClusterTestDto) Description(com.sequenceiq.it.cloudbreak.context.Description) Test(org.testng.annotations.Test) AbstractE2ETest(com.sequenceiq.it.cloudbreak.testcase.e2e.AbstractE2ETest)

Example 52 with CloudStorageRequest

use of com.sequenceiq.common.api.cloudstorage.CloudStorageRequest in project cloudbreak by hortonworks.

the class AzureAdlsGen2Tests method adlsGen2CloudStorageV4RequestWithStorageLocations.

private CloudStorageRequest adlsGen2CloudStorageV4RequestWithStorageLocations(String clusterName) {
    CloudStorageRequest request = adlsGen2CloudStorageV4RequestWithoutStorageLocations();
    String accountName = azureProperties.getCloudStorage().getAccountName();
    String storageLocation = azureProperties.getCloudStorage().getBaseLocation();
    AzureTestStorageLocation azureStorageLocation = new AzureTestStorageLocation(accountName, clusterName, storageLocation);
    request.setLocations(azureStorageLocation.getAdlsGen2(LOCATION_STORAGE_COMPONENTS));
    return request;
}
Also used : CloudStorageRequest(com.sequenceiq.common.api.cloudstorage.CloudStorageRequest) AzureTestStorageLocation(com.sequenceiq.it.cloudbreak.util.storagelocation.AzureTestStorageLocation)

Example 53 with CloudStorageRequest

use of com.sequenceiq.common.api.cloudstorage.CloudStorageRequest in project cloudbreak by hortonworks.

the class AzureAdlsGen2Tests method adlsGen2CloudStorageV4RequestWithoutStorageLocations.

private CloudStorageRequest adlsGen2CloudStorageV4RequestWithoutStorageLocations() {
    CloudStorageRequest request = new CloudStorageRequest();
    AdlsGen2CloudStorageV1Parameters adlsGen2 = new AdlsGen2CloudStorageV1Parameters();
    String accountName = azureProperties.getCloudStorage().getAccountName();
    String accountKey = azureProperties.getCloudStorage().getAccountKey();
    adlsGen2.setAccountKey(accountKey);
    adlsGen2.setAccountName(accountName);
    StorageLocationBase storageLocationBase = new StorageLocationBase();
    storageLocationBase.setType(CloudStorageCdpService.RANGER_AUDIT);
    storageLocationBase.setValue("somePath");
    request.setLocations(List.of(storageLocationBase));
    StorageIdentityBase storageIdentityBase = new StorageIdentityBase();
    storageIdentityBase.setAdlsGen2(adlsGen2);
    request.setIdentities(List.of(storageIdentityBase));
    return request;
}
Also used : CloudStorageRequest(com.sequenceiq.common.api.cloudstorage.CloudStorageRequest) AdlsGen2CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters) StorageLocationBase(com.sequenceiq.common.api.cloudstorage.StorageLocationBase) StorageIdentityBase(com.sequenceiq.common.api.cloudstorage.StorageIdentityBase)

Aggregations

CloudStorageRequest (com.sequenceiq.common.api.cloudstorage.CloudStorageRequest)53 Test (org.junit.jupiter.api.Test)27 StorageLocationBase (com.sequenceiq.common.api.cloudstorage.StorageLocationBase)24 DetailedEnvironmentResponse (com.sequenceiq.environment.api.v1.environment.model.response.DetailedEnvironmentResponse)16 CloudStorageCdpService (com.sequenceiq.common.model.CloudStorageCdpService)15 SdxCloudStorageRequest (com.sequenceiq.sdx.api.model.SdxCloudStorageRequest)15 ClusterV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request)14 LoggingResponse (com.sequenceiq.common.api.telemetry.response.LoggingResponse)14 ArrayList (java.util.ArrayList)14 TelemetryResponse (com.sequenceiq.common.api.telemetry.response.TelemetryResponse)13 FileSystemType (com.sequenceiq.common.model.FileSystemType)13 List (java.util.List)12 StorageIdentityBase (com.sequenceiq.common.api.cloudstorage.StorageIdentityBase)11 CloudIdentityType (com.sequenceiq.common.model.CloudIdentityType)11 Assertions.assertEquals (org.junit.jupiter.api.Assertions.assertEquals)10 Assertions.assertNull (org.junit.jupiter.api.Assertions.assertNull)10 ExtendWith (org.junit.jupiter.api.extension.ExtendWith)10 InjectMocks (org.mockito.InjectMocks)10 Mock (org.mockito.Mock)10 Mockito.when (org.mockito.Mockito.when)10