throws Exception
{
mockAuditListener.clearEvents();
int initialSize = remoteRepositoryAdmin.getRemoteRepositories().size();
RemoteRepository remoteRepository = getRemoteRepository();
remoteRepositoryAdmin.addRemoteRepository( remoteRepository, getFakeAuditInformation() );
assertEquals( initialSize + 1, remoteRepositoryAdmin.getRemoteRepositories().size() );
RemoteRepository repo = remoteRepositoryAdmin.getRemoteRepository( "foo" );
assertNotNull( repo );
assertEquals( getRemoteRepository().getPassword(), repo.getPassword() );
assertEquals( getRemoteRepository().getUrl(), repo.getUrl() );
assertEquals( getRemoteRepository().getUserName(), repo.getUserName() );
assertEquals( getRemoteRepository().getName(), repo.getName() );
assertEquals( getRemoteRepository().getTimeout(), repo.getTimeout() );
assertEquals( getRemoteRepository().getRemoteDownloadNetworkProxyId(), repo.getRemoteDownloadNetworkProxyId() );
repo.setUserName( "foo-name-changed" );
repo.setPassword( "titi" );
repo.setUrl( "http://foo.com/maven-really-rocks" );
repo.setRemoteDownloadNetworkProxyId( "toto" );
remoteRepositoryAdmin.updateRemoteRepository( repo, getFakeAuditInformation() );
repo = remoteRepositoryAdmin.getRemoteRepository( "foo" );
assertEquals( "foo-name-changed", repo.getUserName() );
assertEquals( "titi", repo.getPassword() );
assertEquals( "http://foo.com/maven-really-rocks", repo.getUrl() );
assertEquals( "toto", repo.getRemoteDownloadNetworkProxyId() );
remoteRepositoryAdmin.deleteRemoteRepository( "foo", getFakeAuditInformation() );
assertEquals( initialSize, remoteRepositoryAdmin.getRemoteRepositories().size() );