use of com.sequenceiq.common.api.telemetry.model.Telemetry 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.telemetry.model.Telemetry in project cloudbreak by hortonworks.
the class FluentConfigServiceTest method testCreateFluentConfigMeteringWithoutDatabusEndpoint.
@Test
public void testCreateFluentConfigMeteringWithoutDatabusEndpoint() {
// GIVEN
Telemetry telemetry = new Telemetry();
setMetering(telemetry);
// WHEN
FluentConfigView result = underTest.createFluentConfigs(DEFAULT_FLUENT_CLUSTER_DETAILS, false, false, REGION_SAMPLE, telemetry);
// THEN
assertFalse(result.isEnabled());
assertFalse(result.isMeteringEnabled());
}
use of com.sequenceiq.common.api.telemetry.model.Telemetry in project cloudbreak by hortonworks.
the class FluentConfigServiceTest method testCreateFluentConfigWithoutGcsProjectId.
@Test(expected = CloudbreakServiceException.class)
public void testCreateFluentConfigWithoutGcsProjectId() {
// GIVEN
Logging logging = new Logging();
logging.setStorageLocation("gs://mybucket/mypath");
logging.setGcs(new GcsCloudStorageV1Parameters());
Telemetry telemetry = new Telemetry();
telemetry.setLogging(logging);
// WHEN
underTest.createFluentConfigs(DEFAULT_FLUENT_CLUSTER_DETAILS, false, false, REGION_SAMPLE, telemetry);
}
use of com.sequenceiq.common.api.telemetry.model.Telemetry 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());
}
use of com.sequenceiq.common.api.telemetry.model.Telemetry in project cloudbreak by hortonworks.
the class FluentConfigServiceTest method testCreateFluentConfigWithAdlsGen2Path.
@Test
public void testCreateFluentConfigWithAdlsGen2Path() {
// GIVEN
Logging logging = new Logging();
logging.setStorageLocation("abfs://mycontainer@myaccount.dfs.core.windows.net");
AdlsGen2CloudStorageV1Parameters parameters = new AdlsGen2CloudStorageV1Parameters();
parameters.setAccountKey("myAccountKey");
logging.setAdlsGen2(parameters);
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("myAccountKey", result.getAzureStorageAccessKey());
assertTrue(result.getLogFolderName().isBlank());
assertEquals("mycontainer", result.getAzureContainer());
}
Aggregations