public InitializrMetadataTestBuilder setMavenParent(String groupId, String artifactId, String version, boolean includeSpringBootBom) { this.builder.withCustomizer((it) -> { ParentPom parent = it.getConfiguration().getEnv().getMaven().getParent(); parent.setGroupId(groupId); parent.setArtifactId(artifactId); parent.setVersion(version); parent.setIncludeSpringBootBom(includeSpringBootBom); }); return this; }
@Test void invalidParentMissingVersion() { InitializrMetadata metadata = initializeMetadata(); ParentPom parent = metadata.getConfiguration().getEnv().getMaven().getParent(); parent.setGroupId("org.foo"); parent.setArtifactId("foo-parent"); assertThatExceptionOfType(InvalidInitializrMetadataException.class) .isThrownBy(metadata::validate).withMessageContaining( "Custom maven pom requires groupId, artifactId and version"); }