use of com.sequenceiq.common.api.telemetry.model.Telemetry in project cloudbreak by hortonworks.
the class FluentConfigServiceTest method testCreateFluentConfigMeteringWithoutDatabusSecret.
@Test
public void testCreateFluentConfigMeteringWithoutDatabusSecret() {
// 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 testCreateFluentConfigWitGcsPath.
@Test
public void testCreateFluentConfigWitGcsPath() {
// GIVEN
Logging logging = new Logging();
logging.setStorageLocation("gs://mybucket/cluster-logs/datahub/cl1");
GcsCloudStorageV1Parameters gcsParams = new GcsCloudStorageV1Parameters();
gcsParams.setServiceAccountEmail("myaccount@myprojectid.iam.gserviceaccount.com");
logging.setGcs(gcsParams);
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.getGcsBucket());
assertEquals("myprojectid", result.getGcsProjectId());
}
use of com.sequenceiq.common.api.telemetry.model.Telemetry 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.telemetry.model.Telemetry in project cloudbreak by hortonworks.
the class FluentConfigServiceTest method testCreateFluentConfigClusterLogsCollection.
@Test
public void testCreateFluentConfigClusterLogsCollection() {
// GIVEN
Telemetry telemetry = new Telemetry();
setClusterLogsCollection(telemetry);
// WHEN
FluentConfigView result = underTest.createFluentConfigs(DEFAULT_FLUENT_CLUSTER_DETAILS, true, false, REGION_SAMPLE, telemetry);
// THEN
assertTrue(result.isEnabled());
assertTrue(result.isClusterLogsCollection());
}
use of com.sequenceiq.common.api.telemetry.model.Telemetry in project cloudbreak by hortonworks.
the class FluentConfigServiceTest method testCreateFluentConfigMetering.
@Test
public void testCreateFluentConfigMetering() {
// GIVEN
Telemetry telemetry = new Telemetry();
setMetering(telemetry);
telemetry.setDatabusEndpoint("myEndpoint");
// WHEN
FluentConfigView result = underTest.createFluentConfigs(DEFAULT_FLUENT_CLUSTER_DETAILS, true, true, REGION_SAMPLE, telemetry);
// THEN
assertTrue(result.isEnabled());
assertTrue(result.isMeteringEnabled());
}
Aggregations