From: Martin Stockhammer Date: Wed, 14 Sep 2016 08:22:21 +0000 (+0200) Subject: Adding unit test for remote repository check X-Git-Tag: without_jdo~24^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5bb5f76520d5d0873cde6cb6171a44ea402f4f4b;p=archiva.git Adding unit test for remote repository check --- 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,