archivaConfigurationControl.replay();
action.setRepoid( REPO_ID );
action.prepare();
assertEquals( REPO_ID, action.getRepoid() );
ManagedRepository repository = action.getRepository();
populateRepository( repository );
repository.setName( "new repo name" );
MockControl repositoryStatisticsManagerControl = MockControl.createControl( RepositoryStatisticsManager.class );
RepositoryStatisticsManager repositoryStatisticsManager =
(RepositoryStatisticsManager) repositoryStatisticsManagerControl.getMock();
( (DefaultManagedRepositoryAdmin) getManagedRepositoryAdmin() ).setRepositoryStatisticsManager(
repositoryStatisticsManager );
// no deletion
repositoryStatisticsManagerControl.replay();
new File( "target/test/" + REPO_ID + "-stage" ).mkdirs();
action.setRepository( repository );
action.setStageNeeded( true );
String status = action.commit();
assertEquals( Action.SUCCESS, status );
ManagedRepository newRepository = createRepository();
newRepository.setName( "new repo name" );
assertRepositoryEquals( repository, newRepository );
//assertEquals( Collections.singletonList( repository ), configuration.getManagedRepositories() );
//assertEquals( location.getCanonicalPath(), new File( repository.getLocation() ).getCanonicalPath() );
roleManagerControl.verify();