From 5394e750d9698d186d11470c4874fd72523b78ac Mon Sep 17 00:00:00 2001 From: Karsten Thoms Date: Sat, 15 Jan 2022 10:21:13 +0100 Subject: [PATCH] (refactoring) Resolve usage of deprecated method Replace usage of MavenExecutionRequest#getSelectedProjects() by MavenExecutionRequest#getProjectActivation().getOptionalActiveProjectSelectors() Signed-off-by: Karsten Thoms This closes #664 --- .../DefaultBuildResumptionDataRepositoryTest.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/maven-core/src/test/java/org/apache/maven/execution/DefaultBuildResumptionDataRepositoryTest.java b/maven-core/src/test/java/org/apache/maven/execution/DefaultBuildResumptionDataRepositoryTest.java index 7a03f85d10..ce7ab6a470 100644 --- a/maven-core/src/test/java/org/apache/maven/execution/DefaultBuildResumptionDataRepositoryTest.java +++ b/maven-core/src/test/java/org/apache/maven/execution/DefaultBuildResumptionDataRepositoryTest.java @@ -27,7 +27,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Properties; -import static java.util.Arrays.asList; +import static java.util.Collections.singleton; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsInAnyOrder; import static org.hamcrest.Matchers.empty; @@ -46,7 +46,7 @@ public class DefaultBuildResumptionDataRepositoryTest repository.applyResumptionProperties( request, properties ); - assertThat( request.getSelectedProjects(), is( asList( ":module-a" ) ) ); + assertThat( request.getProjectActivation().getOptionalActiveProjectSelectors(), is( singleton( ":module-a" ) ) ); } @Test @@ -74,7 +74,7 @@ public class DefaultBuildResumptionDataRepositoryTest repository.applyResumptionProperties( request, properties ); - assertThat( request.getSelectedProjects(), containsInAnyOrder( ":module-a", ":module-b", ":module-c" ) ); + assertThat( request.getProjectActivation().getOptionalActiveProjectSelectors(), containsInAnyOrder( ":module-a", ":module-b", ":module-c" ) ); } @Test @@ -86,7 +86,7 @@ public class DefaultBuildResumptionDataRepositoryTest repository.applyResumptionProperties( request, properties ); - assertThat( request.getSelectedProjects(), is( empty() ) ); + assertThat( request.getProjectActivation().getOptionalActiveProjectSelectors(), is( empty() ) ); } @Test @@ -100,6 +100,6 @@ public class DefaultBuildResumptionDataRepositoryTest repository.applyResumptionData( request, rootProject ); - assertThat( request.getSelectedProjects(), containsInAnyOrder( "example:module-c" ) ); + assertThat( request.getProjectActivation().getOptionalActiveProjectSelectors(), containsInAnyOrder( "example:module-c" ) ); } }