use of com.sequenceiq.common.api.type.FeatureSetting in project cloudbreak by hortonworks.
the class DiagnosticsCollectionValidatorTest 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, createStack(), telemetry);
}
use of com.sequenceiq.common.api.type.FeatureSetting 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.type.FeatureSetting 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.type.FeatureSetting in project cloudbreak by hortonworks.
the class EnvironmentDetailsToCDPEnvironmentTelemetryFeatureDetailsConverterTest method testConversionTelemetry.
@Test
public void testConversionTelemetry() {
FeatureSetting clusterLogsCollection = new FeatureSetting();
clusterLogsCollection.setEnabled(Boolean.TRUE);
FeatureSetting workloadAnalytics = new FeatureSetting();
workloadAnalytics.setEnabled(Boolean.FALSE);
when(environmentDetails.getEnvironmentTelemetryFeatures()).thenReturn(environmentFeatures);
when(environmentFeatures.getClusterLogsCollection()).thenReturn(clusterLogsCollection);
when(environmentFeatures.getWorkloadAnalytics()).thenReturn(workloadAnalytics);
UsageProto.CDPEnvironmentTelemetryFeatureDetails telemetryFeatureDetails = underTest.convert(environmentDetails);
Assertions.assertEquals("true", telemetryFeatureDetails.getClusterLogsCollection());
Assertions.assertEquals("false", telemetryFeatureDetails.getWorkloadAnalytics());
}
use of com.sequenceiq.common.api.type.FeatureSetting in project cloudbreak by hortonworks.
the class EnvironmentFeatures method addMonitoring.
@JsonIgnore
public void addMonitoring(boolean enabled) {
monitoring = new FeatureSetting();
monitoring.setEnabled(enabled);
}
Aggregations