/** * {@inheritDoc} */ @Override public String getMessage() { final int code = getStatusCode(); final String msg = getStatusMessage(); final URL url = getResponse().getRequestSettings().getUrl(); return code + " " + msg + " for " + url; }
/** * {@inheritDoc} */ @Override public String getMessage() { final int code = getStatusCode(); final String msg = getStatusMessage(); final URL url = getResponse().getRequestSettings().getUrl(); return code + " " + msg + " for " + url; }
/** * {@inheritDoc} */ @Override public String getMessage() { final int code = getStatusCode(); final String msg = getStatusMessage(); final URL url = getResponse().getRequestSettings().getUrl(); return code + " " + msg + " for " + url; }
do { if (e.getStatusCode() == HttpStatus.SC_MOVED_TEMPORARILY || e.getStatusCode() == HttpStatus.SC_SEE_OTHER) { final URL location = new URL(e.getResponse().getResponseHeaderValue(HttpHeaders.LOCATION)); final String locationQuery = location.getQuery(); if (locationQuery != null && locationQuery.contains("error=")) { throw e; final String location = e.getResponse().getResponseHeaderValue("Location"); redirectQuery = new URL(location).getQuery();
private void checkUrl(JenkinsRule.WebClient wc, String url) throws Exception { try { wc.goTo(url); fail(); } catch (FailingHttpStatusCodeException e) { WebResponse response = e.getResponse(); assertEquals(404, response.getStatusCode()); String content = response.getContentAsString(); assertFalse(content.contains("Search for")); } } }
} catch (FailingHttpStatusCodeException e) { assertEquals(e.getResponse().getStatusCode(),403);