(CheckDependencySnapshotsPhase) lookup( ReleasePhase.ROLE, "check-dependency-snapshots" );
ReleaseDescriptor releaseDescriptor = new ReleaseDescriptor();
List<MavenProject> reactorProjects = createDescriptorFromProjects( "snapshot-release-plugin" );
Prompter mockPrompter = mock( Prompter.class );
when( mockPrompter.prompt( anyString(), eq( YES_NO_ARRAY ), eq( NO ) ) ).thenThrow( new PrompterException(
"..." ) );
phase.setPrompter( mockPrompter );
try
{
phase.execute( releaseDescriptor, new DefaultReleaseEnvironment(), reactorProjects );
fail( "Should have failed execution" );
}
catch ( ReleaseExecutionException e )
{
assertEquals( "Check cause", PrompterException.class, e.getCause().getClass() );
}
mockPrompter = mock( Prompter.class );
when( mockPrompter.prompt( anyString(), eq( YES_NO_ARRAY ), eq( NO ) ) ).thenThrow( new PrompterException(
"..." ) );
try
{
phase.simulate( releaseDescriptor, new DefaultReleaseEnvironment(), reactorProjects );