Search in sources :

Example 11 with S3CloudStorageParameters

use of com.sequenceiq.environment.environment.dto.telemetry.S3CloudStorageParameters in project cloudbreak by hortonworks.

the class EnvironmentBackupStorageLocationValidatorTest method validateBackupStorageLocationNoStorageLocation.

@Test
public void validateBackupStorageLocationNoStorageLocation() {
    when(environment.getBackup()).thenReturn(backup);
    when(backup.getS3()).thenReturn(new S3CloudStorageParameters());
    when(backup.getStorageLocation()).thenReturn(null);
    ValidationResult result = underTest.validateBackupStorageLocation(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 12 with S3CloudStorageParameters

use of com.sequenceiq.environment.environment.dto.telemetry.S3CloudStorageParameters in project cloudbreak by hortonworks.

the class EnvironmentBackupStorageLocationValidatorTest method validateBackupStorageLocationValidatorPasses.

@Test
public void validateBackupStorageLocationValidatorPasses() {
    when(environment.getBackup()).thenReturn(backup);
    when(backup.getS3()).thenReturn(new S3CloudStorageParameters());
    when(backup.getStorageLocation()).thenReturn(REGION_1);
    ValidationResult result = underTest.validateBackupStorageLocation(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 13 with S3CloudStorageParameters

use of com.sequenceiq.environment.environment.dto.telemetry.S3CloudStorageParameters in project cloudbreak by hortonworks.

the class EnvironmentLogStorageConfigurationValidatorTest method validateTelemetryStorageConfigS3WhenConfigValidationFailed.

@Test
public void validateTelemetryStorageConfigS3WhenConfigValidationFailed() {
    when(environment.getCloudPlatform()).thenReturn(CloudConstants.AWS);
    when(environment.getTelemetry()).thenReturn(telemetry);
    when(telemetry.getLogging()).thenReturn(logging);
    S3CloudStorageParameters s3 = new S3CloudStorageParameters();
    s3.setInstanceProfile("arn:aws:iam::1234567:instance1-profile/test");
    when(logging.getS3()).thenReturn(s3);
    ValidationResult result = underTest.validateTelemetryLoggingStorageConfiguration(environment);
    assertTrue(result.hasError());
}
Also used : S3CloudStorageParameters(com.sequenceiq.environment.environment.dto.telemetry.S3CloudStorageParameters) ValidationResult(com.sequenceiq.cloudbreak.validation.ValidationResult) 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