@Test(expected=NullPointerException.class) public void testHeaderNameCannotBeNull(){ sut().withHeader(null,"value"); }
public HttpRequestBuilder withHeader(String name, String rawValue) { ImmutableHeader header = new ImmutableHeader( checkNotNull(name,"Header name cannot be null"), checkNotNull(rawValue,"Header raw value cannot be null"), Lists.<ImmutableElement>newArrayList()); if(!this.headers.contains(header)) { this.headers.add(header); } return this; }
HttpRequestBuilder { public HttpRequestBuilder withHeader(String name, String rawValue) { ImmutableHeader header = new ImmutableHeader( checkNotNull(name,"Header name cannot be null"), checkNotNull(rawValue,"Header raw value cannot be null"), Lists.<ImmutableElement>newArrayList()); if(!this.headers.contains(header)) { this.headers.add(header); } return this; } }
HttpRequestBuilder { public HttpRequestBuilder withHeader(String name, String rawValue) { ImmutableHeader header = new ImmutableHeader( checkNotNull(name,"Header name cannot be null"), checkNotNull(rawValue,"Header raw value cannot be null"), Lists.<ImmutableElement>newArrayList()); if(!this.headers.contains(header)) { this.headers.add(header); } return this; } private  HttpRequestBuilder(); }
HttpRequestBuilder { public HttpRequestBuilder withHeader(String name, String rawValue) { ImmutableHeader header = new ImmutableHeader( checkNotNull(name,"Header name cannot be null"), checkNotNull(rawValue,"Header raw value cannot be null"), Lists.<ImmutableElement>newArrayList()); if(!this.headers.contains(header)) { this.headers.add(header); } return this; } private  HttpRequestBuilder(); HttpRequestBuilder withMethod(HttpMethod method); HttpRequestBuilder withProtocolVersion(ProtocolVersion version); HttpRequestBuilder withHost(String host); HttpRequestBuilder withAbsolutePath(String absolutePath); HttpRequestBuilder withBody(String entity); HttpRequestBuilder withHeader(String name, String rawValue); HttpRequestBuilder withServerDate(Date date); HttpRequestBuilder withClientDate(Date date); HttpRequest build(); static HttpRequestBuilder newInstance(); }
HttpRequestBuilder { public HttpRequestBuilder withHeader(String name, String rawValue) { ImmutableHeader header = new ImmutableHeader( checkNotNull(name,"Header name cannot be null"), checkNotNull(rawValue,"Header raw value cannot be null"), Lists.<ImmutableElement>newArrayList()); if(!this.headers.contains(header)) { this.headers.add(header); } return this; } private  HttpRequestBuilder(); HttpRequestBuilder withMethod(HttpMethod method); HttpRequestBuilder withProtocolVersion(ProtocolVersion version); HttpRequestBuilder withHost(String host); HttpRequestBuilder withAbsolutePath(String absolutePath); HttpRequestBuilder withBody(String entity); HttpRequestBuilder withHeader(String name, String rawValue); HttpRequestBuilder withServerDate(Date date); HttpRequestBuilder withClientDate(Date date); HttpRequest build(); static HttpRequestBuilder newInstance();  }