Make HttpConnector a functional interface

This commit is contained in:
Liam Newman
2020-02-25 20:23:40 -08:00
parent fe4f45c2b0
commit 0155d5aa39
5 changed files with 91 additions and 18 deletions

View File

@@ -1,6 +1,5 @@
package org.kohsuke.github;
import org.junit.Ignore;
import org.junit.Test;
import java.io.IOException;
@@ -106,11 +105,13 @@ public class GitHubConnectionTest extends AbstractGitHubWireMockTest {
assertEquals("", github.getClient().login);
}
@Ignore
@Test
public void testGitHubIsApiUrlValid() throws IOException {
GitHub hub = GitHub.connectAnonymously();
// GitHub hub = GitHub.connectToEnterpriseAnonymously(mockGitHub.apiServer().baseUrl());
// NOTE: We cannot test connectAnonymously on a general basis because it can hang if
// rate limit is reached. We connectToEnterpriseAnonymously as the nearest equivalent.
// GitHub hub = GitHub.connectAnonymously();
GitHub hub = GitHub.connectToEnterpriseAnonymously(mockGitHub.apiServer().baseUrl());
try {
hub.checkApiUrlValidity();
} catch (IOException ioe) {