Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,6 @@ under the License.
<version>${slf4jVersion}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.27.6</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,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;
Expand Down Expand Up @@ -171,7 +170,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);
}

/**
Expand All @@ -181,7 +181,7 @@ void getCleanSegment() {
void getEmptyCleanSegment() {
List<MojoExecution> cleanSegment = lifecyclePhasesHelper.getCleanSegment(
projectMock, Arrays.asList(mockedMojoExecution("compile"), mockedMojoExecution("install")));
assertEquals(emptyList(), cleanSegment);
assertTrue(cleanSegment.isEmpty());
}

/**
Expand All @@ -199,7 +199,7 @@ void getEmptyCleanSegmentIfForked() {
// null lifecycle phase is possible in forked executions
mockedMojoExecution(null), mockedMojoExecution(null)));

assertEquals(emptyList(), cleanSegment);
assertTrue(cleanSegment.isEmpty());
}

/**
Expand All @@ -216,7 +216,7 @@ void getCleanSegmentForkedAnyLifecyclePhase() {
// clean is overridden to "install" phase assuming forked execution
mockedMojoExecution("clean")));

assertEquals(emptyList(), cleanSegment);
assertTrue(cleanSegment.isEmpty());
}

@Test
Expand All @@ -230,7 +230,7 @@ void testCachedSegment() {

List<MojoExecution> cachedSegment = lifecyclePhasesHelper.getCachedSegment(projectMock, mojoExecutions, build);

assertThat(cachedSegment).containsExactly(compile, test);
assertIterableEquals(Arrays.asList(compile, test), cachedSegment);
}

@Test
Expand All @@ -245,7 +245,7 @@ void testEmptyCachedSegment() {

List<MojoExecution> cachedSegment = lifecyclePhasesHelper.getCachedSegment(projectMock, mojoExecutions, build);

assertThat(cachedSegment).isEmpty();
assertTrue(cachedSegment.isEmpty());
}

@Test
Expand All @@ -263,7 +263,7 @@ void testCachedSegmentForked() {

List<MojoExecution> cachedSegment = lifecyclePhasesHelper.getCachedSegment(projectMock, mojoExecutions, build);

assertEquals(mojoExecutions, cachedSegment);
assertIterableEquals(mojoExecutions, cachedSegment);
}

@ParameterizedTest
Expand All @@ -279,7 +279,7 @@ void testAllInCachedSegment() {

List<MojoExecution> cachedSegment = lifecyclePhasesHelper.getCachedSegment(projectMock, mojoExecutions, build);

assertEquals(mojoExecutions, cachedSegment);
assertIterableEquals(mojoExecutions, cachedSegment);
}

@Test
Expand All @@ -295,7 +295,7 @@ void testPostCachedSegment() {
List<MojoExecution> notCachedSegment =
lifecyclePhasesHelper.getPostCachedSegment(projectMock, mojoExecutions, build);

assertThat(notCachedSegment).containsExactly(test, install);
assertIterableEquals(Arrays.asList(test, install), notCachedSegment);
}

@Test
Expand All @@ -311,7 +311,7 @@ void testAllPostCachedSegment() {
List<MojoExecution> notCachedSegment =
lifecyclePhasesHelper.getPostCachedSegment(projectMock, mojoExecutions, build);

assertThat(notCachedSegment).isEqualTo(mojoExecutions);
assertIterableEquals(mojoExecutions, notCachedSegment);
}

@Test
Expand All @@ -330,7 +330,7 @@ void testPostCachedSegmentForked() {
List<MojoExecution> cachedSegment =
lifecyclePhasesHelper.getPostCachedSegment(projectMock, mojoExecutions, build);

assertThat(cachedSegment).isEqualTo(mojoExecutions);
assertIterableEquals(mojoExecutions, cachedSegment);
}

@ParameterizedTest
Expand All @@ -347,7 +347,7 @@ void testEmptyPostCachedSegmentInclusive() {
List<MojoExecution> notCachedSegment =
lifecyclePhasesHelper.getPostCachedSegment(projectMock, mojoExecutions, cachedBuild);

assertThat(notCachedSegment).isEmpty();
assertTrue(notCachedSegment.isEmpty());
}

private void publishForkedProjectEvent(MojoExecution origin) {
Expand Down