]> source.dussan.org Git - archiva.git/commitdiff
Adding unit test for remote repository check 25/head
authorMartin Stockhammer <m.stockhammer@web.de>
Wed, 14 Sep 2016 08:22:21 +0000 (10:22 +0200)
committerMartin Stockhammer <m.stockhammer@web.de>
Wed, 14 Sep 2016 08:22:21 +0000 (10:22 +0200)
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RemoteRepositoriesServiceTest.java

index db857719f15bd2ec86a00b7b4dd4ae3a11156585..3d284e452697ded0e6f9b9e67debc3b7d77948ec 100644 (file)
@@ -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,