use of com.sequenceiq.environment.environment.dto.telemetry.EnvironmentLogging in project cloudbreak by hortonworks.
the class TelemetryApiConverterTest method testConvertToResponse.
@Test
public void testConvertToResponse() {
// GIVEN
EnvironmentLogging logging = new EnvironmentLogging();
S3CloudStorageParameters s3Params = new S3CloudStorageParameters();
s3Params.setInstanceProfile(INSTANCE_PROFILE_VALUE);
logging.setS3(s3Params);
EnvironmentTelemetry telemetry = new EnvironmentTelemetry();
telemetry.setLogging(logging);
// WHEN
TelemetryResponse result = underTest.convert(telemetry);
// THEN
assertEquals(INSTANCE_PROFILE_VALUE, result.getLogging().getS3().getInstanceProfile());
assertNull(result.getWorkloadAnalytics());
}
use of com.sequenceiq.environment.environment.dto.telemetry.EnvironmentLogging in project cloudbreak by hortonworks.
the class TelemetryApiConverterTest method testConvertToRequestWithFeatures.
@Test
public void testConvertToRequestWithFeatures() {
// GIVEN
EnvironmentLogging logging = new EnvironmentLogging();
S3CloudStorageParameters s3Params = new S3CloudStorageParameters();
s3Params.setInstanceProfile(INSTANCE_PROFILE_VALUE);
logging.setS3(s3Params);
EnvironmentFeatures features = new EnvironmentFeatures();
features.addClusterLogsCollection(false);
features.addMonitoring(true);
EnvironmentTelemetry telemetry = new EnvironmentTelemetry();
telemetry.setLogging(logging);
telemetry.setFeatures(features);
// WHEN
TelemetryRequest result = underTest.convertToRequest(telemetry);
// THEN
assertNotNull(result.getFeatures());
assertFalse(result.getFeatures().getClusterLogsCollection().isEnabled());
assertTrue(result.getFeatures().getMonitoring().isEnabled());
assertEquals(INSTANCE_PROFILE_VALUE, result.getLogging().getS3().getInstanceProfile());
}
use of com.sequenceiq.environment.environment.dto.telemetry.EnvironmentLogging in project cloudbreak by hortonworks.
the class TelemetryApiConverter method createLoggingFromRequest.
private EnvironmentLogging createLoggingFromRequest(LoggingRequest loggingRequest) {
EnvironmentLogging logging = null;
if (loggingRequest != null) {
logging = new EnvironmentLogging();
logging.setStorageLocation(loggingRequest.getStorageLocation());
logging.setS3(convertS3(loggingRequest.getS3()));
logging.setAdlsGen2(convertAdlsV2(loggingRequest.getAdlsGen2()));
logging.setGcs(convertGcs(loggingRequest.getGcs()));
logging.setCloudwatch(CloudwatchParams.copy(loggingRequest.getCloudwatch()));
}
return logging;
}
use of com.sequenceiq.environment.environment.dto.telemetry.EnvironmentLogging in project cloudbreak by hortonworks.
the class TelemetryApiConverterTest method testConvertToRequest.
@Test
public void testConvertToRequest() {
// GIVEN
EnvironmentLogging logging = new EnvironmentLogging();
S3CloudStorageParameters s3Params = new S3CloudStorageParameters();
s3Params.setInstanceProfile(INSTANCE_PROFILE_VALUE);
logging.setS3(s3Params);
EnvironmentTelemetry telemetry = new EnvironmentTelemetry();
telemetry.setLogging(logging);
// WHEN
TelemetryRequest result = underTest.convertToRequest(telemetry);
// THEN
assertNull(result.getFeatures());
assertEquals(INSTANCE_PROFILE_VALUE, result.getLogging().getS3().getInstanceProfile());
}
Aggregations