{
MapVersionsPhase phase = (MapVersionsPhase) lookup( ReleasePhase.ROLE, "test-map-development-versions" );
Mock mockPrompter = new Mock( Prompter.class );
mockPrompter.expects( new InvokeOnceMatcher() ).method( "prompt" ).with( new IsAnything(),
new IsEqual( "1.1-SNAPSHOT" ) ).will(
new ReturnStub( "2.0-SNAPSHOT" ) );
phase.setPrompter( (Prompter) mockPrompter.proxy() );
List<MavenProject> reactorProjects = Collections.singletonList( createProject( "artifactId", "1.0" ) );
ReleaseDescriptor releaseDescriptor = new ReleaseDescriptor();
phase.execute( releaseDescriptor, new DefaultReleaseEnvironment(), reactorProjects );
assertEquals( "Check mapped versions", Collections.singletonMap( "groupId:artifactId", "2.0-SNAPSHOT" ),
releaseDescriptor.getDevelopmentVersions() );
releaseDescriptor = new ReleaseDescriptor();
mockPrompter.reset();
mockPrompter.expects( new InvokeOnceMatcher() ).method( "prompt" ).with( new IsAnything(),
new IsEqual( "1.1-SNAPSHOT" ) ).will(
new ReturnStub( "2.0-SNAPSHOT" ) );
phase.simulate( releaseDescriptor, new DefaultReleaseEnvironment(), reactorProjects );
assertEquals( "Check mapped versions", Collections.singletonMap( "groupId:artifactId", "2.0-SNAPSHOT" ),