Improve checkApiUrlValidity() method to support the private mode in GitHub Enterprise servers

This commit is contained in:
Manuel Recena
2016-03-05 17:42:25 +01:00
parent dbc79f8c42
commit ae85cf4b6c
2 changed files with 35 additions and 2 deletions

View File

@@ -124,6 +124,11 @@ public class GitHubTest {
@Test
public void testGitHubIsApiUrlValid() throws IOException {
GitHub github = GitHub.connectAnonymously();
github.checkApiUrlValidity();
//GitHub github = GitHub.connectToEnterpriseAnonymously("https://github.mycompany.com/api/v3/");
try {
github.checkApiUrlValidity();
} catch (IOException ioe) {
assertTrue(ioe.getMessage().contains("private mode enabled"));
}
}
}