use of com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters in project cloudbreak by hortonworks.
the class BackupConverterTest method testConvertFromAzureRequest.
@Test
public void testConvertFromAzureRequest() {
// GIVEN
BackupRequest backupRequest = new BackupRequest();
AdlsGen2CloudStorageV1Parameters adlsGen2CloudStorageV1Parameters = new AdlsGen2CloudStorageV1Parameters();
adlsGen2CloudStorageV1Parameters.setAccountKey("someaccount");
backupRequest.setAdlsGen2(adlsGen2CloudStorageV1Parameters);
backupRequest.setStorageLocation("abfs://mybucket@someaccount");
// WHEN
Backup result = underTest.convert(backupRequest);
// THEN
assertThat(result.getStorageLocation(), is("abfs://mybucket@someaccount"));
}
use of com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters in project cloudbreak by hortonworks.
the class StackToCloudStackConverterTest method testBuildFileSystemViewSameAzureManagedIdentity.
@Test
public void testBuildFileSystemViewSameAzureManagedIdentity() throws Exception {
Telemetry telemetry = mock(Telemetry.class);
Backup backup = mock(Backup.class);
Logging logging = mock(Logging.class);
AdlsGen2CloudStorageV1Parameters adlsGen2Logging = new AdlsGen2CloudStorageV1Parameters();
adlsGen2Logging.setManagedIdentity("/subscriptions/id/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity");
AdlsGen2CloudStorageV1Parameters adlsGen2Backup = new AdlsGen2CloudStorageV1Parameters();
adlsGen2Backup.setManagedIdentity("/subscriptions/id/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity");
when(stack.getTelemetry()).thenReturn(telemetry);
when(telemetry.getLogging()).thenReturn(logging);
when(stack.getBackup()).thenReturn(backup);
when(backup.getAdlsGen2()).thenReturn(adlsGen2Logging);
when(logging.getAdlsGen2()).thenReturn(adlsGen2Backup);
Optional<CloudFileSystemView> fileSystemView = underTest.buildFileSystemView(stack);
assertEquals(Optional.empty(), fileSystemView);
}
use of com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters in project cloudbreak by hortonworks.
the class AdlsGen2CloudStorageParametersValidatorTest method create.
private AdlsGen2CloudStorageV1Parameters create(String accountName, String accountKey, String managedIdentity) {
AdlsGen2CloudStorageV1Parameters adlsGen2CloudStorageParameters = new AdlsGen2CloudStorageV1Parameters();
adlsGen2CloudStorageParameters.setAccountKey(accountKey);
adlsGen2CloudStorageParameters.setAccountName(accountName);
adlsGen2CloudStorageParameters.setManagedIdentity(managedIdentity);
return adlsGen2CloudStorageParameters;
}
use of com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters in project cloudbreak by hortonworks.
the class FluentConfigServiceTest method testCreateFluentConfigWithoutScheme.
@Test
public void testCreateFluentConfigWithoutScheme() {
// GIVEN
Logging logging = new Logging();
logging.setStorageLocation("mycontainer/cluster-logs/datahub/cl1@myaccount.dfs.core.windows.net");
AdlsGen2CloudStorageV1Parameters parameters = new AdlsGen2CloudStorageV1Parameters();
parameters.setAccountKey("myAccountKey");
logging.setAdlsGen2(parameters);
Telemetry telemetry = new Telemetry();
telemetry.setLogging(logging);
// WHEN
FluentConfigView result = underTest.createFluentConfigs(DEFAULT_FLUENT_CLUSTER_DETAILS, false, false, REGION_SAMPLE, telemetry);
// THEN
assertTrue(result.isEnabled());
assertEquals("myAccountKey", result.getAzureStorageAccessKey());
assertEquals("/cluster-logs/datahub/cl1", result.getLogFolderName());
assertEquals("mycontainer", result.getAzureContainer());
}
use of com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters in project cloudbreak by hortonworks.
the class FluentConfigServiceTest method testCreateFluentConfigWithoutLocation.
@Test(expected = CloudbreakServiceException.class)
public void testCreateFluentConfigWithoutLocation() {
// GIVEN
Logging logging = new Logging();
logging.setStorageLocation(null);
logging.setAdlsGen2(new AdlsGen2CloudStorageV1Parameters());
Telemetry telemetry = new Telemetry();
telemetry.setLogging(logging);
// WHEN
underTest.createFluentConfigs(DEFAULT_FLUENT_CLUSTER_DETAILS, false, false, REGION_SAMPLE, telemetry);
}
Aggregations