use of com.gargoylesoftware.htmlunit.WebResponse in project blueocean-plugin by jenkinsci.
the class GitSampleRepoRule method notifyCommit.
public void notifyCommit(JenkinsRule r) throws Exception {
synchronousPolling(r);
WebResponse webResponse = r.createWebClient().goTo("git/notifyCommit?url=" + bareUrl(), "text/plain").getWebResponse();
System.out.println(webResponse.getContentAsString());
for (NameValuePair pair : webResponse.getResponseHeaders()) {
if (pair.getName().equals("Triggered")) {
System.out.println("Triggered: " + pair.getValue());
}
}
r.waitUntilNoActivity();
}
use of com.gargoylesoftware.htmlunit.WebResponse in project spring-framework by spring-projects.
the class MockWebResponseBuilderTests method buildStatus.
@Test
public void buildStatus() throws Exception {
WebResponse webResponse = this.responseBuilder.build();
assertThat(webResponse.getStatusCode(), equalTo(200));
assertThat(webResponse.getStatusMessage(), equalTo("OK"));
}
use of com.gargoylesoftware.htmlunit.WebResponse in project spring-framework by spring-projects.
the class MockWebResponseBuilderTests method buildWebRequest.
@Test
public void buildWebRequest() throws Exception {
WebResponse webResponse = this.responseBuilder.build();
assertThat(webResponse.getWebRequest(), equalTo(this.webRequest));
}
use of com.gargoylesoftware.htmlunit.WebResponse in project spring-framework by spring-projects.
the class MockWebResponseBuilderTests method buildContentType.
@Test
public void buildContentType() throws Exception {
this.response.addHeader("Content-Type", "text/html; charset-UTF-8");
WebResponse webResponse = this.responseBuilder.build();
assertThat(webResponse.getContentType(), equalTo("text/html"));
}
use of com.gargoylesoftware.htmlunit.WebResponse in project spring-framework by spring-projects.
the class MockWebResponseBuilderTests method buildStatusWithCustomMessage.
@Test
public void buildStatusWithCustomMessage() throws Exception {
this.response.sendError(401, "Custom");
WebResponse webResponse = this.responseBuilder.build();
assertThat(webResponse.getStatusCode(), equalTo(401));
assertThat(webResponse.getStatusMessage(), equalTo("Custom"));
}
Aggregations