use of com.sequenceiq.environment.environment.dto.telemetry.S3CloudStorageParameters in project cloudbreak by hortonworks.
the class EnvironmentLogStorageLocationValidatorTest method validateTelemetryLoggingStorageLocationNoStoragerLocation.
@Test
public void validateTelemetryLoggingStorageLocationNoStoragerLocation() {
when(environment.getTelemetry()).thenReturn(telemetry);
when(telemetry.getLogging()).thenReturn(logging);
when(logging.getS3()).thenReturn(new S3CloudStorageParameters());
when(logging.getStorageLocation()).thenReturn(null);
ValidationResult result = underTest.validateTelemetryLoggingStorageLocation(environment);
assertFalse(result.hasError());
}
use of com.sequenceiq.environment.environment.dto.telemetry.S3CloudStorageParameters in project cloudbreak by hortonworks.
the class EnvironmentLogStorageLocationValidatorTest method validateTelemetryLoggingStorageLocationValidatorPasses.
@Test
public void validateTelemetryLoggingStorageLocationValidatorPasses() {
when(environment.getTelemetry()).thenReturn(telemetry);
when(telemetry.getLogging()).thenReturn(logging);
when(logging.getS3()).thenReturn(new S3CloudStorageParameters());
when(logging.getStorageLocation()).thenReturn(REGION_1);
ValidationResult result = underTest.validateTelemetryLoggingStorageLocation(environment);
assertFalse(result.hasError());
}
use of com.sequenceiq.environment.environment.dto.telemetry.S3CloudStorageParameters in project cloudbreak by hortonworks.
the class BackupConverter method convertS3.
private S3CloudStorageParameters convertS3(S3CloudStorageV1Parameters s3) {
S3CloudStorageParameters s3CloudStorageParameters = null;
if (s3 != null) {
s3CloudStorageParameters = new S3CloudStorageParameters();
s3CloudStorageParameters.setInstanceProfile(s3.getInstanceProfile());
return s3CloudStorageParameters;
}
return s3CloudStorageParameters;
}
use of com.sequenceiq.environment.environment.dto.telemetry.S3CloudStorageParameters in project cloudbreak by hortonworks.
the class TelemetryApiConverter method convertS3.
private S3CloudStorageParameters convertS3(S3CloudStorageV1Parameters s3) {
S3CloudStorageParameters s3CloudStorageParameters = null;
if (s3 != null) {
s3CloudStorageParameters = new S3CloudStorageParameters();
s3CloudStorageParameters.setInstanceProfile(s3.getInstanceProfile());
return s3CloudStorageParameters;
}
return s3CloudStorageParameters;
}
use of com.sequenceiq.environment.environment.dto.telemetry.S3CloudStorageParameters 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