use of com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters in project cloudbreak by hortonworks.
the class LoggingRequestValidatorTest method testValidateValidBucket.
@Test
public void testValidateValidBucket() {
// GIVEN
LoggingRequest loggingRequest = new LoggingRequest();
loggingRequest.setS3(new S3CloudStorageV1Parameters());
loggingRequest.setStorageLocation("mybucket");
// WHEN
boolean result = underTest.isValid(loggingRequest, context);
// THEN
assertFalse(result);
}
use of com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters in project cloudbreak by hortonworks.
the class LoggingRequestValidatorTest method testValidateValidBasePathWhenUsingS3N.
@Test
public void testValidateValidBasePathWhenUsingS3N() {
// GIVEN
LoggingRequest loggingRequest = new LoggingRequest();
loggingRequest.setS3(new S3CloudStorageV1Parameters());
loggingRequest.setStorageLocation("s3n://basePath/custom");
// WHEN
boolean result = underTest.isValid(loggingRequest, context);
// THEN
assertTrue(result);
}
use of com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters in project cloudbreak by hortonworks.
the class LoggingRequestValidatorTest method testValidateValidBucketUri.
@Test
public void testValidateValidBucketUri() {
// GIVEN
LoggingRequest loggingRequest = new LoggingRequest();
loggingRequest.setS3(new S3CloudStorageV1Parameters());
loggingRequest.setStorageLocation("s3://mybucket/custom");
// WHEN
boolean result = underTest.isValid(loggingRequest, context);
// THEN
assertTrue(result);
}
use of com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters in project cloudbreak by hortonworks.
the class TelemetryConverterTest method testConvertToResponseWithEnabledClusterLogsCollectionFeatures.
@Test
public void testConvertToResponseWithEnabledClusterLogsCollectionFeatures() {
// GIVEN
Logging logging = new Logging();
S3CloudStorageV1Parameters s3Params = new S3CloudStorageV1Parameters();
s3Params.setInstanceProfile(INSTANCE_PROFILE_VALUE);
logging.setS3(s3Params);
Telemetry telemetry = new Telemetry();
telemetry.setLogging(logging);
Features features = new Features();
features.setWorkloadAnalytics(null);
features.addClusterLogsCollection(true);
telemetry.setFeatures(features);
// WHEN
TelemetryResponse result = underTest.convert(telemetry);
// THEN
assertEquals(INSTANCE_PROFILE_VALUE, result.getLogging().getS3().getInstanceProfile());
assertTrue(result.getFeatures().getClusterLogsCollection().isEnabled());
assertNull(result.getFeatures().getWorkloadAnalytics());
assertNull(result.getFeatures().getMetering());
}
use of com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters in project cloudbreak by hortonworks.
the class TelemetryConverterTest method testConvertToResponse.
@Test
public void testConvertToResponse() {
// GIVEN
Logging logging = new Logging();
S3CloudStorageV1Parameters s3Params = new S3CloudStorageV1Parameters();
s3Params.setInstanceProfile(INSTANCE_PROFILE_VALUE);
logging.setS3(s3Params);
Telemetry telemetry = new Telemetry();
telemetry.setLogging(logging);
// WHEN
TelemetryResponse result = underTest.convert(telemetry);
// THEN
assertEquals(INSTANCE_PROFILE_VALUE, result.getLogging().getS3().getInstanceProfile());
}
Aggregations