GithubServer extends ScmServerEndpoint { @Override public String getApiUrl() { return endpoint.getApiUri(); } GithubServer(Endpoint endpoint, Link parent); @Override String getId(); @Override String getName(); @Override String getApiUrl(); @Override Link getLink();  }
@Test public void testServerGithubEnterpriseTopLevelUrl() throws Exception { Map resp = request() .status(400) .jwtToken(token) .crumb( crumb ) .data(ImmutableMap.of( "name", "My Server", "apiUrl", getApiUrl() )) .post("/organizations/jenkins/scm/github-enterprise/servers/") .build(Map.class); List errors = (List) resp.get("errors"); Assert.assertEquals(1, errors.size()); Map error1 = (Map) errors.get(0); Assert.assertEquals("apiUrl", error1.get("field")); Assert.assertEquals(GithubServerContainer.ERROR_MESSAGE_INVALID_APIURL, error1.get("message")); Assert.assertEquals("INVALID", error1.get("code")); }