MRM-752 - Trim URL in Remote Repositories

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@658219 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
James William Dumay 2008-05-20 12:33:13 +00:00
parent 8dd8717642
commit a42449e3e6
2 changed files with 8 additions and 1 deletions

View File

@ -59,6 +59,9 @@ public class AddRemoteRepositoryAction
{
Configuration configuration = archivaConfiguration.getConfiguration();
//MRM-752 - url needs trimming
repository.setUrl(repository.getUrl().trim());
// Save the repository configuration.
String result;
try

View File

@ -102,11 +102,15 @@ public class AddRemoteRepositoryActionTest
action.prepare();
RemoteRepositoryConfiguration repository = action.getRepository();
populateRepository( repository );
assertEquals("url ", repository.getUrl());
String status = action.commit();
assertEquals( Action.SUCCESS, status );
assertEquals( Collections.singletonList( repository ), configuration.getRemoteRepositories() );
assertEquals("url", repository.getUrl());
archivaConfigurationControl.verify();
}
@ -115,7 +119,7 @@ public class AddRemoteRepositoryActionTest
{
repository.setId( REPO_ID );
repository.setName( "repo name" );
repository.setUrl( "url" );
repository.setUrl( "url " );
repository.setLayout( "default" );
}