@Test public void testConvertFromEnvAndSdxResponseWithWADisabled() { TelemetryResponse response = new TelemetryResponse(); SdxClusterResponse sdxClusterResponse = new SdxClusterResponse(); sdxClusterResponse.setCrn("crn:cdp:cloudbreak:us-west-1:someone:sdxcluster:sdxId"); sdxClusterResponse.setName("sdxName"); FeaturesResponse featuresResponse = new FeaturesResponse(); featuresResponse.addWorkloadAnalytics(false); response.setFeatures(featuresResponse); TelemetryRequest result = underTest.convert(response, sdxClusterResponse); assertNull(result.getWorkloadAnalytics()); assertFalse(result.getFeatures().getWorkloadAnalytics().isEnabled()); }
public TelemetryResponse convert(Telemetry telemetry) { TelemetryResponse response = null; if (telemetry != null) { LoggingResponse loggingResponse = createLoggingResponseFromSource(telemetry); WorkloadAnalyticsResponse waResponse = createWorkloadAnalyticsResponseFromSource(telemetry); response = new TelemetryResponse(); response.setLogging(loggingResponse); response.setWorkloadAnalytics(waResponse); response.setFluentAttributes(telemetry.getFluentAttributes()); response.setRules(telemetry.getRules()); createFeaturesResponseFromSource(response, telemetry.getFeatures()); } return response; }
TelemetryConverter { public TelemetryResponse convert(Telemetry telemetry) { TelemetryResponse response = null; if (telemetry != null) { LoggingResponse loggingResponse = createLoggingResponseFromSource(telemetry); WorkloadAnalyticsResponse waResponse = createWorkloadAnalyticsResponseFromSource(telemetry); response = new TelemetryResponse(); response.setLogging(loggingResponse); response.setWorkloadAnalytics(waResponse); response.setFluentAttributes(telemetry.getFluentAttributes()); response.setRules(telemetry.getRules()); createFeaturesResponseFromSource(response, telemetry.getFeatures()); } return response; } }
TelemetryConverter { public TelemetryResponse convert(Telemetry telemetry) { TelemetryResponse response = null; if (telemetry != null) { LoggingResponse loggingResponse = createLoggingResponseFromSource(telemetry); WorkloadAnalyticsResponse waResponse = createWorkloadAnalyticsResponseFromSource(telemetry); response = new TelemetryResponse(); response.setLogging(loggingResponse); response.setWorkloadAnalytics(waResponse); response.setFluentAttributes(telemetry.getFluentAttributes()); response.setRules(telemetry.getRules()); createFeaturesResponseFromSource(response, telemetry.getFeatures()); } return response; } TelemetryConverter(TelemetryConfiguration configuration,
            @Value("${cb.cm.telemetrypublisher.enabled:false}") boolean telemetryPublisherEnabled,
            @Value("${cb.cm.telemetrypublisher.default:true}") boolean telemetryPublisherDefaultValue); }
TelemetryConverter { public TelemetryResponse convert(Telemetry telemetry) { TelemetryResponse response = null; if (telemetry != null) { LoggingResponse loggingResponse = createLoggingResponseFromSource(telemetry); WorkloadAnalyticsResponse waResponse = createWorkloadAnalyticsResponseFromSource(telemetry); response = new TelemetryResponse(); response.setLogging(loggingResponse); response.setWorkloadAnalytics(waResponse); response.setFluentAttributes(telemetry.getFluentAttributes()); response.setRules(telemetry.getRules()); createFeaturesResponseFromSource(response, telemetry.getFeatures()); } return response; } TelemetryConverter(TelemetryConfiguration configuration,
            @Value("${cb.cm.telemetrypublisher.enabled:false}") boolean telemetryPublisherEnabled,
            @Value("${cb.cm.telemetrypublisher.default:true}") boolean telemetryPublisherDefaultValue); TelemetryResponse convert(Telemetry telemetry); Telemetry convert(TelemetryRequest request, StackType type); TelemetryRequest convert(TelemetryResponse response,
            SdxClusterResponse sdxClusterResponse); TelemetryRequest convertToRequest(Telemetry telemetry); Optional<FeatureSetting> createWorkloadAnalyticsFeature(WorkloadAnalyticsRequest waRequest); WorkloadAnalyticsRequest createWorkloadAnalyticsRequest(TelemetryResponse response,
            SdxClusterResponse sdxClusterResponse); }
TelemetryConverter { public TelemetryResponse convert(Telemetry telemetry) { TelemetryResponse response = null; if (telemetry != null) { LoggingResponse loggingResponse = createLoggingResponseFromSource(telemetry); WorkloadAnalyticsResponse waResponse = createWorkloadAnalyticsResponseFromSource(telemetry); response = new TelemetryResponse(); response.setLogging(loggingResponse); response.setWorkloadAnalytics(waResponse); response.setFluentAttributes(telemetry.getFluentAttributes()); response.setRules(telemetry.getRules()); createFeaturesResponseFromSource(response, telemetry.getFeatures()); } return response; } TelemetryConverter(TelemetryConfiguration configuration,
            @Value("${cb.cm.telemetrypublisher.enabled:false}") boolean telemetryPublisherEnabled,
            @Value("${cb.cm.telemetrypublisher.default:true}") boolean telemetryPublisherDefaultValue); TelemetryResponse convert(Telemetry telemetry); Telemetry convert(TelemetryRequest request, StackType type); TelemetryRequest convert(TelemetryResponse response,
            SdxClusterResponse sdxClusterResponse); TelemetryRequest convertToRequest(Telemetry telemetry); Optional<FeatureSetting> createWorkloadAnalyticsFeature(WorkloadAnalyticsRequest waRequest); WorkloadAnalyticsRequest createWorkloadAnalyticsRequest(TelemetryResponse response,
            SdxClusterResponse sdxClusterResponse);  }