From 468935007bf4d843a7bd65a035b922c91d36f6fa Mon Sep 17 00:00:00 2001 From: Tamas Cservenak Date: Tue, 29 Oct 2024 14:39:48 +0100 Subject: [PATCH] Assert actual message --- .../it/MavenITmng8340GeneratedPomInTargetTest.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng8340GeneratedPomInTargetTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng8340GeneratedPomInTargetTest.java index c121e583b..c8aaef62d 100644 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng8340GeneratedPomInTargetTest.java +++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng8340GeneratedPomInTargetTest.java @@ -19,6 +19,7 @@ package org.apache.maven.it; import java.io.File; +import java.util.List; import org.apache.maven.shared.verifier.Verifier; import org.apache.maven.shared.verifier.util.ResourceExtractor; @@ -44,5 +45,16 @@ void testProjectWithShadePluginAndGeneratedPomUnderTarget() throws Exception { verifier.addCliArgument("package"); verifier.execute(); verifier.verifyErrorFreeLog(); + + List l = verifier.loadLines(verifier.getLogFileName(), "UTF-8"); + if (matchesVersionRange("[4.0.0-beta-5]")) { + assertTrue(l.stream() + .anyMatch(i -> i.contains( + "[FATAL] 'parent.relativePath' points at '../../pom.xml' but no POM could be found"))); + } else { + assertFalse(l.stream() + .anyMatch(i -> i.contains( + "[FATAL] 'parent.relativePath' points at '../../pom.xml' but no POM could be found"))); + } } }