You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2026/08/09 21:33:38 UTC

(maven) 01/01: Move the core IT suite off the JUnit 4 assertions

This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch agent/junit5-core-it-straggler
in repository https://gitbox.apache.org/repos/asf/maven.git

commit 5cf8e78b6ad1471c21b888fdcf0a654966cb402d
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Sun Aug 9 23:27:10 2026 +0200

    Move the core IT suite off the JUnit 4 assertions
    
    Five classes in the suite still reached for org.junit.Assert while already
    being annotated with the Jupiter @Test, so they were the last thing keeping
    JUnit 4 on the its classpath. They now use org.junit.jupiter.api.Assertions.
    
    Four of them only needed the static import swapped. The fifth,
    MavenITmng7772CoreExtensionFoundTest, passed a message to assertTrue: the
    message is the FIRST argument in JUnit 4 and the LAST in JUnit 5, so that
    call is reordered rather than merely re-imported.
    
    Generated-by: Claude Opus 5 (1M context)
---
 .../org/apache/maven/it/MavenITgh10210SettingsXmlDecryptTest.java | 8 +++++---
 .../org/apache/maven/it/MavenITmng7772CoreExtensionFoundTest.java | 4 ++--
 .../org/apache/maven/it/MavenITmng8400CanonicalMavenHomeTest.java | 2 +-
 .../maven/it/MavenITmng8414ConsumerPomWithNewFeaturesTest.java    | 2 +-
 .../test/java/org/apache/maven/it/MavenITmng8594AtFileTest.java   | 2 +-
 5 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITgh10210SettingsXmlDecryptTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITgh10210SettingsXmlDecryptTest.java
index c0f8401b3f..2ce2134ed9 100644
--- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITgh10210SettingsXmlDecryptTest.java
+++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITgh10210SettingsXmlDecryptTest.java
@@ -22,9 +22,11 @@
 import java.nio.file.Path;
 import java.util.Arrays;
 
-import org.junit.Assert;
 import org.junit.jupiter.api.Test;
 
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
 /**
  * This is a test set for <a href="https://github.com/apache/maven/issues/10210">GH-10210</a>.
  * @since 4.0.0-rc4
@@ -42,7 +44,7 @@ void testItPass() throws Exception {
         verifier.addCliArgument("process-resources");
         verifier.execute();
 
-        Assert.assertEquals(
+        assertEquals(
                 Arrays.asList(
                         "prop1=%{foo}.txt",
                         "prop2=${foo}.txt",
@@ -66,7 +68,7 @@ void testItFail() throws Exception {
         try {
             verifier.execute();
         } catch (VerificationException e) {
-            Assert.assertTrue(
+            assertTrue(
                     verifier.loadLogContent()
                             .contains(
                                     "Could not decrypt password (fix the corrupted password or remove it, if unused) {L6L/HbmrY+cH+sNkphn-this password is corrupted intentionally-q3fguYepTpM04WlIXb8nB1pk=}"));
diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7772CoreExtensionFoundTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7772CoreExtensionFoundTest.java
index 5fad8c1472..3308439545 100644
--- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7772CoreExtensionFoundTest.java
+++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7772CoreExtensionFoundTest.java
@@ -24,7 +24,7 @@
 
 import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 public class MavenITmng7772CoreExtensionFoundTest extends AbstractMavenIntegrationTestCase {
 
@@ -62,7 +62,7 @@ public void testWithLibExtCoreExtensionsFound() throws Exception {
 
         Path jarPath = extensionBasedir.resolve("target").resolve("maven-it-core-extensions-0.1.jar");
 
-        assertTrue("Jar output path was not built", Files.isRegularFile(jarPath));
+        assertTrue(Files.isRegularFile(jarPath), "Jar output path was not built");
 
         verifier = newVerifier(testDir);
         verifier.setUserHomeDirectory(Paths.get(testDir.toString(), "home-lib-ext"));
diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng8400CanonicalMavenHomeTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng8400CanonicalMavenHomeTest.java
index 046086ac9e..be3227b49f 100644
--- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng8400CanonicalMavenHomeTest.java
+++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng8400CanonicalMavenHomeTest.java
@@ -27,7 +27,7 @@
 
 import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 /**
  * This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-8400">MNG-8400</a>.
diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng8414ConsumerPomWithNewFeaturesTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng8414ConsumerPomWithNewFeaturesTest.java
index 51c2f5e24c..d99f624dae 100644
--- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng8414ConsumerPomWithNewFeaturesTest.java
+++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng8414ConsumerPomWithNewFeaturesTest.java
@@ -27,7 +27,7 @@
 import org.apache.maven.model.v4.MavenStaxReader;
 import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
 /**
diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng8594AtFileTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng8594AtFileTest.java
index bd1a6a21dd..e2e188c373 100644
--- a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng8594AtFileTest.java
+++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng8594AtFileTest.java
@@ -23,7 +23,7 @@
 
 import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 /**
  * This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-8594">MNG-8594</a>.