Skip to content

Commit

Permalink
Assert actual message
Browse files Browse the repository at this point in the history
  • Loading branch information
cstamas committed Oct 29, 2024
1 parent 5464c34 commit 4689350
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -44,5 +45,16 @@ void testProjectWithShadePluginAndGeneratedPomUnderTarget() throws Exception {
verifier.addCliArgument("package");
verifier.execute();
verifier.verifyErrorFreeLog();

List<String> 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")));
}
}
}

0 comments on commit 4689350

Please sign in to comment.