archivaConfiguration.getConfiguration();
archivaConfigurationControl.setReturnValue( configuration, 4 );
archivaConfiguration.save( configuration );
archivaConfigurationControl.replay();
RepositoryGroupConfiguration repoGroup =
(RepositoryGroupConfiguration) configuration.getRepositoryGroups().get( 0 );
java.util.List<String> repositories = repoGroup.getRepositories();
assertEquals( 3, repositories.size() );
assertEquals( REPO1_ID, repositories.get( 0 ) );
assertEquals( REPO2_ID, repositories.get( 1 ) );
assertEquals( REPO3_ID, repositories.get( 2 ) );
// sort down first repo
action.setRepoGroupId( repoGroup.getId() );
action.setTargetRepo( REPO1_ID );
String result = action.sortDown();
assertEquals( Action.SUCCESS, result );
repoGroup = (RepositoryGroupConfiguration) configuration.getRepositoryGroups().get( 0 );
repositories = repoGroup.getRepositories();
assertEquals( 3, repositories.size() );
assertEquals( REPO2_ID, repositories.get( 0 ) );
assertEquals( REPO1_ID, repositories.get( 1 ) );
assertEquals( REPO3_ID, repositories.get( 2 ) );
}