use of com.gargoylesoftware.htmlunit.util.NameValuePair 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.util.NameValuePair 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.util.NameValuePair in project spring-framework by spring-projects.
the class HtmlUnitRequestBuilderTests method buildRequestParameterMapViaWebRequestDotSetRequestParametersWithSingleRequestParam.
@Test
public void buildRequestParameterMapViaWebRequestDotSetRequestParametersWithSingleRequestParam() {
webRequest.setRequestParameters(asList(new NameValuePair("name", "value")));
MockHttpServletRequest actualRequest = requestBuilder.buildRequest(servletContext);
assertThat(actualRequest.getParameterMap().size(), equalTo(1));
assertThat(actualRequest.getParameter("name"), equalTo("value"));
}
use of com.gargoylesoftware.htmlunit.util.NameValuePair in project spring-framework by spring-projects.
the class MockWebResponseBuilderTests method buildResponseHeadersNullDomainDefaulted.
// SPR-14169
@Test
public void buildResponseHeadersNullDomainDefaulted() throws Exception {
Cookie cookie = new Cookie("cookieA", "valueA");
this.response.addCookie(cookie);
WebResponse webResponse = this.responseBuilder.build();
List<NameValuePair> responseHeaders = webResponse.getResponseHeaders();
assertThat(responseHeaders.size(), equalTo(1));
NameValuePair header = responseHeaders.get(0);
assertThat(header.getName(), equalTo("Set-Cookie"));
assertThat(header.getValue(), equalTo("cookieA=valueA"));
}
use of com.gargoylesoftware.htmlunit.util.NameValuePair in project spring-framework by spring-projects.
the class MockWebResponseBuilderTests method buildResponseHeaders.
@Test
public void buildResponseHeaders() throws Exception {
this.response.addHeader("Content-Type", "text/html");
this.response.addHeader("X-Test", "value");
Cookie cookie = new Cookie("cookieA", "valueA");
cookie.setDomain("domain");
cookie.setPath("/path");
cookie.setMaxAge(1800);
cookie.setSecure(true);
cookie.setHttpOnly(true);
this.response.addCookie(cookie);
WebResponse webResponse = this.responseBuilder.build();
List<NameValuePair> responseHeaders = webResponse.getResponseHeaders();
assertThat(responseHeaders.size(), equalTo(3));
NameValuePair header = responseHeaders.get(0);
assertThat(header.getName(), equalTo("Content-Type"));
assertThat(header.getValue(), equalTo("text/html"));
header = responseHeaders.get(1);
assertThat(header.getName(), equalTo("X-Test"));
assertThat(header.getValue(), equalTo("value"));
header = responseHeaders.get(2);
assertThat(header.getName(), equalTo("Set-Cookie"));
assertThat(header.getValue(), startsWith("cookieA=valueA;domain=domain;path=/path;expires="));
assertThat(header.getValue(), endsWith(";secure;httpOnly"));
}
Aggregations