### Question:
S3BackupConfigGenerator extends CloudBackupConfigGenerator<S3BackupConfig> { @Override public String generateBackupLocation(String location, String clusterType, String clusterName, String clusterId) { S3BackupConfig s3BackupConfig = generateBackupConfig(location); String generatedS3Location = S3_SCHEME_PREFIXES[0] + Paths.get(s3BackupConfig.getBucket(), resolveBackupFolder(s3BackupConfig, clusterType, clusterName, clusterId)); LOGGER.debug("The following S3 base folder location is generated: {} (from {})", generatedS3Location, location); return generatedS3Location; }  @Override String generateBackupLocation(String location, String clusterType, String clusterName, String clusterId);  }### Answer:
@Test public void testSimpleCaseLocation() { S3BackupConfigGenerator s3BackupConfigGenerator = new S3BackupConfigGenerator(); String location = s3BackupConfigGenerator.generateBackupLocation( "s3: FluentClusterType.FREEIPA.value(), "mycluster", "12345"); assertEquals("s3: }
@Test public void testSuppliedFolderLocation() { S3BackupConfigGenerator s3BackupConfigGenerator = new S3BackupConfigGenerator(); String location = s3BackupConfigGenerator.generateBackupLocation( "s3: FluentClusterType.FREEIPA.value(), "mycluster", "12345"); assertEquals("s3: }
@Test public void testS3aLocation() { S3BackupConfigGenerator s3BackupConfigGenerator = new S3BackupConfigGenerator(); String location = s3BackupConfigGenerator.generateBackupLocation( "s3a: FluentClusterType.FREEIPA.value(), "mycluster", "12345"); assertEquals("s3: }
@Test public void testNonPrefixedLocation() { S3BackupConfigGenerator s3BackupConfigGenerator = new S3BackupConfigGenerator(); String location = s3BackupConfigGenerator.generateBackupLocation( "mybucket", FluentClusterType.FREEIPA.value(), "mycluster", "12345"); assertEquals("s3: }
@Test public void testMultiFolderLocation() { S3BackupConfigGenerator s3BackupConfigGenerator = new S3BackupConfigGenerator(); String location = s3BackupConfigGenerator.generateBackupLocation( "mybucket/something/deeper", FluentClusterType.FREEIPA.value(), "mycluster", "12345"); assertEquals("s3: }