private void prepareAction( List<String> selectedRepositories, List<String> availableRepositories )
throws Exception
{
MockControl managedRepositoryControl = MockControl.createControl( ManagedRepositoryAdmin.class );
ManagedRepositoryAdmin managedRepositoryAdmin = (ManagedRepositoryAdmin) managedRepositoryControl.getMock();
Map<String, ManagedRepository> map = new HashMap<String, ManagedRepository>( availableRepositories.size() );
for ( String repoId : availableRepositories )
{
map.put( repoId, new ManagedRepository() );
}
managedRepositoryControl.expectAndReturn( managedRepositoryAdmin.getManagedRepositoriesAsMap(), map, 1, 10 );
managedRepositoryControl.replay();
action.setManagedRepositoryAdmin( managedRepositoryAdmin );