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/24 18:28:28 UTC

(maven-build-cache-extension) branch master updated: Break dependency on assert4j (#447)

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

slachiewicz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-build-cache-extension.git


The following commit(s) were added to refs/heads/master by this push:
     new 69319d70 Break dependency on assert4j (#447)
69319d70 is described below

commit 69319d70d724fcd9b07237981f727c656ddeb58d
Author: Elliotte Rusty Harold <el...@users.noreply.github.com>
AuthorDate: Mon Aug 24 18:28:22 2026 +0000

    Break dependency on assert4j (#447)
---
 pom.xml                                            |  6 -----
 .../buildcache/LifecyclePhasesHelperTest.java      | 30 +++++++++++-----------
 2 files changed, 15 insertions(+), 21 deletions(-)

diff --git a/pom.xml b/pom.xml
index 3ec01427..cee7f8ce 100644
--- a/pom.xml
+++ b/pom.xml
@@ -269,12 +269,6 @@ under the License.
       <version>${slf4jVersion}</version>
       <scope>test</scope>
     </dependency>
-    <dependency>
-      <groupId>org.assertj</groupId>
-      <artifactId>assertj-core</artifactId>
-      <version>3.27.7</version>
-      <scope>test</scope>
-    </dependency>
     <dependency>
       <groupId>org.mockito</groupId>
       <artifactId>mockito-core</artifactId>
diff --git a/src/test/java/org/apache/maven/buildcache/LifecyclePhasesHelperTest.java b/src/test/java/org/apache/maven/buildcache/LifecyclePhasesHelperTest.java
index 4e3c5a92..f0451e2c 100644
--- a/src/test/java/org/apache/maven/buildcache/LifecyclePhasesHelperTest.java
+++ b/src/test/java/org/apache/maven/buildcache/LifecyclePhasesHelperTest.java
@@ -36,11 +36,10 @@
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.ValueSource;
 
-import static java.util.Collections.emptyList;
 import static java.util.Collections.singletonList;
-import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertIterableEquals;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.junit.jupiter.api.Assumptions.assumeTrue;
@@ -172,7 +171,8 @@ void getCleanSegment() {
         MojoExecution clean = mockedMojoExecution("clean");
         List<MojoExecution> cleanSegment = lifecyclePhasesHelper.getCleanSegment(
                 projectMock, Arrays.asList(clean, mockedMojoExecution("compile"), mockedMojoExecution("install")));
-        assertEquals(singletonList(clean), cleanSegment);
+
+        assertIterableEquals(singletonList(clean), cleanSegment);
     }
 
     /**
@@ -182,7 +182,7 @@ void getCleanSegment() {
     void getEmptyCleanSegment() {
         List<MojoExecution> cleanSegment = lifecyclePhasesHelper.getCleanSegment(
                 projectMock, Arrays.asList(mockedMojoExecution("compile"), mockedMojoExecution("install")));
-        assertEquals(emptyList(), cleanSegment);
+        assertTrue(cleanSegment.isEmpty());
     }
 
     /**
@@ -200,7 +200,7 @@ void getEmptyCleanSegmentIfForked() {
                         // null lifecycle phase is possible in forked executions
                         mockedMojoExecution(null), mockedMojoExecution(null)));
 
-        assertEquals(emptyList(), cleanSegment);
+        assertTrue(cleanSegment.isEmpty());
     }
 
     /**
@@ -217,7 +217,7 @@ void getCleanSegmentForkedAnyLifecyclePhase() {
                         // clean is overridden to "install" phase assuming forked execution
                         mockedMojoExecution("clean")));
 
-        assertEquals(emptyList(), cleanSegment);
+        assertTrue(cleanSegment.isEmpty());
     }
 
     @Test
@@ -231,7 +231,7 @@ void testCachedSegment() {
 
         List<MojoExecution> cachedSegment = lifecyclePhasesHelper.getCachedSegment(projectMock, mojoExecutions, build);
 
-        assertThat(cachedSegment).containsExactly(compile, test);
+        assertIterableEquals(Arrays.asList(compile, test), cachedSegment);
     }
 
     @Test
@@ -246,7 +246,7 @@ void testEmptyCachedSegment() {
 
         List<MojoExecution> cachedSegment = lifecyclePhasesHelper.getCachedSegment(projectMock, mojoExecutions, build);
 
-        assertThat(cachedSegment).isEmpty();
+        assertTrue(cachedSegment.isEmpty());
     }
 
     @Test
@@ -264,7 +264,7 @@ void testCachedSegmentForked() {
 
         List<MojoExecution> cachedSegment = lifecyclePhasesHelper.getCachedSegment(projectMock, mojoExecutions, build);
 
-        assertEquals(mojoExecutions, cachedSegment);
+        assertIterableEquals(mojoExecutions, cachedSegment);
     }
 
     @ParameterizedTest
@@ -280,7 +280,7 @@ void testAllInCachedSegment() {
 
         List<MojoExecution> cachedSegment = lifecyclePhasesHelper.getCachedSegment(projectMock, mojoExecutions, build);
 
-        assertEquals(mojoExecutions, cachedSegment);
+        assertIterableEquals(mojoExecutions, cachedSegment);
     }
 
     @Test
@@ -296,7 +296,7 @@ void testPostCachedSegment() {
         List<MojoExecution> notCachedSegment =
                 lifecyclePhasesHelper.getPostCachedSegment(projectMock, mojoExecutions, build);
 
-        assertThat(notCachedSegment).containsExactly(test, install);
+        assertIterableEquals(Arrays.asList(test, install), notCachedSegment);
     }
 
     @Test
@@ -312,7 +312,7 @@ void testAllPostCachedSegment() {
         List<MojoExecution> notCachedSegment =
                 lifecyclePhasesHelper.getPostCachedSegment(projectMock, mojoExecutions, build);
 
-        assertThat(notCachedSegment).isEqualTo(mojoExecutions);
+        assertIterableEquals(mojoExecutions, notCachedSegment);
     }
 
     @Test
@@ -331,7 +331,7 @@ void testPostCachedSegmentForked() {
         List<MojoExecution> cachedSegment =
                 lifecyclePhasesHelper.getPostCachedSegment(projectMock, mojoExecutions, build);
 
-        assertThat(cachedSegment).isEqualTo(mojoExecutions);
+        assertIterableEquals(mojoExecutions, cachedSegment);
     }
 
     @ParameterizedTest
@@ -348,7 +348,7 @@ void testEmptyPostCachedSegmentInclusive() {
         List<MojoExecution> notCachedSegment =
                 lifecyclePhasesHelper.getPostCachedSegment(projectMock, mojoExecutions, cachedBuild);
 
-        assertThat(notCachedSegment).isEmpty();
+        assertTrue(notCachedSegment.isEmpty());
     }
 
     /**
@@ -377,7 +377,7 @@ void getCleanSegmentForCliGoalIsEmpty() {
         // compiler:compile maps to the "compile" phase, which is later than clean -> empty clean segment
         List<MojoExecution> cleanSegment =
                 lifecyclePhasesHelper.getCleanSegment(projectMock, singletonList(mockedCliGoal("compile")));
-        assertThat(cleanSegment).isEmpty();
+        assertTrue(cleanSegment.isEmpty());
     }
 
     @Test