From 6af220b0bc52a48739b3591e4132648833af8def Mon Sep 17 00:00:00 2001 From: Niels Basjes Date: Sun, 12 Mar 2023 12:56:03 +0100 Subject: [PATCH] Replace old @Component with @Inject --- .../phase/AbstractMapVersionsPhase.java | 10 +- .../release/phase/MapBranchVersionsPhase.java | 6 +- .../phase/MapDevelopmentVersionsPhase.java | 6 +- .../phase/MapReleaseVersionsPhase.java | 6 +- .../release/phase/MapVersionsPhaseTest.java | 174 +++++++++--------- 5 files changed, 105 insertions(+), 97 deletions(-) diff --git a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractMapVersionsPhase.java b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractMapVersionsPhase.java index 89c9ea404..53e20efab 100644 --- a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractMapVersionsPhase.java +++ b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractMapVersionsPhase.java @@ -38,8 +38,6 @@ import org.apache.maven.shared.release.scm.ScmRepositoryConfigurator; import org.apache.maven.shared.release.util.ReleaseUtil; import org.apache.maven.shared.release.versions.VersionParseException; -import org.codehaus.plexus.component.annotations.Component; -import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.components.interactivity.Prompter; import org.codehaus.plexus.components.interactivity.PrompterException; import org.codehaus.plexus.util.StringUtils; @@ -75,15 +73,13 @@ * @author Brett Porter * @author Robert Scholte */ -@Component( role = ReleasePhase.class, hint = "map-release-versions" ) public abstract class AbstractMapVersionsPhase extends AbstractReleasePhase { /** * Tool that gets a configured SCM repository from release configuration. */ - @Requirement - private ScmRepositoryConfigurator scmRepositoryConfigurator; + private final ScmRepositoryConfigurator scmRepositoryConfigurator; /** * Component used to prompt for input. @@ -105,9 +101,11 @@ public abstract class AbstractMapVersionsPhase */ private final boolean convertToBranch; - public AbstractMapVersionsPhase( Prompter prompter, Map versionPolicies, + public AbstractMapVersionsPhase( ScmRepositoryConfigurator scmRepositoryConfigurator, + Prompter prompter, Map versionPolicies, boolean convertToSnapshot, boolean convertToBranch ) { + this.scmRepositoryConfigurator = requireNonNull( scmRepositoryConfigurator ); this.prompter = requireNonNull( prompter ); this.versionPolicies = requireNonNull( versionPolicies ); this.convertToSnapshot = convertToSnapshot; diff --git a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/MapBranchVersionsPhase.java b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/MapBranchVersionsPhase.java index ae81496fd..c3a3cb92a 100644 --- a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/MapBranchVersionsPhase.java +++ b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/MapBranchVersionsPhase.java @@ -26,6 +26,7 @@ import java.util.Map; import org.apache.maven.shared.release.policy.version.VersionPolicy; +import org.apache.maven.shared.release.scm.ScmRepositoryConfigurator; import org.codehaus.plexus.components.interactivity.Prompter; /** @@ -61,8 +62,9 @@ public class MapBranchVersionsPhase extends AbstractMapVersionsPhase { @Inject - public MapBranchVersionsPhase( Prompter prompter, Map versionPolicies ) + public MapBranchVersionsPhase( ScmRepositoryConfigurator scmRepositoryConfigurator, + Prompter prompter, Map versionPolicies ) { - super( prompter, versionPolicies, true, true ); + super( scmRepositoryConfigurator, prompter, versionPolicies, true, true ); } } diff --git a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/MapDevelopmentVersionsPhase.java b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/MapDevelopmentVersionsPhase.java index d0ab04af7..76c2efc17 100644 --- a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/MapDevelopmentVersionsPhase.java +++ b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/MapDevelopmentVersionsPhase.java @@ -26,6 +26,7 @@ import java.util.Map; import org.apache.maven.shared.release.policy.version.VersionPolicy; +import org.apache.maven.shared.release.scm.ScmRepositoryConfigurator; import org.codehaus.plexus.components.interactivity.Prompter; /** @@ -61,8 +62,9 @@ public class MapDevelopmentVersionsPhase extends AbstractMapVersionsPhase { @Inject - public MapDevelopmentVersionsPhase( Prompter prompter, Map versionPolicies ) + public MapDevelopmentVersionsPhase( ScmRepositoryConfigurator scmRepositoryConfigurator, + Prompter prompter, Map versionPolicies ) { - super( prompter, versionPolicies, true, false ); + super( scmRepositoryConfigurator, prompter, versionPolicies, true, false ); } } diff --git a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/MapReleaseVersionsPhase.java b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/MapReleaseVersionsPhase.java index c785f8aba..9627c3a0b 100644 --- a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/MapReleaseVersionsPhase.java +++ b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/MapReleaseVersionsPhase.java @@ -26,6 +26,7 @@ import java.util.Map; import org.apache.maven.shared.release.policy.version.VersionPolicy; +import org.apache.maven.shared.release.scm.ScmRepositoryConfigurator; import org.codehaus.plexus.components.interactivity.Prompter; /** @@ -61,8 +62,9 @@ public class MapReleaseVersionsPhase extends AbstractMapVersionsPhase { @Inject - public MapReleaseVersionsPhase( Prompter prompter, Map versionPolicies ) + public MapReleaseVersionsPhase( ScmRepositoryConfigurator scmRepositoryConfigurator, + Prompter prompter, Map versionPolicies ) { - super( prompter, versionPolicies, false, false ); + super( scmRepositoryConfigurator, prompter, versionPolicies, false, false ); } } diff --git a/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/MapVersionsPhaseTest.java b/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/MapVersionsPhaseTest.java index 8c8196ec5..804a7629f 100644 --- a/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/MapVersionsPhaseTest.java +++ b/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/MapVersionsPhaseTest.java @@ -47,6 +47,7 @@ import org.apache.maven.shared.release.env.DefaultReleaseEnvironment; import org.apache.maven.shared.release.policy.PolicyException; import org.apache.maven.shared.release.policy.version.VersionPolicy; +import org.apache.maven.shared.release.scm.ScmRepositoryConfigurator; import org.apache.maven.shared.release.versions.VersionParseException; import org.codehaus.plexus.components.interactivity.Prompter; import org.codehaus.plexus.components.interactivity.PrompterException; @@ -63,6 +64,9 @@ public class MapVersionsPhaseTest extends PlexusJUnit4TestCase { + @Mock + private ScmRepositoryConfigurator scmRepositoryConfigurator; + @Mock private Prompter mockPrompter; @@ -93,7 +97,7 @@ public void testExecuteSnapshot_MapRelease() MavenProject project = createProject( "artifactId", "1.0-SNAPSHOT" ); when( mockPrompter.prompt( startsWith( "What is the release version for \"" + project.getName() + "\"?" ), eq( "1.0" ) ) ).thenReturn( "2.0" ); - MapReleaseVersionsPhase phase = new MapReleaseVersionsPhase( mockPrompter, versionPolicies ); + MapReleaseVersionsPhase phase = new MapReleaseVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( project ); @@ -118,7 +122,7 @@ public void testSimulateSnapshot_MapReleaseVersions() MavenProject project = createProject( "artifactId", "1.0-SNAPSHOT" ); when( mockPrompter.prompt( startsWith( "What is the release version for \"" + project.getName() + "\"?" ), eq( "1.0" ) ) ).thenReturn( "2.0" ); - MapReleaseVersionsPhase phase = new MapReleaseVersionsPhase( mockPrompter, versionPolicies ); + MapReleaseVersionsPhase phase = new MapReleaseVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( project ); @@ -143,7 +147,7 @@ public void testMapReleaseVersionsInteractiveAddZeroIncremental() MavenProject project = createProject( "artifactId", "1.0-SNAPSHOT" ); when( mockPrompter.prompt( startsWith( "What is the release version for \"" + project.getName() + "\"?" ), eq( "1.0" ) ) ).thenReturn( "1.0.0" ); - MapReleaseVersionsPhase phase = new MapReleaseVersionsPhase( mockPrompter, versionPolicies ); + MapReleaseVersionsPhase phase = new MapReleaseVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( project ); @@ -181,7 +185,7 @@ public void testMapReleaseVersionsInteractiveWithSnaphotVersion() MavenProject project = createProject( "artifactId", "SNAPSHOT" ); when( mockPrompter.prompt( startsWith( "What is the release version for \"" + project.getName() + "\"?" ), eq( "1.0" ) ) ).thenReturn( "2.0" ); - MapReleaseVersionsPhase phase = new MapReleaseVersionsPhase( mockPrompter, versionPolicies ); + MapReleaseVersionsPhase phase = new MapReleaseVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( project ); @@ -219,7 +223,7 @@ public void testMapReleaseVersionsNonInteractiveWithExplicitVersion() // prepare List reactorProjects = Collections.singletonList( createProject( "artifactId", "SNAPSHOT" ) ); - MapReleaseVersionsPhase phase = new MapReleaseVersionsPhase( mockPrompter, versionPolicies ); + MapReleaseVersionsPhase phase = new MapReleaseVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); ReleaseDescriptorBuilder builder = new ReleaseDescriptorBuilder(); builder.addReleaseVersion( "groupId:artifactId", "2.0" ); @@ -259,7 +263,7 @@ public void testMapReleaseVersionsForSubModuleWithExplicitVersion() List reactorProjects = Arrays.asList( rootProject, moduleProject ); - MapReleaseVersionsPhase phase = new MapReleaseVersionsPhase( mockPrompter, versionPolicies ); + MapReleaseVersionsPhase phase = new MapReleaseVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); ReleaseDescriptorBuilder builder = new ReleaseDescriptorBuilder() .setInteractive(false) // batch mode @@ -301,7 +305,7 @@ public void testMapDevelopmentVersionsForSubModuleWithExplicitVersion() List reactorProjects = Arrays.asList( rootProject, moduleProject ); - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); ReleaseDescriptorBuilder builder = new ReleaseDescriptorBuilder() .setInteractive( false ) // batch mode @@ -333,7 +337,7 @@ public void testExecuteSnapshotNonInteractive_MapRelease() throws Exception { // prepare - MapReleaseVersionsPhase phase = new MapReleaseVersionsPhase( mockPrompter, versionPolicies ); + MapReleaseVersionsPhase phase = new MapReleaseVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.0-SNAPSHOT" ) ); @@ -353,7 +357,7 @@ public void testSimulateSnapshotNonInteractive_MapReleaseVersions() throws Exception { // prepare - MapReleaseVersionsPhase phase = new MapReleaseVersionsPhase( mockPrompter, versionPolicies ); + MapReleaseVersionsPhase phase = new MapReleaseVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.0-SNAPSHOT" ) ); @@ -376,7 +380,7 @@ public void testMapDevVersionsInteractive() MavenProject project = createProject( "artifactId", "1.0" ); when( mockPrompter.prompt( startsWith( "What is the new development version for \"" + project.getName() + "\"?" ), eq( "1.1-SNAPSHOT" ) ) ).thenReturn( "2.0-SNAPSHOT" ); - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( project ); @@ -411,7 +415,7 @@ public void testMapDevVersionsInteractiveDoNotUpdateWorkingCopy() throws Exception { // prepare - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); MavenProject project = createProject( "artifactId", "1.0" ); List reactorProjects = Collections.singletonList( project ); @@ -443,7 +447,7 @@ public void testMapDevVersionsNonInteractive() throws Exception { // prepare - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.0" ) ); @@ -477,7 +481,7 @@ public void testMapDevVersionsNonInteractiveWithExplicitVersion() throws Exception { // prepare - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.0" ) ); ReleaseDescriptorBuilder builder = new ReleaseDescriptorBuilder(); @@ -511,7 +515,7 @@ public void testPrompterException() // prepare when( mockPrompter.prompt( isA( String.class ), isA( String.class ) ) ).thenThrow( new PrompterException( "..." ) ); - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.0" ) ); @@ -557,7 +561,7 @@ public void testAdjustVersionInteractive() when( mockPrompter.prompt( startsWith( "What is the new development version for \"" + project.getName() + "\"?" ), eq( "1.1-SNAPSHOT" ) ) ).thenReturn( "2.0-SNAPSHOT" ); - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( project ); @@ -587,7 +591,7 @@ public void testAdjustVersionInteractive() @Test public void testAdjustVersionNonInteractive() { - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "foo" ) ); @@ -625,7 +629,7 @@ public void testExecuteSnapshotBranchCreation_DefaultDevelopmentVersion_MapDevel throws Exception { // prepare - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2-SNAPSHOT" ) ); @@ -647,7 +651,7 @@ public void testSimulateSnapshotBranchCreation_DefaultDevelopmentVersion_MapDeve throws Exception { // prepare - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2-SNAPSHOT" ) ); @@ -669,7 +673,7 @@ public void testExecuteSnapshotBranchCreation_DefaultDevelopmentVersion_NonInter throws Exception { // prepare - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2-SNAPSHOT" ) ); @@ -692,7 +696,7 @@ public void testSimulateSnapshotBranchCreation_DefaultDevelopmentVersion_NonInte throws Exception { // prepare - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2-SNAPSHOT" ) ); @@ -715,7 +719,7 @@ public void testExecuteSnapshotBranchCreation_NonInteractive_MapDevelopment() throws Exception { // prepare - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2-SNAPSHOT" ) ); @@ -737,7 +741,7 @@ public void testSimulateSnapshotBranchCreation_NonInteractive_MapDevelopment() throws Exception { // prepare - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2-SNAPSHOT" ) ); @@ -759,7 +763,7 @@ public void testExecuteSnapshotDefaultDevelopmentVersion_MapDevelopment() throws Exception { // prepare - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2-SNAPSHOT" ) ); @@ -780,7 +784,7 @@ public void testSimulateSnapshotDefaultDevelopmentVersion_MapDevelopment() throws Exception { // prepare - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2-SNAPSHOT" ) ); @@ -801,7 +805,7 @@ public void testExecuteSnapshotDefaultDevelopmentVersion_NonInteractive_MapDevel throws Exception { // prepare - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2-SNAPSHOT" ) ); @@ -823,7 +827,7 @@ public void testSimulateSnapshotDefaultDevelopmentVersion_NonInteractive_MapDeve throws Exception { // prepare - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2-SNAPSHOT" ) ); @@ -845,7 +849,7 @@ public void testExecuteSnapshotNonInteractive_MapDevelopment() throws Exception { // prepare - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2-SNAPSHOT" ) ); @@ -866,7 +870,7 @@ public void testSimulateSnapshotNonInteractive_MapDevelopment() throws Exception { // prepare - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2-SNAPSHOT" ) ); @@ -887,7 +891,7 @@ public void testExecuteSnapshotAutoVersionSubmodules_NotInteractive_MapDevelopme throws Exception { // verify - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2-SNAPSHOT" ) ); @@ -909,7 +913,7 @@ public void testSimulateSnapshotAutoVersionSubmodules_NotInteractive_MapDevelopm throws Exception { // verify - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2-SNAPSHOT" ) ); @@ -931,7 +935,7 @@ public void testExecuteReleaseAutoVersionSubmodules_NotInteractive_MapDevelopmen throws Exception { // verify - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2" ) ); @@ -953,7 +957,7 @@ public void testSimulateReleaseAutoVersionSubmodules_NotInteractive_MapDevelopme throws Exception { // verify - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2" ) ); @@ -975,7 +979,7 @@ public void testExecuteSnapshotAutoVersionSubmodules_NotInteractive_MapRelease() throws Exception { // verify - MapReleaseVersionsPhase phase = new MapReleaseVersionsPhase( mockPrompter, versionPolicies ); + MapReleaseVersionsPhase phase = new MapReleaseVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2-SNAPSHOT" ) ); @@ -998,7 +1002,7 @@ public void testSimulateSnapshotAutoVersionSubmodules_NotInteractive_MapRelease( throws Exception { // verify - MapReleaseVersionsPhase phase = new MapReleaseVersionsPhase( mockPrompter, versionPolicies ); + MapReleaseVersionsPhase phase = new MapReleaseVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2-SNAPSHOT" ) ); @@ -1021,7 +1025,7 @@ public void testExecuteReleaseAutoVersionSubmodules_NotInteractive_MapRelease() throws Exception { // verify - MapReleaseVersionsPhase phase = new MapReleaseVersionsPhase( mockPrompter, versionPolicies ); + MapReleaseVersionsPhase phase = new MapReleaseVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2" ) ); @@ -1044,7 +1048,7 @@ public void testSimulateReleaseAutoVersionSubmodules_NotInteractive_MapRelease() throws Exception { // verify - MapReleaseVersionsPhase phase = new MapReleaseVersionsPhase( mockPrompter, versionPolicies ); + MapReleaseVersionsPhase phase = new MapReleaseVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2" ) ); @@ -1067,7 +1071,7 @@ public void testExecuteSnapshotAutoVersionSubmodules_BranchCreation_NotInteracti throws Exception { // prepare - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2-SNAPSHOT" ) ); @@ -1090,7 +1094,7 @@ public void testSimulateSnapshotAutoVersionSubmodules_BranchCreation_NotInteract throws Exception { // prepare - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2-SNAPSHOT" ) ); @@ -1113,7 +1117,7 @@ public void testExecuteReleaseAutoVersionSubmodules_BranchCreation_NotInteractiv throws Exception { // prepare - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2" ) ); @@ -1136,7 +1140,7 @@ public void testSimulateReleaseAutoVersionSubmodules_BranchCreation_NotInteracti throws Exception { // prepare - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2" ) ); @@ -1159,7 +1163,7 @@ public void testExecuteSnapshotAutoVersionSubmodules_BranchCreation_NotInteracti throws Exception { // prepare - MapBranchVersionsPhase phase = new MapBranchVersionsPhase( mockPrompter, versionPolicies ); + MapBranchVersionsPhase phase = new MapBranchVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2-SNAPSHOT" ) ); @@ -1183,7 +1187,7 @@ public void testSimulateSnapshotAutoVersionSubmodules_BranchCreation_NotInteract throws Exception { // prepare - MapBranchVersionsPhase phase = new MapBranchVersionsPhase( mockPrompter, versionPolicies ); + MapBranchVersionsPhase phase = new MapBranchVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2-SNAPSHOT" ) ); @@ -1207,7 +1211,7 @@ public void testExecuteReleaseAutoVersionSubmodules_BranchCreation_NotInteractiv throws Exception { // prepare - MapBranchVersionsPhase phase = new MapBranchVersionsPhase( mockPrompter, versionPolicies ); + MapBranchVersionsPhase phase = new MapBranchVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2" ) ); @@ -1236,7 +1240,7 @@ public void testSimulateReleaseAutoVersionSubmodules_BranchCreation_NotInteracti throws Exception { // prepare - MapBranchVersionsPhase phase = new MapBranchVersionsPhase( mockPrompter, versionPolicies ); + MapBranchVersionsPhase phase = new MapBranchVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2" ) ); @@ -1265,7 +1269,7 @@ public void testExecuteSnapshotBranchCreation_NonInteractive_UpdateBranchVersion throws Exception { // prepare - MapBranchVersionsPhase phase = new MapBranchVersionsPhase( mockPrompter, versionPolicies ); + MapBranchVersionsPhase phase = new MapBranchVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2-SNAPSHOT" ) ); @@ -1292,7 +1296,7 @@ public void testSimulateSnapshotBranchCreation_NonInteractive_UpdateBranchVersio throws Exception { // prepare - MapBranchVersionsPhase phase = new MapBranchVersionsPhase( mockPrompter, versionPolicies ); + MapBranchVersionsPhase phase = new MapBranchVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2-SNAPSHOT" ) ); @@ -1319,7 +1323,7 @@ public void testExecuteSnapshotBranchCreation_DefaultReleaseVersion_NonInteracti throws Exception { // prepare - MapBranchVersionsPhase phase = new MapBranchVersionsPhase( mockPrompter, versionPolicies ); + MapBranchVersionsPhase phase = new MapBranchVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2-SNAPSHOT" ) ); @@ -1344,7 +1348,7 @@ public void testSimulateSnapshotBranchCreation_DefaultReleaseVersion_NonInteract throws Exception { // prepare - MapBranchVersionsPhase phase = new MapBranchVersionsPhase( mockPrompter, versionPolicies ); + MapBranchVersionsPhase phase = new MapBranchVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2-SNAPSHOT" ) ); @@ -1369,7 +1373,7 @@ public void testExecuteSnapshotBranchCreation_DefaultReleaseVersion_UpdateBranch throws Exception { // prepare - MapBranchVersionsPhase phase = new MapBranchVersionsPhase( mockPrompter, versionPolicies ); + MapBranchVersionsPhase phase = new MapBranchVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2-SNAPSHOT" ) ); @@ -1393,7 +1397,7 @@ public void testSimulateSnapshotBranchCreation_DefaultReleaseVersion_UpdateBranc throws Exception { // prepare - MapBranchVersionsPhase phase = new MapBranchVersionsPhase( mockPrompter, versionPolicies ); + MapBranchVersionsPhase phase = new MapBranchVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2-SNAPSHOT" ) ); @@ -1422,7 +1426,7 @@ public void testExecuteSnapshotBranchCreation_UpdateBranchVersions_MapBranch() // org.apache.maven.release:maven-release-manager:[2.4,) > 1.3-SNAPSHOT when( mockPrompter.prompt( startsWith( "What is the branch version for" ), eq( "1.3-SNAPSHOT" ) ) ).thenReturn( "2.0-SNAPSHOT" ); - MapBranchVersionsPhase phase = new MapBranchVersionsPhase( mockPrompter, versionPolicies ); + MapBranchVersionsPhase phase = new MapBranchVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2-SNAPSHOT" ) ); @@ -1449,7 +1453,7 @@ public void testSimulateSnapshotBranchCreation_UpdateBranchVersions_MapBranch() // org.apache.maven.release:maven-release-manager:[2.4,) > 1.3-SNAPSHOT when( mockPrompter.prompt( startsWith( "What is the branch version for" ), eq( "1.3-SNAPSHOT" ) ) ).thenReturn( "2.0-SNAPSHOT" ); - MapBranchVersionsPhase phase = new MapBranchVersionsPhase( mockPrompter, versionPolicies ); + MapBranchVersionsPhase phase = new MapBranchVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2-SNAPSHOT" ) ); @@ -1476,7 +1480,7 @@ public void testExecuteReleaseBranchCreation_UpdateBranchVersions_UpdateVersions // org.apache.maven.release:maven-release-manager:[2.4,) > 1.3-SNAPSHOT when( mockPrompter.prompt( startsWith( "What is the branch version for" ), eq( "1.3-SNAPSHOT" ) ) ).thenReturn( "2.1-SNAPSHOT" ); - MapBranchVersionsPhase phase = new MapBranchVersionsPhase( mockPrompter, versionPolicies ); + MapBranchVersionsPhase phase = new MapBranchVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2" ) ); @@ -1508,7 +1512,7 @@ public void testSimulateReleaseBranchCreation_UpdateBranchVersions_UpdateVersion // org.apache.maven.release:maven-release-manager:[2.4,) > 1.3-SNAPSHOT when( mockPrompter.prompt( startsWith( "What is the branch version for" ), eq( "1.3-SNAPSHOT" ) ) ).thenReturn( "2.1-SNAPSHOT" ); - MapBranchVersionsPhase phase = new MapBranchVersionsPhase( mockPrompter, versionPolicies ); + MapBranchVersionsPhase phase = new MapBranchVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2" ) ); @@ -1540,7 +1544,7 @@ public void testExecuteSnapshotBranchCreation_UpdateBranchVersions_UpdateVersion // org.apache.maven.release:maven-release-manager:[2.4,) > 1.3-SNAPSHOT when( mockPrompter.prompt( startsWith( "What is the branch version for" ), eq( "1.3-SNAPSHOT" ) ) ).thenReturn( "2.0-SNAPSHOT" ); - MapBranchVersionsPhase phase = new MapBranchVersionsPhase( mockPrompter, versionPolicies ); + MapBranchVersionsPhase phase = new MapBranchVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2-SNAPSHOT" ) ); @@ -1568,7 +1572,7 @@ public void testSimulateSnapshotBranchCreation_UpdateBranchVersions_UpdateVersio // org.apache.maven.release:maven-release-manager:[2.4,) > 1.3-SNAPSHOT when( mockPrompter.prompt( startsWith( "What is the branch version for" ), eq( "1.3-SNAPSHOT" ) ) ).thenReturn( "2.0-SNAPSHOT" ); - MapBranchVersionsPhase phase = new MapBranchVersionsPhase( mockPrompter, versionPolicies ); + MapBranchVersionsPhase phase = new MapBranchVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2-SNAPSHOT" ) ); @@ -1591,7 +1595,7 @@ public void testExecuteReleaseBranchCreation_MapBranch() throws Exception { // prepare - MapBranchVersionsPhase phase = new MapBranchVersionsPhase( mockPrompter, versionPolicies ); + MapBranchVersionsPhase phase = new MapBranchVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2" ) ); @@ -1618,7 +1622,7 @@ public void testSimulateReleaseBranchCreation_MapBranch() throws Exception { // prepare - MapBranchVersionsPhase phase = new MapBranchVersionsPhase( mockPrompter, versionPolicies ); + MapBranchVersionsPhase phase = new MapBranchVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2" ) ); @@ -1645,7 +1649,7 @@ public void testExecuteReleaseBranchCreation_NonUpdateWorkingCopyVersions_MapDev throws Exception { // prepare - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2" ) ); @@ -1667,7 +1671,7 @@ public void testSimulateReleaseBranchCreation_NonUpdateWorkingCopyVersions_MapDe throws Exception { // prepare - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2" ) ); @@ -1689,7 +1693,7 @@ public void testExecuteReleaseBranchCreation_MapDevelopment() throws Exception { // prepare - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2" ) ); @@ -1711,7 +1715,7 @@ public void testSimulateReleaseBranchCreation_MapDevelopment() throws Exception { // prepare - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2" ) ); @@ -1735,7 +1739,7 @@ public void testExecuteSnapshotBranchCreation_MapBranch() throws Exception { // prepare - MapBranchVersionsPhase phase = new MapBranchVersionsPhase( mockPrompter, versionPolicies ); + MapBranchVersionsPhase phase = new MapBranchVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2-SNAPSHOT" ) ); @@ -1757,7 +1761,7 @@ public void testSimulateSnapshotBranchCreation_MapBranch() throws Exception { // prepare - MapBranchVersionsPhase phase = new MapBranchVersionsPhase( mockPrompter, versionPolicies ); + MapBranchVersionsPhase phase = new MapBranchVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2-SNAPSHOT" ) ); @@ -1779,7 +1783,7 @@ public void testExecuteSnapshotBranchCreation_NonUpdateWorkingCopyVersions_MapDe throws Exception { // prepare - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2-SNAPSHOT" ) ); @@ -1801,7 +1805,7 @@ public void testSimulateSnapshotBranchCreation_NonUpdateWorkingCopyVersions_MapD throws Exception { // prepare - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2-SNAPSHOT" ) ); @@ -1823,7 +1827,7 @@ public void testExecuteReleaseBranchCreation_UpdateBranchVersions_MapBranch() throws Exception { // prepare - MapBranchVersionsPhase phase = new MapBranchVersionsPhase( mockPrompter, versionPolicies ); + MapBranchVersionsPhase phase = new MapBranchVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2" ) ); @@ -1849,7 +1853,7 @@ public void testSimulateReleaseBranchCreation_UpdateBranchVersions_MapBranch() throws Exception { // prepare - MapBranchVersionsPhase phase = new MapBranchVersionsPhase( mockPrompter, versionPolicies ); + MapBranchVersionsPhase phase = new MapBranchVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2" ) ); @@ -1877,7 +1881,7 @@ public void testExecuteSnapshotBranchCreation_UpdateWorkingCopyVersions_MapDevel // prepare when( mockPrompter.prompt( startsWith( "What is the new working copy version for" ), eq( "1.3-SNAPSHOT" ) ) ).thenReturn( "2.0-SNAPSHOT" ); - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2-SNAPSHOT" ) ); @@ -1899,7 +1903,7 @@ public void testSimulateSnapshotBranchCreation_UpdateWorkingCopyVersions_MapDeve // prepare when( mockPrompter.prompt( startsWith( "What is the new working copy version for" ), eq( "1.3-SNAPSHOT" ) ) ).thenReturn( "2.0-SNAPSHOT" ); - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2-SNAPSHOT" ) ); @@ -1919,7 +1923,7 @@ public void testExecuteMultiModuleAutoVersionSubmodules__MapDevelopment() throws Exception { // verify - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = new ArrayList<>(); Collections.addAll( reactorProjects, createProject( "artifactId", "1.2-SNAPSHOT" ), @@ -1944,7 +1948,7 @@ public void testSimulateMultiModuleAutoVersionSubmodules__MapDevelopment() throws Exception { // verify - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = new ArrayList<>(); Collections.addAll( reactorProjects, createProject( "artifactId", "1.2-SNAPSHOT" ), @@ -1969,7 +1973,7 @@ public void testExecuteSnapshotAutoVersionSubmodules_DefaultReleaseVersion_NonIn throws Exception { // verify - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2.1-SNAPSHOT" ) ); @@ -1993,7 +1997,7 @@ public void testSimulateSnapshotAutoVersionSubmodules_DefaultReleaseVersion_NonI throws Exception { // verify - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2.1-SNAPSHOT" ) ); @@ -2017,7 +2021,7 @@ public void testExecuteSnapshotAutoVersionSubmodules_DefaultDevelopmentVersion_N throws Exception { // verify - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2.1-SNAPSHOT" ) ); @@ -2041,7 +2045,7 @@ public void testSimulateSnapshotAutoVersionSubmodules_DefaultDevelopmentVersion_ throws Exception { // verify - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.2.1-SNAPSHOT" ) ); @@ -2065,8 +2069,8 @@ public void testSimulateSnapshotAutoVersionSubmodules_DefaultDevelopmentVersion_ public void testUnusualVersions1() throws Exception { - MapReleaseVersionsPhase mapReleasephase = new MapReleaseVersionsPhase( mockPrompter, versionPolicies ); - MapDevelopmentVersionsPhase mapDevelopmentphase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapReleaseVersionsPhase mapReleasephase = new MapReleaseVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase mapDevelopmentphase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "MYB_200909-SNAPSHOT" ) ); @@ -2096,7 +2100,7 @@ public void testContinuousSnapshotCheck() when( mockPrompter.prompt( startsWith( "What is the new development version for " ), eq( "1.12-SNAPSHOT" ) ) ).thenReturn( "2.0" ) // wrong, expected SNAPSHOT .thenReturn( "2.0-SNAPSHOT" ); - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "bar", "1.11-SNAPSHOT" ) ); @@ -2118,7 +2122,7 @@ public void testEmptyDefaultDevelopmentVersion() // prepare when( mockPrompter.prompt( startsWith( "What is the new development version for " ), eq( "1.12-SNAPSHOT" ) ) ).thenReturn( "2.0-SNAPSHOT" ); - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "bar", "1.11-SNAPSHOT" ) ); @@ -2140,7 +2144,7 @@ public void testEmptyDefaultReleaseVersion() // prepare when( mockPrompter.prompt( startsWith( "What is the release version for " ), eq( "1.11" ) ) ).thenReturn( "2.0" ); - MapReleaseVersionsPhase phase = new MapReleaseVersionsPhase( mockPrompter, versionPolicies ); + MapReleaseVersionsPhase phase = new MapReleaseVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "bar", "1.11-SNAPSHOT" ) ); @@ -2161,7 +2165,7 @@ public void testEmptyDefaultReleaseVersion() public void testNonExistentVersionPolicy() { // prepare - MapReleaseVersionsPhase phase = new MapReleaseVersionsPhase( mockPrompter, versionPolicies ); + MapReleaseVersionsPhase phase = new MapReleaseVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "artifactId", "1.0-SNAPSHOT" ) ); @@ -2178,7 +2182,7 @@ public void testNonExistentVersionPolicy() public void testUpdateBranchInvalidDefaultReleaseVersion_NonInteractive() { // prepare - MapBranchVersionsPhase phase = new MapBranchVersionsPhase( mockPrompter, versionPolicies ); + MapBranchVersionsPhase phase = new MapBranchVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "bar", "1.11-SNAPSHOT" ) ); @@ -2202,7 +2206,7 @@ public void testUpdateBranchInvalidDefaultReleaseVersion_NonInteractive() public void testUpdateReleaseInvalidDefaultReleaseVersion_NonInteractive() { // prepare - MapReleaseVersionsPhase phase = new MapReleaseVersionsPhase( mockPrompter, versionPolicies ); + MapReleaseVersionsPhase phase = new MapReleaseVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "bar", "1.11-SNAPSHOT" ) ); @@ -2225,7 +2229,7 @@ public void testUpdateReleaseInvalidDefaultReleaseVersion_NonInteractive() public void testUpdateDevelopmentInvalidDefaultDevelopmentVersion_NonInteractive() { // prepare - MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( mockPrompter, versionPolicies ); + MapDevelopmentVersionsPhase phase = new MapDevelopmentVersionsPhase( scmRepositoryConfigurator, mockPrompter, versionPolicies ); List reactorProjects = Collections.singletonList( createProject( "bar", "1.11-SNAPSHOT" ) );