use of com.sequenceiq.common.api.telemetry.request.TelemetryRequest in project cloudbreak by hortonworks.
the class TelemetryConverterTest method testConvertFromEnvAndSdxResponseWithClusterLogsCollectionDisabled.
@Test
public void testConvertFromEnvAndSdxResponseWithClusterLogsCollectionDisabled() {
// GIVEN
TelemetryResponse response = new TelemetryResponse();
FeaturesResponse featuresResponse = new FeaturesResponse();
featuresResponse.addClusterLogsCollection(false);
response.setFeatures(featuresResponse);
// WHEN
TelemetryRequest result = underTest.convert(response, null);
// THEN
assertFalse(result.getFeatures().getClusterLogsCollection().isEnabled());
}
use of com.sequenceiq.common.api.telemetry.request.TelemetryRequest in project cloudbreak by hortonworks.
the class TelemetryConverterTest method testConvertFromRequestForDatalake.
@Test
public void testConvertFromRequestForDatalake() {
// GIVEN
TelemetryRequest telemetryRequest = new TelemetryRequest();
// WHEN
Telemetry result = underTest.convert(telemetryRequest, StackType.DATALAKE);
// THEN
assertFalse(result.getFeatures().getClusterLogsCollection().isEnabled());
assertNull(result.getFeatures().getMetering());
}
use of com.sequenceiq.common.api.telemetry.request.TelemetryRequest in project cloudbreak by hortonworks.
the class TelemetryConverterTest method testConvertWhenMonitoringIsDisabledThenItShouldBeFalseInTheResult.
@Test
public void testConvertWhenMonitoringIsDisabledThenItShouldBeFalseInTheResult() {
ReflectionTestUtils.setField(underTest, "monitoringEnabled", false);
TelemetryRequest input = new TelemetryRequest();
Telemetry result = underTest.convert(input, StackType.WORKLOAD);
assertNotNull(result);
assertFalse(result.getFeatures().getMonitoring().isEnabled());
}
use of com.sequenceiq.common.api.telemetry.request.TelemetryRequest in project cloudbreak by hortonworks.
the class EnvironmentApiConverterTest method createEditEnvironmentRequest.
private EnvironmentEditRequest createEditEnvironmentRequest() {
EnvironmentEditRequest request = new EnvironmentEditRequest();
request.setDescription("Test description.");
request.setNetwork(new EnvironmentNetworkRequest());
request.setAuthentication(createAuthenticationRequest());
request.setTelemetry(new TelemetryRequest());
request.setSecurityAccess(createSecurityAccessRequest());
request.setIdBrokerMappingSource(IdBrokerMappingSource.IDBMMS);
request.setCloudStorageValidation(CloudStorageValidation.DISABLED);
request.setAdminGroupName("cb-admin");
request.setAws(createAwsRequest());
return request;
}
use of com.sequenceiq.common.api.telemetry.request.TelemetryRequest in project cloudbreak by hortonworks.
the class TelemetryApiConverterTest method testConvertWithDefaultMonitoringFeatureWithoutCdpSaas.
@Test
public void testConvertWithDefaultMonitoringFeatureWithoutCdpSaas() {
// GIVEN
TelemetryRequest telemetryRequest = new TelemetryRequest();
given(entitlementService.isCdpSaasEnabled(anyString())).willReturn(false);
// WHEN
EnvironmentTelemetry result = underTest.convert(telemetryRequest, new Features(), ACCOUNT_ID);
// THEN
assertNull(result.getFeatures());
assertNull(result.getMonitoring().getRemoteWriteUrl());
}
Aggregations