use of com.sequenceiq.environment.environment.dto.telemetry.EnvironmentTelemetry in project cloudbreak by hortonworks.
the class TelemetryApiConverterTest method testConvertWithDefaultFeatures.
@Test
public void testConvertWithDefaultFeatures() {
// GIVEN
TelemetryRequest telemetryRequest = new TelemetryRequest();
FeaturesRequest fr = new FeaturesRequest();
telemetryRequest.setFeatures(fr);
// WHEN
EnvironmentTelemetry result = underTest.convert(telemetryRequest, new Features(), ACCOUNT_ID);
// THEN
assertNull(result.getFeatures().getWorkloadAnalytics());
}
use of com.sequenceiq.environment.environment.dto.telemetry.EnvironmentTelemetry in project cloudbreak by hortonworks.
the class TelemetryApiConverterTest method testConvert.
@Test
public void testConvert() {
// GIVEN
TelemetryRequest telemetryRequest = new TelemetryRequest();
LoggingRequest loggingRequest = new LoggingRequest();
S3CloudStorageV1Parameters s3Params = new S3CloudStorageV1Parameters();
s3Params.setInstanceProfile(INSTANCE_PROFILE_VALUE);
loggingRequest.setS3(s3Params);
telemetryRequest.setLogging(loggingRequest);
telemetryRequest.setWorkloadAnalytics(new WorkloadAnalyticsRequest());
FeaturesRequest fr = new FeaturesRequest();
fr.addClusterLogsCollection(true);
fr.addWorkloadAnalytics(true);
fr.addMonitoring(true);
telemetryRequest.setFeatures(fr);
given(entitlementService.isCdpSaasEnabled(anyString())).willReturn(true);
// WHEN
EnvironmentTelemetry result = underTest.convert(telemetryRequest, new Features(), ACCOUNT_ID);
// THEN
assertEquals(INSTANCE_PROFILE_VALUE, result.getLogging().getS3().getInstanceProfile());
assertEquals("http://myaddress/api/v1/receive", result.getMonitoring().getRemoteWriteUrl());
assertTrue(result.getFeatures().getClusterLogsCollection().isEnabled());
assertTrue(result.getFeatures().getWorkloadAnalytics().isEnabled());
assertTrue(result.getFeatures().getUseSharedAltusCredential().isEnabled());
assertTrue(result.getFeatures().getMonitoring().isEnabled());
assertTrue(result.getFeatures().getCloudStorageLogging().isEnabled());
}
use of com.sequenceiq.environment.environment.dto.telemetry.EnvironmentTelemetry in project cloudbreak by hortonworks.
the class TelemetryApiConverterTest method testConvertWithMonitoringFeatureWithoutCdpSaas.
@Test
public void testConvertWithMonitoringFeatureWithoutCdpSaas() {
// GIVEN
TelemetryRequest telemetryRequest = new TelemetryRequest();
given(entitlementService.isCdpSaasEnabled(anyString())).willReturn(false);
FeaturesRequest featuresRequest = new FeaturesRequest();
featuresRequest.addMonitoring(true);
telemetryRequest.setFeatures(featuresRequest);
// WHEN
EnvironmentTelemetry result = underTest.convert(telemetryRequest, new Features(), ACCOUNT_ID);
// THEN
assertTrue(result.getFeatures().getMonitoring().isEnabled());
assertNull(result.getMonitoring().getRemoteWriteUrl());
}
use of com.sequenceiq.environment.environment.dto.telemetry.EnvironmentTelemetry in project cloudbreak by hortonworks.
the class TelemetryApiConverterTest method testConvertWithWAFeature.
@Test
public void testConvertWithWAFeature() {
// GIVEN
TelemetryRequest telemetryRequest = new TelemetryRequest();
FeaturesRequest fr = new FeaturesRequest();
fr.addWorkloadAnalytics(true);
telemetryRequest.setFeatures(fr);
// WHEN
EnvironmentTelemetry result = underTest.convert(telemetryRequest, new Features(), ACCOUNT_ID);
// THEN
assertTrue(result.getFeatures().getWorkloadAnalytics().isEnabled());
}
use of com.sequenceiq.environment.environment.dto.telemetry.EnvironmentTelemetry in project cloudbreak by hortonworks.
the class TelemetryApiConverterTest method testConvertWithDefaults.
@Test
public void testConvertWithDefaults() {
// GIVEN
TelemetryRequest telemetryRequest = new TelemetryRequest();
// WHEN
EnvironmentTelemetry result = underTest.convert(telemetryRequest, new Features(), ACCOUNT_ID);
// THEN
assertNull(result.getFeatures());
}
Aggregations