@Test void testReadCodestartSpec1() throws IOException { final CodestartSpec codestartSpec = CodestartCatalogLoader.readCodestartSpec(resourceToString("codestart-spec1.yml", StandardCharsets.UTF_8, Thread.currentThread().getContextClassLoader())); assertThat(codestartSpec.getName()).isEqualTo("foo-project"); assertThat(codestartSpec.getRef()).isEqualTo("foo"); assertThat(codestartSpec.getType()).isEqualTo(PROJECT); assertThat(codestartSpec.getOutputStrategy()).containsEntry("foo/bar", "strategy").hasSize(1); assertThat(codestartSpec.isPreselected()).isTrue(); assertThat(codestartSpec.isFallback()).isTrue(); assertThat(codestartSpec.getTags()).isEmpty(); assertThat(codestartSpec.getLanguagesSpec()).containsOnlyKeys("base", "java"); final CodestartSpec.LanguageSpec baseLanguageSpec = codestartSpec.getLanguagesSpec().get("base"); assertThat(baseLanguageSpec.getDependencies()).isEmpty(); assertThat(baseLanguageSpec.getTestDependencies()).isEmpty(); assertThat(baseLanguageSpec.getData()).isEmpty(); assertThat(baseLanguageSpec.getSharedData()).containsEntry("foo-shared", "bar"); assertThat(baseLanguageSpec.getSharedData()).containsOnlyKeys("foo-shared", "project"); assertThat(NestedMaps.getValue(baseLanguageSpec.getSharedData(), "project.group-id")).hasValue("org.acme"); assertThat(NestedMaps.getValue(baseLanguageSpec.getSharedData(), "project.artifact-id")).hasValue("foo-project"); final CodestartSpec.LanguageSpec javaLanguageSpec = codestartSpec.getLanguagesSpec().get("java"); assertThat(javaLanguageSpec.getDependencies()).containsExactly(new CodestartSpec.CodestartDep("group:artifact")); assertThat(javaLanguageSpec.getTestDependencies()) .containsExactly(new CodestartSpec.CodestartDep("grouptest:artifacttest:versiontest")); assertThat(javaLanguageSpec.getSharedData()).isEmpty(); assertThat(javaLanguageSpec.getData()).hasSize(1).containsEntry("foo", "bar"); }
static CodestartSpec readCodestartSpec(String content) throws com.fasterxml.jackson.core.JsonProcessingException { return YAML_MAPPER.readerFor(CodestartSpec.class) .readValue(content); }
CodestartCatalogLoader { static CodestartSpec readCodestartSpec(String content) throws com.fasterxml.jackson.core.JsonProcessingException { return YAML_MAPPER.readerFor(CodestartSpec.class) .readValue(content); } }
CodestartCatalogLoader { static CodestartSpec readCodestartSpec(String content) throws com.fasterxml.jackson.core.JsonProcessingException { return YAML_MAPPER.readerFor(CodestartSpec.class) .readValue(content); } private  CodestartCatalogLoader(); }
CodestartCatalogLoader { static CodestartSpec readCodestartSpec(String content) throws com.fasterxml.jackson.core.JsonProcessingException { return YAML_MAPPER.readerFor(CodestartSpec.class) .readValue(content); } private  CodestartCatalogLoader(); static CodestartCatalog<CodestartProjectInput> loadDefaultCatalog(CodestartPathLoader pathLoader,
            String first,
            String... more); static Collection<Codestart> loadUserDirectoryCodestarts(Path directory); static List<Codestart> loadCodestarts(CodestartPathLoader pathLoader, String first, String... more); }
CodestartCatalogLoader { static CodestartSpec readCodestartSpec(String content) throws com.fasterxml.jackson.core.JsonProcessingException { return YAML_MAPPER.readerFor(CodestartSpec.class) .readValue(content); } private  CodestartCatalogLoader(); static CodestartCatalog<CodestartProjectInput> loadDefaultCatalog(CodestartPathLoader pathLoader,
            String first,
            String... more); static Collection<Codestart> loadUserDirectoryCodestarts(Path directory); static List<Codestart> loadCodestarts(CodestartPathLoader pathLoader, String first, String... more);  }