use of com.sequenceiq.common.api.telemetry.model.Telemetry in project cloudbreak by hortonworks.
the class FluentConfigServiceTest method testCreateFluentConfigWithFullAdlsGen2PathWithContainer.
@Test
public void testCreateFluentConfigWithFullAdlsGen2PathWithContainer() {
// GIVEN
Logging logging = new Logging();
logging.setStorageLocation("abfs://mycontainer/my/custom/path@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());
assertEquals("myAccountKey", result.getAzureStorageAccessKey());
assertEquals("/my/custom/path", result.getLogFolderName());
assertEquals("mycontainer", result.getAzureContainer());
}
use of com.sequenceiq.common.api.telemetry.model.Telemetry in project cloudbreak by hortonworks.
the class CloudStorageFolderResolverServiceTest method testUpdateStorageLocationAdlsGen2.
@Test
public void testUpdateStorageLocationAdlsGen2() {
// GIVEN
Telemetry telemetry = createTelemetry();
telemetry.getLogging().setS3(null);
telemetry.getLogging().setAdlsGen2(new AdlsGen2CloudStorageV1Parameters());
telemetry.getLogging().setStorageLocation("abfs://mycontainer");
// WHEN
underTest.updateStorageLocation(telemetry, FluentClusterType.DATAHUB.value(), "mycluster", "crn:cdp:cloudbreak:us-west-1:someone:stack:12345");
// THEN
assertEquals("abfs://mycontainer@null.dfs.core.windows.net/cluster-logs/datahub/mycluster_12345", telemetry.getLogging().getStorageLocation());
}
use of com.sequenceiq.common.api.telemetry.model.Telemetry in project cloudbreak by hortonworks.
the class CloudStorageFolderResolverServiceTest method testUpdateStorageLocationWithoutTelemetry.
@Test
public void testUpdateStorageLocationWithoutTelemetry() {
// GIVEN
Telemetry telemetry = null;
// WHEN
underTest.updateStorageLocation(telemetry, null, null, null);
// THEN
assertNull(telemetry);
}
use of com.sequenceiq.common.api.telemetry.model.Telemetry in project cloudbreak by hortonworks.
the class CloudStorageFolderResolverServiceTest method testUpdateStorageLocationWithInvalidCrn.
@Test(expected = CrnParseException.class)
public void testUpdateStorageLocationWithInvalidCrn() {
// GIVEN
Telemetry telemetry = createTelemetry();
// WHEN
underTest.updateStorageLocation(telemetry, FluentClusterType.DATAHUB.value(), "mycluster", "crn:cdp:cloudbreak:us-west:someone:stack:12345");
}
use of com.sequenceiq.common.api.telemetry.model.Telemetry in project cloudbreak by hortonworks.
the class ClouderaManagerMgmtTelemetryServiceTest method testUpdateServiceMonitorConfigs.
@Test
public void testUpdateServiceMonitorConfigs() throws ApiException {
// GIVEN
Stack stack = new Stack();
stack.setStackVersion("7.2.16");
stack.setResourceCrn("crn:cdp:datahub:us-west-1:accountId:cluster:name");
Cluster cluster = new Cluster();
cluster.setCloudbreakClusterManagerMonitoringUser("admin");
cluster.setCloudbreakClusterManagerMonitoringPassword("admin123");
stack.setCluster(cluster);
Telemetry telemetry = new Telemetry();
Features features = new Features();
features.addMonitoring(true);
telemetry.setFeatures(features);
given(monitoringConfiguration.isEnabled()).willReturn(true);
given(monitoringConfiguration.getClouderaManagerExporter()).willReturn(cmMonitoringConfiguration);
given(monitoringConfiguration.isPaasSupport()).willReturn(true);
given(cmMonitoringConfiguration.getPort()).willReturn(EXPORTER_PORT);
given(clouderaManagerApiFactory.getMgmtRoleConfigGroupsResourceApi(apiClient)).willReturn(mgmtRoleConfigGroupsResourceApi);
// WHEN
underTest.updateServiceMonitorConfigs(stack, apiClient, telemetry);
// THEN
verify(mgmtRoleConfigGroupsResourceApi, times(1)).updateConfig(any(), anyString(), any());
}
Aggregations