Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
elharo committed Dec 7, 2024
1 parent 7651a5f commit 29cda58
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
*/
class InterpolationTest extends AbstractTestUtil {

private MavenProjectStub buildMavenProjectStub() {
ExtendedMavenProjectStub project = new ExtendedMavenProjectStub();
private MavenProject buildMavenProjectStub() {
MavenProject project = new MavenProject();
project.setVersion("1.0-SNAPSHOT");
project.setArtifactId("foo");
project.setGroupId("bar");
Expand All @@ -67,6 +67,7 @@ void testCompositeMap() {
assertThat(compositeMap).containsEntry("fooOnProject", "barOnProject");
}

@Test
public void testPomInterpolation() throws Exception {
InvokerMojo invokerMojo = new InvokerMojo();
setVariableValueToObject(invokerMojo, "project", buildMavenProjectStub());
Expand All @@ -80,6 +81,7 @@ public void testPomInterpolation() throws Exception {

File interpolatedPomFile = new File(getBasedir(), "target/interpolated-pom.xml");
invokerMojo.buildInterpolatedFile(new File(dirPath, "pom.xml"), interpolatedPomFile);
// TODO should parse the XML and use that to look for the interpolateValue element
try (Reader reader = new XmlStreamReader(interpolatedPomFile)) {
String content = IOUtil.toString(reader);
assertThat(content.indexOf("<interpolateValue>bar</interpolateValue>"))
Expand Down

0 comments on commit 29cda58

Please sign in to comment.