]> source.dussan.org Git - archiva.git/commitdiff
MRM-752 - Trim URL in Remote Repositories
authorJames William Dumay <jdumay@apache.org>
Tue, 20 May 2008 12:33:13 +0000 (12:33 +0000)
committerJames William Dumay <jdumay@apache.org>
Tue, 20 May 2008 12:33:13 +0000 (12:33 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@658219 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AddRemoteRepositoryAction.java
archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/AddRemoteRepositoryActionTest.java

index 12b4920627449da78d25a47e52de1bc155e845b4..bcf51762478521de6b838602ee12a023f5bad45d 100644 (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
index 5089b07a3851b05916158b492d731fb5b64b60c2..8656ebe5a6182595819d1e5b9c4a47390200ef43 100644 (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" );
     }