### Question:
CloudStorageUploader extends Thread { @VisibleForTesting String generateOutputPath(String basePath, String clusterName, String hostName, File localFile) { final String outputWithoutBasePath = Paths.get(clusterName, hostName, localFile.getParentFile().getName(), localFile.getName()).toString(); final String outputPath; if (StringUtils.isNotEmpty(basePath)) { if (!basePath.endsWith("/")){ outputPath = basePath + "/" + outputWithoutBasePath; } else { outputPath = basePath + outputWithoutBasePath; } } else { outputPath = outputWithoutBasePath; } return outputPath; } CloudStorageUploader(String name, UploadClient uploadClient, LogFeederProps logFeederProps); @Override void run();  }### Answer:
@Test public void testGenerateOutputPath() { String basePath = "example"; String output = underTest.generateOutputPath(basePath, CLUSTER_NAME, HOSTNAME, new File("/my/path")); Assert.assertEquals("example/cl/hostname/my/path", output); }
@Test public void testGenerateOutputPathWithEmptyBasePath() { String basePath = ""; String output = underTest.generateOutputPath(basePath, CLUSTER_NAME, HOSTNAME, new File("/my/path")); Assert.assertEquals("cl/hostname/my/path", output); }
@Test public void testGenerateOutputPathWithSlashEndAndStart() { String basePath = "example/"; String output = underTest.generateOutputPath(basePath, CLUSTER_NAME, HOSTNAME, new File("/my/path")); Assert.assertEquals("example/cl/hostname/my/path", output); }
@Test public void testGenerateOutputPathWithScheme() { String basePath = "s3a: String output = underTest.generateOutputPath(basePath, CLUSTER_NAME, HOSTNAME, new File("/my/path")); Assert.assertEquals("s3a: }