@Test public void testConvert() { TelemetryRequest telemetryRequest = new TelemetryRequest(); LoggingRequest loggingRequest = new LoggingRequest(); S3CloudStorageV1Parameters s3Params = new S3CloudStorageV1Parameters(); s3Params.setInstanceProfile(INSTANCE_PROFILE_VALUE); loggingRequest.setS3(s3Params); telemetryRequest.setLogging(loggingRequest); telemetryRequest.setWorkloadAnalytics(new WorkloadAnalyticsRequest()); FeaturesRequest fr = new FeaturesRequest(); fr.addClusterLogsCollection(true); fr.addWorkloadAnalytics(true); fr.addMonitoring(true); telemetryRequest.setFeatures(fr); EnvironmentTelemetry result = underTest.convert(telemetryRequest, new Features()); assertEquals(INSTANCE_PROFILE_VALUE, result.getLogging().getS3().getInstanceProfile()); assertTrue(result.getFeatures().getClusterLogsCollection().isEnabled()); assertTrue(result.getFeatures().getWorkloadAnalytics().isEnabled()); assertTrue(result.getFeatures().getUseSharedAltusCredential().isEnabled()); assertTrue(result.getFeatures().getMonitoring().isEnabled()); }
public EnvironmentTelemetry convert(TelemetryRequest request, Features accountFeatures) { EnvironmentTelemetry telemetry = null; if (request != null) { telemetry = new EnvironmentTelemetry(); telemetry.setLogging(createLoggingFromRequest(request.getLogging())); telemetry.setWorkloadAnalytics(createWorkloadAnalyticsFromRequest(request.getWorkloadAnalytics())); telemetry.setFeatures(createEnvironmentFeaturesFromRequest(request.getFeatures(), accountFeatures)); telemetry.setFluentAttributes(new HashMap<>(request.getFluentAttributes())); } return telemetry; }
TelemetryApiConverter { public EnvironmentTelemetry convert(TelemetryRequest request, Features accountFeatures) { EnvironmentTelemetry telemetry = null; if (request != null) { telemetry = new EnvironmentTelemetry(); telemetry.setLogging(createLoggingFromRequest(request.getLogging())); telemetry.setWorkloadAnalytics(createWorkloadAnalyticsFromRequest(request.getWorkloadAnalytics())); telemetry.setFeatures(createEnvironmentFeaturesFromRequest(request.getFeatures(), accountFeatures)); telemetry.setFluentAttributes(new HashMap<>(request.getFluentAttributes())); } return telemetry; } }
TelemetryApiConverter { public EnvironmentTelemetry convert(TelemetryRequest request, Features accountFeatures) { EnvironmentTelemetry telemetry = null; if (request != null) { telemetry = new EnvironmentTelemetry(); telemetry.setLogging(createLoggingFromRequest(request.getLogging())); telemetry.setWorkloadAnalytics(createWorkloadAnalyticsFromRequest(request.getWorkloadAnalytics())); telemetry.setFeatures(createEnvironmentFeaturesFromRequest(request.getFeatures(), accountFeatures)); telemetry.setFluentAttributes(new HashMap<>(request.getFluentAttributes())); } return telemetry; } TelemetryApiConverter(TelemetryConfiguration configuration); }
TelemetryApiConverter { public EnvironmentTelemetry convert(TelemetryRequest request, Features accountFeatures) { EnvironmentTelemetry telemetry = null; if (request != null) { telemetry = new EnvironmentTelemetry(); telemetry.setLogging(createLoggingFromRequest(request.getLogging())); telemetry.setWorkloadAnalytics(createWorkloadAnalyticsFromRequest(request.getWorkloadAnalytics())); telemetry.setFeatures(createEnvironmentFeaturesFromRequest(request.getFeatures(), accountFeatures)); telemetry.setFluentAttributes(new HashMap<>(request.getFluentAttributes())); } return telemetry; } TelemetryApiConverter(TelemetryConfiguration configuration); EnvironmentTelemetry convert(TelemetryRequest request, Features accountFeatures); TelemetryResponse convert(EnvironmentTelemetry telemetry); TelemetryRequest convertToRequest(EnvironmentTelemetry telemetry); }
TelemetryApiConverter { public EnvironmentTelemetry convert(TelemetryRequest request, Features accountFeatures) { EnvironmentTelemetry telemetry = null; if (request != null) { telemetry = new EnvironmentTelemetry(); telemetry.setLogging(createLoggingFromRequest(request.getLogging())); telemetry.setWorkloadAnalytics(createWorkloadAnalyticsFromRequest(request.getWorkloadAnalytics())); telemetry.setFeatures(createEnvironmentFeaturesFromRequest(request.getFeatures(), accountFeatures)); telemetry.setFluentAttributes(new HashMap<>(request.getFluentAttributes())); } return telemetry; } TelemetryApiConverter(TelemetryConfiguration configuration); EnvironmentTelemetry convert(TelemetryRequest request, Features accountFeatures); TelemetryResponse convert(EnvironmentTelemetry telemetry); TelemetryRequest convertToRequest(EnvironmentTelemetry telemetry);  }