SW360Configuration extends ConfigurableWorkflowItem { public void logConfiguration(Logger logger) { logger.info("Base directory: {}", getBaseDir()); logger.info("Sources directory: {}", getSourcesPath()); logger.info("CSV path: {}", getCsvFilePath()); } SW360Configuration(File propertiesFile);   SW360Configuration(File propertiesFile, SW360ConnectionConfigurationFactory factory,
                       ServiceFactory serviceFactory); Path getBaseDir(); Path getSourcesPath(); Path getCsvFilePath(); String getProperty(String key); SW360Connection getConnection(); Boolean getBooleanConfigValue(String key); void logConfiguration(Logger logger);  }
@Test public void testLogConfig() { final StringBuilder logBuffer = new StringBuilder(); Logger logger = mock(Logger.class); doAnswer(invocationOnMock -> { logBuffer.append(invocationOnMock.getArgument(0).toString()) .append(" - ") .append(invocationOnMock.getArgument(1).toString()) .append(System.lineSeparator()); return null; }).when(logger).info(anyString(), any(Object.class)); Path localBaseDir = Paths.get(".").toAbsolutePath().normalize(); File propertiesFile = configFile("compliancetool-updater.properties"); SW360Configuration configuration = new SW360Configuration(propertiesFile); configuration.logConfiguration(logger); assertThat(logBuffer.toString()) .contains("Base directory", localBaseDir.toString(), "Sources directory", localBaseDir.resolve("sources").toString(), "CSV path", "updater_test.csv"); }