@Test public void readFull21Selectors() throws ConfigurationException, UnsupportedEncodingException, IOException { try (Reader in = new InputStreamReader(getClass().getResourceAsStream("/srcdeps-full-2.1-selectors.yaml"), "utf-8")) { Configuration actual = new YamlConfigurationReader().read(in).build(); Configuration expected = Configuration.builder() .configModelVersion("3.0") .forwardAsMasterConfig(false) .forwardProperty("myProp1") .forwardProperty("myProp2") .logToFile(true) .logToConsole(false) .skip(true) .sourcesDirectory(Paths.get("/home/me/.m2/srcdeps")) .verbosity(Verbosity.debug) .buildTimeout(new Duration(35, TimeUnit.MINUTES)) .maven( Maven.builder() .versionsMavenPluginVersion("1.2") .useVersionsMavenPlugin(false) .failWith( MavenAssertions.failWithBuilder() .addDefaults(false) .goal("goal1") .goal("goal2") .profile("profile1") .profile("profile2") .property("property1") .property("property2") ) .failWithout( MavenAssertions.failWithoutBuilder() .goal("goalA") .goal("goalB") .profile("profileA") .profile("profileB") .property("propertyA") .property("propertyB") ) ) .repository( ScmRepository.builder() .id("org.repo1") .verbosity(Verbosity.trace) .logToFile(false) .logToConsole(true) .include("group1") .include("group2:artifact2:*") .url("url1") .url("url2") .buildArgument("-arg1") .buildArgument("-arg2") .addDefaultBuildArguments(false) .skipTests(false) .buildTimeout(new Duration(64, TimeUnit.SECONDS)) .maven( ScmRepositoryMaven.builder() .versionsMavenPluginVersion("2.2") .useVersionsMavenPlugin(false) .excludeNonRequired(false) .includeRequired(false) ) ) .repository( ScmRepository.builder() .id("org.repo2") .logToFile(false) .logToConsole(true) .include("group3:artifact3") .include("group4:artifact4:1.2.3") .url("url3") .url("url4") .buildArgument("arg3") .addDefaultBuildArguments(false) .skipTests(false).maven( ScmRepositoryMaven.builder() .useVersionsMavenPlugin(false) .excludeNonRequired(false) .includeRequired(false) ) ) .build(); Assert.assertEquals(expected, actual); } }
@Override public Configuration.Builder read(Reader in) throws ConfigurationException { Yaml yaml = new Yaml(new SrcdepsConstructor()); Configuration.Builder builder = yaml.loadAs(in, Configuration.Builder.class); return builder; }
YamlConfigurationReader implements ConfigurationReader { @Override public Configuration.Builder read(Reader in) throws ConfigurationException { Yaml yaml = new Yaml(new SrcdepsConstructor()); Configuration.Builder builder = yaml.loadAs(in, Configuration.Builder.class); return builder; } }
YamlConfigurationReader implements ConfigurationReader { @Override public Configuration.Builder read(Reader in) throws ConfigurationException { Yaml yaml = new Yaml(new SrcdepsConstructor()); Configuration.Builder builder = yaml.loadAs(in, Configuration.Builder.class); return builder; }  }
YamlConfigurationReader implements ConfigurationReader { @Override public Configuration.Builder read(Reader in) throws ConfigurationException { Yaml yaml = new Yaml(new SrcdepsConstructor()); Configuration.Builder builder = yaml.loadAs(in, Configuration.Builder.class); return builder; }  @Override Configuration.Builder read(Reader in); }
YamlConfigurationReader implements ConfigurationReader { @Override public Configuration.Builder read(Reader in) throws ConfigurationException { Yaml yaml = new Yaml(new SrcdepsConstructor()); Configuration.Builder builder = yaml.loadAs(in, Configuration.Builder.class); return builder; }  @Override Configuration.Builder read(Reader in);  }