Search in sources :

Example 11 with TelemetryRequest

use of com.sequenceiq.common.api.telemetry.request.TelemetryRequest in project cloudbreak by hortonworks.

the class TelemetryConverterTest method testConvertFromEnvAndSdxResponseWithClusterLogsCollectionDisabled.

@Test
public void testConvertFromEnvAndSdxResponseWithClusterLogsCollectionDisabled() {
    // GIVEN
    TelemetryResponse response = new TelemetryResponse();
    FeaturesResponse featuresResponse = new FeaturesResponse();
    featuresResponse.addClusterLogsCollection(false);
    response.setFeatures(featuresResponse);
    // WHEN
    TelemetryRequest result = underTest.convert(response, null);
    // THEN
    assertFalse(result.getFeatures().getClusterLogsCollection().isEnabled());
}
Also used : TelemetryResponse(com.sequenceiq.common.api.telemetry.response.TelemetryResponse) TelemetryRequest(com.sequenceiq.common.api.telemetry.request.TelemetryRequest) FeaturesResponse(com.sequenceiq.common.api.telemetry.response.FeaturesResponse) Test(org.junit.Test)

Example 12 with TelemetryRequest

use of com.sequenceiq.common.api.telemetry.request.TelemetryRequest in project cloudbreak by hortonworks.

the class TelemetryConverterTest method testConvertFromRequestForDatalake.

@Test
public void testConvertFromRequestForDatalake() {
    // GIVEN
    TelemetryRequest telemetryRequest = new TelemetryRequest();
    // WHEN
    Telemetry result = underTest.convert(telemetryRequest, StackType.DATALAKE);
    // THEN
    assertFalse(result.getFeatures().getClusterLogsCollection().isEnabled());
    assertNull(result.getFeatures().getMetering());
}
Also used : TelemetryRequest(com.sequenceiq.common.api.telemetry.request.TelemetryRequest) Telemetry(com.sequenceiq.common.api.telemetry.model.Telemetry) Test(org.junit.Test)

Example 13 with TelemetryRequest

use of com.sequenceiq.common.api.telemetry.request.TelemetryRequest in project cloudbreak by hortonworks.

the class TelemetryConverterTest method testConvertWhenMonitoringIsDisabledThenItShouldBeFalseInTheResult.

@Test
public void testConvertWhenMonitoringIsDisabledThenItShouldBeFalseInTheResult() {
    ReflectionTestUtils.setField(underTest, "monitoringEnabled", false);
    TelemetryRequest input = new TelemetryRequest();
    Telemetry result = underTest.convert(input, StackType.WORKLOAD);
    assertNotNull(result);
    assertFalse(result.getFeatures().getMonitoring().isEnabled());
}
Also used : TelemetryRequest(com.sequenceiq.common.api.telemetry.request.TelemetryRequest) Telemetry(com.sequenceiq.common.api.telemetry.model.Telemetry) Test(org.junit.Test)

Example 14 with TelemetryRequest

use of com.sequenceiq.common.api.telemetry.request.TelemetryRequest in project cloudbreak by hortonworks.

the class EnvironmentApiConverterTest method createEditEnvironmentRequest.

private EnvironmentEditRequest createEditEnvironmentRequest() {
    EnvironmentEditRequest request = new EnvironmentEditRequest();
    request.setDescription("Test description.");
    request.setNetwork(new EnvironmentNetworkRequest());
    request.setAuthentication(createAuthenticationRequest());
    request.setTelemetry(new TelemetryRequest());
    request.setSecurityAccess(createSecurityAccessRequest());
    request.setIdBrokerMappingSource(IdBrokerMappingSource.IDBMMS);
    request.setCloudStorageValidation(CloudStorageValidation.DISABLED);
    request.setAdminGroupName("cb-admin");
    request.setAws(createAwsRequest());
    return request;
}
Also used : TelemetryRequest(com.sequenceiq.common.api.telemetry.request.TelemetryRequest) EnvironmentEditRequest(com.sequenceiq.environment.api.v1.environment.model.request.EnvironmentEditRequest) EnvironmentNetworkRequest(com.sequenceiq.environment.api.v1.environment.model.request.EnvironmentNetworkRequest)

Example 15 with TelemetryRequest

use of com.sequenceiq.common.api.telemetry.request.TelemetryRequest in project cloudbreak by hortonworks.

the class TelemetryApiConverterTest method testConvertWithDefaultMonitoringFeatureWithoutCdpSaas.

@Test
public void testConvertWithDefaultMonitoringFeatureWithoutCdpSaas() {
    // GIVEN
    TelemetryRequest telemetryRequest = new TelemetryRequest();
    given(entitlementService.isCdpSaasEnabled(anyString())).willReturn(false);
    // WHEN
    EnvironmentTelemetry result = underTest.convert(telemetryRequest, new Features(), ACCOUNT_ID);
    // THEN
    assertNull(result.getFeatures());
    assertNull(result.getMonitoring().getRemoteWriteUrl());
}
Also used : TelemetryRequest(com.sequenceiq.common.api.telemetry.request.TelemetryRequest) EnvironmentTelemetry(com.sequenceiq.environment.environment.dto.telemetry.EnvironmentTelemetry) Features(com.sequenceiq.common.api.telemetry.model.Features) EnvironmentFeatures(com.sequenceiq.environment.environment.dto.telemetry.EnvironmentFeatures) Test(org.junit.jupiter.api.Test)

Aggregations

TelemetryRequest (com.sequenceiq.common.api.telemetry.request.TelemetryRequest)47 Test (org.junit.Test)19 Telemetry (com.sequenceiq.common.api.telemetry.model.Telemetry)15 Test (org.junit.jupiter.api.Test)15 FeaturesRequest (com.sequenceiq.common.api.telemetry.request.FeaturesRequest)13 Features (com.sequenceiq.common.api.telemetry.model.Features)10 EnvironmentTelemetry (com.sequenceiq.environment.environment.dto.telemetry.EnvironmentTelemetry)10 LoggingRequest (com.sequenceiq.common.api.telemetry.request.LoggingRequest)9 TelemetryResponse (com.sequenceiq.common.api.telemetry.response.TelemetryResponse)9 EnvironmentFeatures (com.sequenceiq.environment.environment.dto.telemetry.EnvironmentFeatures)9 S3CloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters)7 FeaturesResponse (com.sequenceiq.common.api.telemetry.response.FeaturesResponse)6 SdxClusterResponse (com.sequenceiq.sdx.api.model.SdxClusterResponse)6 MonitoringRequest (com.sequenceiq.common.api.telemetry.request.MonitoringRequest)4 WorkloadAnalyticsRequest (com.sequenceiq.common.api.telemetry.request.WorkloadAnalyticsRequest)3 FeatureSetting (com.sequenceiq.common.api.type.FeatureSetting)3 AltusDatabusConfiguration (com.sequenceiq.cloudbreak.altus.AltusDatabusConfiguration)2 ObjectStorageValidateRequest (com.sequenceiq.cloudbreak.cloud.model.objectstorage.ObjectStorageValidateRequest)2 ObjectStorageValidateResponse (com.sequenceiq.cloudbreak.cloud.model.objectstorage.ObjectStorageValidateResponse)2 Json (com.sequenceiq.cloudbreak.common.json.Json)2