private Prompter createMockPrompter( String resolveSnapshots, String resolutionType,
List<VersionPair> resolvedVersions, List<VersionPair> defaultVersions )
throws PrompterException
{
Prompter mockPrompter = mock( Prompter.class );
when( mockPrompter.prompt( anyString(), eq( YES_NO_ARRAY ), eq( NO ) ) ).thenReturn( resolveSnapshots );
when( mockPrompter.prompt( anyString(), eq( CHOICE_ARRAY ), eq( DEFAULT_CHOICE ) ) ).thenReturn(
resolutionType );
for ( int i = 0; i < resolvedVersions.size(); i++ )
{
when( mockPrompter.prompt( "Which release version should it be set to?", defaultVersions.get(
i ).releaseVersion ) ).thenReturn( resolvedVersions.get( i ).releaseVersion );
when( mockPrompter.prompt( "What version should the dependency be reset to for development?",
defaultVersions.get( i ).developmentVersion ) ).thenReturn( resolvedVersions.get(
i ).developmentVersion );
}
return mockPrompter;
}