Merge branch 'pr/25'

[MRM-1909]
This commit is contained in:
olivier lamy 2016-09-14 20:50:40 +10:00
commit e7e84d1bc7
2 changed files with 17 additions and 1 deletions

View File

@ -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;
}

View 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,