aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules
diff options
context:
space:
mode:
authorolivier lamy <olamy@apache.org>2016-09-14 20:50:40 +1000
committerolivier lamy <olamy@apache.org>2016-09-14 20:50:40 +1000
commite7e84d1bc769d8982e7fa83881e2e8eff4021e8f (patch)
treea864efaec3343b3eca02c91d0e18f17020f7ecb0 /archiva-modules
parentc997c883f02a5107d0ac6ecf8db210801e202f7e (diff)
parent5bb5f76520d5d0873cde6cb6171a44ea402f4f4b (diff)
downloadarchiva-e7e84d1bc769d8982e7fa83881e2e8eff4021e8f.tar.gz
archiva-e7e84d1bc769d8982e7fa83881e2e8eff4021e8f.zip
Merge branch 'pr/25'
[MRM-1909]
Diffstat (limited to 'archiva-modules')
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRemoteRepositoriesService.java3
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RemoteRepositoriesServiceTest.java15
2 files changed, 17 insertions, 1 deletions
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRemoteRepositoriesService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRemoteRepositoriesService.java
index 9c0bdd925..5a7948719 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRemoteRepositoriesService.java
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRemoteRepositoriesService.java
@@ -201,7 +201,8 @@ public class DefaultRemoteRepositoriesService
wagon.connect( new Repository( remoteRepository.getId(), remoteRepository.getUrl() ), proxyInfo );
// we only check connectivity as remote repo can be empty
- wagon.getFileList( "/" );
+ // MRM-1909: Wagon implementation appends a slash already
+ wagon.getFileList( "" );
return Boolean.TRUE;
}
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RemoteRepositoriesServiceTest.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RemoteRepositoriesServiceTest.java
index db857719f..3d284e452 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RemoteRepositoriesServiceTest.java
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RemoteRepositoriesServiceTest.java
@@ -146,6 +146,21 @@ public class RemoteRepositoriesServiceTest
}
+ @Test
+ public void checkRemoteConnectivity()
+ throws Exception {
+ RemoteRepositoriesService service = getRemoteRepositoriesService();
+
+ WebClient.client(service).header("Authorization", authorizationHeader);
+
+ int initialSize = service.getRemoteRepositories().size();
+
+ service.addRemoteRepository(getRemoteRepository());
+
+ assertTrue(service.checkRemoteConnectivity("id-new"));
+
+ }
+
RemoteRepository getRemoteRepository()
{
return new RemoteRepository( "id-new", "new one", "http://foo.com", "default", "foo", "foopassword", 120,