use of com.sequenceiq.common.api.telemetry.model.Logging in project cloudbreak by hortonworks.
the class FluentConfigServiceTest method testCreateFluentConfigWithDoublePath.
@Test(expected = CloudbreakServiceException.class)
public void testCreateFluentConfigWithDoublePath() {
// GIVEN
Logging logging = new Logging();
logging.setStorageLocation("abfs://mycontainer/my/custom/path@myaccount.dfs.core.windows.net/my/custom/path");
AdlsGen2CloudStorageV1Parameters parameters = new AdlsGen2CloudStorageV1Parameters();
parameters.setAccountKey("myAccountKey");
logging.setAdlsGen2(parameters);
Telemetry telemetry = new Telemetry();
telemetry.setLogging(logging);
// WHEN
underTest.createFluentConfigs(DEFAULT_FLUENT_CLUSTER_DETAILS, false, false, REGION_SAMPLE, telemetry);
}
use of com.sequenceiq.common.api.telemetry.model.Logging in project cloudbreak by hortonworks.
the class CloudStorageFolderResolverServiceTest method createTelemetry.
private Telemetry createTelemetry() {
Telemetry telemetry = new Telemetry();
Logging logging = new Logging();
logging.setStorageLocation("s3://mybucket");
logging.setS3(new S3CloudStorageV1Parameters());
telemetry.setLogging(logging);
return telemetry;
}
use of com.sequenceiq.common.api.telemetry.model.Logging in project cloudbreak by hortonworks.
the class DiiagnosticsCollectionValidatorTest method testValidateWithCloudStorageWithEmptyTelemetryLoggingSetting.
@Test
void testValidateWithCloudStorageWithEmptyTelemetryLoggingSetting() {
BaseDiagnosticsCollectionRequest request = new BaseDiagnosticsCollectionRequest();
request.setDestination(DiagnosticsDestination.CLOUD_STORAGE);
Telemetry telemetry = new Telemetry();
telemetry.setLogging(new Logging());
BadRequestException thrown = assertThrows(BadRequestException.class, () -> underTest.validate(request, createStackWithTelemetry(telemetry)));
assertTrue(thrown.getMessage().contains("S3, ABFS or GCS cloud storage logging setting should be enabled for FreeIPA"));
}
use of com.sequenceiq.common.api.telemetry.model.Logging in project cloudbreak by hortonworks.
the class StackToCloudStackConverterTest method testBuildFileSystemViewDifferentGCPEmail.
@Test
public void testBuildFileSystemViewDifferentGCPEmail() throws Exception {
Telemetry telemetry = mock(Telemetry.class);
Backup backup = mock(Backup.class);
Logging logging = mock(Logging.class);
GcsCloudStorageV1Parameters gcsLogging = new GcsCloudStorageV1Parameters();
gcsLogging.setServiceAccountEmail("myaccount1@myprojectid.iam.gserviceaccount.com");
GcsCloudStorageV1Parameters gcsBackup = new GcsCloudStorageV1Parameters();
gcsBackup.setServiceAccountEmail("myaccount2@myprojectid.iam.gserviceaccount.com");
when(stack.getTelemetry()).thenReturn(telemetry);
when(telemetry.getLogging()).thenReturn(logging);
when(stack.getBackup()).thenReturn(backup);
when(backup.getGcs()).thenReturn(gcsBackup);
when(logging.getGcs()).thenReturn(gcsLogging);
expectedException.expect(BadRequestException.class);
underTest.buildFileSystemView(stack);
}
use of com.sequenceiq.common.api.telemetry.model.Logging in project cloudbreak by hortonworks.
the class StackToCloudStackConverterTest method testBuildFileSystemViewDifferentAzureManagedIdentity.
@Test
public void testBuildFileSystemViewDifferentAzureManagedIdentity() 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/identity1");
AdlsGen2CloudStorageV1Parameters adlsGen2Backup = new AdlsGen2CloudStorageV1Parameters();
adlsGen2Backup.setManagedIdentity("/subscriptions/id/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2");
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);
expectedException.expect(BadRequestException.class);
underTest.buildFileSystemView(stack);
}
Aggregations