roleManager.createTemplatedRole( ArchivaRoleConstants.TEMPLATE_REPOSITORY_MANAGER, REPO_ID );
roleManagerControl.setVoidCallable();
roleManagerControl.replay();
Configuration configuration = createConfigurationForEditing( createRepository() );
archivaConfiguration.getConfiguration();
archivaConfigurationControl.setReturnValue( configuration );
archivaConfigurationControl.setReturnValue( configuration );
archivaConfigurationControl.setReturnValue( configuration );
archivaConfiguration.save( configuration );
archivaConfigurationControl.replay();
archivaDaoControl.expectAndReturn( archivaDao.getRepositoryContentStatisticsDAO(), repoContentStatsDao );
archivaDaoControl.replay();
repoContentStatsDao.queryRepositoryContentStatistics(
new RepositoryContentStatisticsByRepositoryConstraint( REPO_ID ) );
repoContentStatsDaoControl.setMatcher( MockControl.ALWAYS_MATCHER );
List<RepositoryContentStatistics> repoStats = createRepositoryContentStatisticsList();
repoContentStatsDaoControl.setReturnValue( repoStats );
repoContentStatsDao.deleteRepositoryContentStatistics( repoStats.get( 0 ) );
repoContentStatsDaoControl.setVoidCallable();
repoContentStatsDao.deleteRepositoryContentStatistics( repoStats.get( 1 ) );
repoContentStatsDaoControl.setVoidCallable();
repoContentStatsDaoControl.replay();
action.setRepoid( REPO_ID );
action.prepare();
assertEquals( REPO_ID, action.getRepoid() );
auditLogsDaoControl.expectAndReturn( auditLogsDao.saveAuditLogs( new ArchivaAuditLogs() ), null );
auditLogsDaoControl.replay();
ManagedRepositoryConfiguration repository = new ManagedRepositoryConfiguration();
populateRepository( repository );
repository.setLocation( new File( "target/test/location/new" ).getCanonicalPath() );
action.setRepository( repository );
String status = action.commit();
assertEquals( Action.SUCCESS, status );
assertEquals( Collections.singletonList( repository ), configuration.getManagedRepositories() );
roleManagerControl.verify();
archivaConfigurationControl.verify();
archivaDaoControl.verify();
repoContentStatsDaoControl.verify();