### Question:
BackupConverter { public Backup convert(TelemetryRequest request) { Backup backup = null; if (freeIpaBackupEnabled && request != null && request.getLogging() != null) { backup = new Backup(); backup.setMonthlyFullEnabled(backupConfiguration.isMonthlyFullEnabled()); backup.setInitialFullEnabled(backupConfiguration.isRunInitialFullAfterInstall()); backup.setHourlyEnabled(backupConfiguration.isHourlyEnabled()); decorateBackupFromLoggingRequest(backup, request.getLogging()); } return backup; } BackupConverter(BackupConfiguration backupConfiguration,
            @Value("${freeipa.backup.enabled:true}") boolean freeIpaBackupEnabled); Backup convert(TelemetryRequest request);  }### Answer:
@Test public void testConvertFromS3Request() { TelemetryRequest telemetryRequest = new TelemetryRequest(); LoggingRequest logging = new LoggingRequest(); logging.setS3(new S3CloudStorageV1Parameters()); logging.setStorageLocation("s3: telemetryRequest.setLogging(logging); Backup result = underTest.convert(telemetryRequest); assertThat(result.getStorageLocation(), is("s3: }
@Test public void testConvertFromAzureRequest() { TelemetryRequest telemetryRequest = new TelemetryRequest(); LoggingRequest logging = new LoggingRequest(); AdlsGen2CloudStorageV1Parameters adlsGen2CloudStorageV1Parameters = new AdlsGen2CloudStorageV1Parameters(); adlsGen2CloudStorageV1Parameters.setAccountKey("someaccount"); logging.setAdlsGen2(adlsGen2CloudStorageV1Parameters); logging.setStorageLocation("abfs: telemetryRequest.setLogging(logging); Backup result = underTest.convert(telemetryRequest); assertThat(result.getStorageLocation(), is("abfs: }