use of com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters in project cloudbreak by hortonworks.
the class LoggingRequestValidatorTest method testValidateInvalidLocation.
@Test
public void testValidateInvalidLocation() {
// GIVEN
LoggingRequest loggingRequest = new LoggingRequest();
loggingRequest.setS3(new S3CloudStorageV1Parameters());
loggingRequest.setStorageLocation("?ds: da");
// 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 testValidateValidBasePathWhenUsingS3a.
@Test
public void testValidateValidBasePathWhenUsingS3a() {
// GIVEN
LoggingRequest loggingRequest = new LoggingRequest();
loggingRequest.setS3(new S3CloudStorageV1Parameters());
loggingRequest.setStorageLocation("s3://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 FluentConfigServiceTest method testCreateFluentConfigWithS3Path.
@Test
public void testCreateFluentConfigWithS3Path() {
// GIVEN
Logging logging = new Logging();
logging.setStorageLocation("s3://mybucket/cluster-logs/datahub/cl1");
logging.setS3(new S3CloudStorageV1Parameters());
Telemetry telemetry = new Telemetry();
telemetry.setLogging(logging);
// WHEN
FluentConfigView result = underTest.createFluentConfigs(DEFAULT_FLUENT_CLUSTER_DETAILS, false, false, REGION_SAMPLE, telemetry);
// THEN
assertTrue(result.isEnabled());
assertTrue(result.isCloudStorageLoggingEnabled());
assertEquals("cluster-logs/datahub/cl1", result.getLogFolderName());
assertEquals("mybucket", result.getS3LogArchiveBucketName());
}
use of com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters in project cloudbreak by hortonworks.
the class FluentConfigServiceTest method testCreateFluentConfigWithCustomPath.
@Test
public void testCreateFluentConfigWithCustomPath() {
// GIVEN
Logging logging = new Logging();
logging.setStorageLocation("mybucket/custom");
logging.setS3(new S3CloudStorageV1Parameters());
Telemetry telemetry = new Telemetry();
telemetry.setLogging(logging);
// WHEN
FluentConfigView result = underTest.createFluentConfigs(DEFAULT_FLUENT_CLUSTER_DETAILS, false, false, REGION_SAMPLE, telemetry);
// THEN
assertTrue(result.isEnabled());
assertTrue(result.isCloudStorageLoggingEnabled());
assertEquals("custom", result.getLogFolderName());
assertEquals("mybucket", result.getS3LogArchiveBucketName());
}
use of com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters in project cloudbreak by hortonworks.
the class FluentConfigServiceTest method testCreateFluentConfigWithS3APath.
@Test
public void testCreateFluentConfigWithS3APath() {
// GIVEN
Logging logging = new Logging();
logging.setStorageLocation("s3a://mybucket/cluster-logs/datahub/cl1");
logging.setS3(new S3CloudStorageV1Parameters());
Telemetry telemetry = new Telemetry();
telemetry.setLogging(logging);
// WHEN
FluentConfigView result = underTest.createFluentConfigs(DEFAULT_FLUENT_CLUSTER_DETAILS, false, false, REGION_SAMPLE, telemetry);
// THEN
assertTrue(result.isEnabled());
assertTrue(result.isCloudStorageLoggingEnabled());
assertEquals("cluster-logs/datahub/cl1", result.getLogFolderName());
assertEquals("mybucket", result.getS3LogArchiveBucketName());
}
Aggregations