managedRepositoryAdmin.addManagedRepository( managedRepositoryOne, false, getFakeAuditInformation() );
managedRepositoryAdmin.addManagedRepository( managedRepositoryTwo, false, getFakeAuditInformation() );
RepositoryGroup repositoryGroup = new RepositoryGroup( "repo-group-one", Arrays.asList( "test-new-one" ) )
.mergedIndexTtl( 20 ).mergedIndexPath( "/.nonDefaultPath" );
mockAuditListener.clearEvents();
repositoryGroupAdmin.addRepositoryGroup( repositoryGroup, getFakeAuditInformation() );
assertEquals( 1, repositoryGroupAdmin.getRepositoriesGroups().size() );
assertEquals( "repo-group-one", repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getId() );
assertEquals( 1, repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getRepositories().size() );
assertEquals( Arrays.asList( "test-new-one" ),
repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getRepositories() );
assertEquals( 20, repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getMergedIndexTtl() );
assertEquals( "/.nonDefaultPath", repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getMergedIndexPath() );
repositoryGroup = repositoryGroupAdmin.getRepositoryGroup( "repo-group-one" );
assertNotNull( repositoryGroup );
repositoryGroup.addRepository( managedRepositoryTwo.getId() );
repositoryGroupAdmin.updateRepositoryGroup( repositoryGroup, getFakeAuditInformation() );
assertEquals( 1, repositoryGroupAdmin.getRepositoriesGroups().size() );
assertEquals( "repo-group-one", repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getId() );