Search in sources :

Example 16 with FeatureSetting

use of com.sequenceiq.common.api.type.FeatureSetting in project cloudbreak by hortonworks.

the class DiagnosticsCollectionValidatorTest method testValidateWithValidEngDestination.

@Test
void testValidateWithValidEngDestination() {
    BaseDiagnosticsCollectionRequest request = new BaseDiagnosticsCollectionRequest();
    request.setDestination(DiagnosticsDestination.ENG);
    Telemetry telemetry = new Telemetry();
    Features features = new Features();
    FeatureSetting clusterLogsCollection = new FeatureSetting();
    clusterLogsCollection.setEnabled(true);
    features.setClusterLogsCollection(clusterLogsCollection);
    telemetry.setFeatures(features);
    underTest.validate(request, createStack(), telemetry);
}
Also used : BaseDiagnosticsCollectionRequest(com.sequenceiq.common.api.diagnostics.BaseDiagnosticsCollectionRequest) FeatureSetting(com.sequenceiq.common.api.type.FeatureSetting) Features(com.sequenceiq.common.api.telemetry.model.Features) Telemetry(com.sequenceiq.common.api.telemetry.model.Telemetry) Test(org.junit.jupiter.api.Test)

Example 17 with FeatureSetting

use of com.sequenceiq.common.api.type.FeatureSetting in project cloudbreak by hortonworks.

the class DiiagnosticsCollectionValidatorTest method testValidateWithValidEngDestination.

@Test
void testValidateWithValidEngDestination() {
    BaseDiagnosticsCollectionRequest request = new BaseDiagnosticsCollectionRequest();
    request.setDestination(DiagnosticsDestination.ENG);
    Telemetry telemetry = new Telemetry();
    Features features = new Features();
    FeatureSetting clusterLogsCollection = new FeatureSetting();
    clusterLogsCollection.setEnabled(true);
    features.setClusterLogsCollection(clusterLogsCollection);
    telemetry.setFeatures(features);
    underTest.validate(request, createStackWithTelemetry(telemetry));
}
Also used : BaseDiagnosticsCollectionRequest(com.sequenceiq.common.api.diagnostics.BaseDiagnosticsCollectionRequest) FeatureSetting(com.sequenceiq.common.api.type.FeatureSetting) Features(com.sequenceiq.common.api.telemetry.model.Features) Telemetry(com.sequenceiq.common.api.telemetry.model.Telemetry) Test(org.junit.jupiter.api.Test)

Example 18 with FeatureSetting

use of com.sequenceiq.common.api.type.FeatureSetting in project cloudbreak by hortonworks.

the class DiiagnosticsCollectionValidatorTest method testValidateWithValidEngDestinationButWithWrongVersion.

@Test
void testValidateWithValidEngDestinationButWithWrongVersion() {
    BaseDiagnosticsCollectionRequest request = new BaseDiagnosticsCollectionRequest();
    request.setDestination(DiagnosticsDestination.ENG);
    Telemetry telemetry = new Telemetry();
    Features features = new Features();
    FeatureSetting clusterLogsCollection = new FeatureSetting();
    clusterLogsCollection.setEnabled(true);
    features.setClusterLogsCollection(clusterLogsCollection);
    telemetry.setFeatures(features);
    Stack stack = createStackWithTelemetry(telemetry);
    stack.setAppVersion("2.32.0-b48");
    BadRequestException thrown = assertThrows(BadRequestException.class, () -> underTest.validate(request, stack));
    assertTrue(thrown.getMessage().contains("Required FreeIPA min major/minor version is 2.33"));
}
Also used : BaseDiagnosticsCollectionRequest(com.sequenceiq.common.api.diagnostics.BaseDiagnosticsCollectionRequest) FeatureSetting(com.sequenceiq.common.api.type.FeatureSetting) BadRequestException(com.sequenceiq.cloudbreak.common.exception.BadRequestException) Features(com.sequenceiq.common.api.telemetry.model.Features) Telemetry(com.sequenceiq.common.api.telemetry.model.Telemetry) Stack(com.sequenceiq.freeipa.entity.Stack) Test(org.junit.jupiter.api.Test)

Example 19 with FeatureSetting

use of com.sequenceiq.common.api.type.FeatureSetting in project cloudbreak by hortonworks.

the class EnvironmentDetailsToCDPEnvironmentTelemetryFeatureDetailsConverterTest method testConversionTelemetry.

@Test
public void testConversionTelemetry() {
    FeatureSetting clusterLogsCollection = new FeatureSetting();
    clusterLogsCollection.setEnabled(Boolean.TRUE);
    FeatureSetting workloadAnalytics = new FeatureSetting();
    workloadAnalytics.setEnabled(Boolean.FALSE);
    when(environmentDetails.getEnvironmentTelemetryFeatures()).thenReturn(environmentFeatures);
    when(environmentFeatures.getClusterLogsCollection()).thenReturn(clusterLogsCollection);
    when(environmentFeatures.getWorkloadAnalytics()).thenReturn(workloadAnalytics);
    UsageProto.CDPEnvironmentTelemetryFeatureDetails telemetryFeatureDetails = underTest.convert(environmentDetails);
    Assertions.assertEquals("true", telemetryFeatureDetails.getClusterLogsCollection());
    Assertions.assertEquals("false", telemetryFeatureDetails.getWorkloadAnalytics());
}
Also used : FeatureSetting(com.sequenceiq.common.api.type.FeatureSetting) UsageProto(com.cloudera.thunderhead.service.common.usage.UsageProto) Test(org.junit.jupiter.api.Test)

Example 20 with FeatureSetting

use of com.sequenceiq.common.api.type.FeatureSetting in project cloudbreak by hortonworks.

the class EnvironmentFeatures method addMonitoring.

@JsonIgnore
public void addMonitoring(boolean enabled) {
    monitoring = new FeatureSetting();
    monitoring.setEnabled(enabled);
}
Also used : FeatureSetting(com.sequenceiq.common.api.type.FeatureSetting) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Aggregations

FeatureSetting (com.sequenceiq.common.api.type.FeatureSetting)22 JsonIgnore (com.fasterxml.jackson.annotation.JsonIgnore)12 Test (org.junit.jupiter.api.Test)6 BaseDiagnosticsCollectionRequest (com.sequenceiq.common.api.diagnostics.BaseDiagnosticsCollectionRequest)4 Features (com.sequenceiq.common.api.telemetry.model.Features)4 Telemetry (com.sequenceiq.common.api.telemetry.model.Telemetry)4 FeaturesResponse (com.sequenceiq.common.api.telemetry.response.FeaturesResponse)4 TelemetryRequest (com.sequenceiq.common.api.telemetry.request.TelemetryRequest)3 TelemetryResponse (com.sequenceiq.common.api.telemetry.response.TelemetryResponse)3 S3CloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters)2 Stack (com.sequenceiq.freeipa.entity.Stack)2 UsageProto (com.cloudera.thunderhead.service.common.usage.UsageProto)1 StackV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.StackV4Response)1 StackTags (com.sequenceiq.cloudbreak.cloud.model.StackTags)1 AwsInstanceTemplate (com.sequenceiq.cloudbreak.cloud.model.instance.AwsInstanceTemplate)1 BadRequestException (com.sequenceiq.cloudbreak.common.exception.BadRequestException)1 Json (com.sequenceiq.cloudbreak.common.json.Json)1 BackupRequest (com.sequenceiq.common.api.backup.request.BackupRequest)1 AdlsGen2CloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters)1 GcsCloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.GcsCloudStorageV1Parameters)1