Commands { public CommandlineConfig getConfig(final ConfigOptions configOptions) { return getConfigFile(configOptions) .map(ConfigLoader::new) .map(ConfigLoader::load) .orElseGet(CommandlineConfig::new); } Commands(final Path allureHome); CommandlineConfig getConfig(final ConfigOptions configOptions); Optional<Path> getConfigFile(final ConfigOptions configOptions); String getConfigFileName(final String profile); ExitCode generate(final Path reportDirectory,
                             final List<Path> resultsDirectories,
                             final boolean clean,
                             final ConfigOptions profile); ExitCode serve(final List<Path> resultsDirectories,
                          final String host,
                          final int port,
                          final ConfigOptions configOptions); ExitCode open(final Path reportDirectory, final String host, final int port); ExitCode listPlugins(final ConfigOptions configOptions);  }
@Test void shouldLoadConfig(@TempDir final Path home) throws Exception { createConfig(home, "allure-test.yml"); final ConfigOptions options = mock(ConfigOptions.class); when(options.getProfile()).thenReturn("test"); final Commands commands = new Commands(home); final CommandlineConfig config = commands.getConfig(options); assertThat(config) .isNotNull(); assertThat(config.getPlugins()) .hasSize(3) .containsExactly("a", "b", "c"); }