use of com.sequenceiq.common.api.telemetry.model.Telemetry in project cloudbreak by hortonworks.
the class DiiagnosticsCollectionValidatorTest method testValidateWithValidEngDestination.
@Test
void testValidateWithValidEngDestination() {
BaseDiagnosticsCollectionRequest request = new BaseDiagnosticsCollectionRequest();
request.setDestination(DiagnosticsDestination.ENG);
Telemetry telemetry = new Telemetry();
Features features = new Features();
FeatureSetting clusterLogsCollection = new FeatureSetting();
clusterLogsCollection.setEnabled(true);
features.setClusterLogsCollection(clusterLogsCollection);
telemetry.setFeatures(features);
underTest.validate(request, createStackWithTelemetry(telemetry));
}
use of com.sequenceiq.common.api.telemetry.model.Telemetry in project cloudbreak by hortonworks.
the class DiiagnosticsCollectionValidatorTest method testValidateWithValidEngDestinationButWithWrongVersion.
@Test
void testValidateWithValidEngDestinationButWithWrongVersion() {
BaseDiagnosticsCollectionRequest request = new BaseDiagnosticsCollectionRequest();
request.setDestination(DiagnosticsDestination.ENG);
Telemetry telemetry = new Telemetry();
Features features = new Features();
FeatureSetting clusterLogsCollection = new FeatureSetting();
clusterLogsCollection.setEnabled(true);
features.setClusterLogsCollection(clusterLogsCollection);
telemetry.setFeatures(features);
Stack stack = createStackWithTelemetry(telemetry);
stack.setAppVersion("2.32.0-b48");
BadRequestException thrown = assertThrows(BadRequestException.class, () -> underTest.validate(request, stack));
assertTrue(thrown.getMessage().contains("Required FreeIPA min major/minor version is 2.33"));
}
use of com.sequenceiq.common.api.telemetry.model.Telemetry in project cloudbreak by hortonworks.
the class DiiagnosticsCollectionValidatorTest method testValidateWithSupportDestination.
@Test
void testValidateWithSupportDestination() {
BaseDiagnosticsCollectionRequest request = new BaseDiagnosticsCollectionRequest();
request.setDestination(DiagnosticsDestination.SUPPORT);
Telemetry telemetry = new Telemetry();
BadRequestException thrown = assertThrows(BadRequestException.class, () -> underTest.validate(request, createStackWithTelemetry(telemetry)));
assertTrue(thrown.getMessage().contains("Destination SUPPORT is not supported yet."));
}
use of com.sequenceiq.common.api.telemetry.model.Telemetry 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.Telemetry 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