diff options
author | Martin Stockhammer <m.stockhammer@web.de> | 2016-09-14 10:22:21 +0200 |
---|---|---|
committer | Martin Stockhammer <m.stockhammer@web.de> | 2016-09-14 10:22:21 +0200 |
commit | 5bb5f76520d5d0873cde6cb6171a44ea402f4f4b (patch) | |
tree | 0923b8f3de45b39b82df389c2627259d0b1e3c41 /archiva-modules | |
parent | e4a2e65f6e214bc0bb7248fd634e0160580e9ee0 (diff) | |
download | archiva-5bb5f76520d5d0873cde6cb6171a44ea402f4f4b.tar.gz archiva-5bb5f76520d5d0873cde6cb6171a44ea402f4f4b.zip |
Adding unit test for remote repository check
Diffstat (limited to 'archiva-modules')
-rw-r--r-- | archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RemoteRepositoriesServiceTest.java | 15 |
1 files changed, 15 insertions, 0 deletions
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, |