Search in sources :

Example 6 with S3CloudStorageParameters

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());
}
Also used : S3CloudStorageParameters(com.sequenceiq.environment.environment.dto.telemetry.S3CloudStorageParameters) ValidationResult(com.sequenceiq.cloudbreak.validation.ValidationResult) Test(org.junit.jupiter.api.Test)

Example 7 with S3CloudStorageParameters

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());
}
Also used : S3CloudStorageParameters(com.sequenceiq.environment.environment.dto.telemetry.S3CloudStorageParameters) ValidationResult(com.sequenceiq.cloudbreak.validation.ValidationResult) Test(org.junit.jupiter.api.Test)

Example 8 with S3CloudStorageParameters

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;
}
Also used : S3CloudStorageParameters(com.sequenceiq.environment.environment.dto.telemetry.S3CloudStorageParameters)

Example 9 with 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;
}
Also used : S3CloudStorageParameters(com.sequenceiq.environment.environment.dto.telemetry.S3CloudStorageParameters)

Example 10 with 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());
}
Also used : EnvironmentLogging(com.sequenceiq.environment.environment.dto.telemetry.EnvironmentLogging) EnvironmentTelemetry(com.sequenceiq.environment.environment.dto.telemetry.EnvironmentTelemetry) TelemetryRequest(com.sequenceiq.common.api.telemetry.request.TelemetryRequest) S3CloudStorageParameters(com.sequenceiq.environment.environment.dto.telemetry.S3CloudStorageParameters) Test(org.junit.jupiter.api.Test)

Aggregations

S3CloudStorageParameters (com.sequenceiq.environment.environment.dto.telemetry.S3CloudStorageParameters)13 Test (org.junit.jupiter.api.Test)11 ValidationResult (com.sequenceiq.cloudbreak.validation.ValidationResult)8 EnvironmentLogging (com.sequenceiq.environment.environment.dto.telemetry.EnvironmentLogging)3 EnvironmentTelemetry (com.sequenceiq.environment.environment.dto.telemetry.EnvironmentTelemetry)3 TelemetryRequest (com.sequenceiq.common.api.telemetry.request.TelemetryRequest)2 TelemetryResponse (com.sequenceiq.common.api.telemetry.response.TelemetryResponse)1 EnvironmentFeatures (com.sequenceiq.environment.environment.dto.telemetry.EnvironmentFeatures)1