@Test(expected=NullPointerException.class) public void addHeaderMethodShouldThrowNpeWhenValueIsNull() { String key = "test"; String nullValue = null; String url = "test"; HttpMethod method = HttpMethod.GET; HttpContent httpContent = new HttpContent(url, method); httpContent.addHeader(key, nullValue); }
public void addHeader(String key, String value) { Assert.notNull(key, "Header key"); Assert.notNull(value, "Header value"); headers.put(key, value); }
HttpContent implements MultipartContainer { public void addHeader(String key, String value) { Assert.notNull(key, "Header key"); Assert.notNull(value, "Header value"); headers.put(key, value); } }
HttpContent implements MultipartContainer { public void addHeader(String key, String value) { Assert.notNull(key, "Header key"); Assert.notNull(value, "Header value"); headers.put(key, value); } HttpContent(String url, HttpMethod method); }
HttpContent implements MultipartContainer { public void addHeader(String key, String value) { Assert.notNull(key, "Header key"); Assert.notNull(value, "Header value"); headers.put(key, value); } HttpContent(String url, HttpMethod method); HttpMethod getMethod(); String getUrl(); void addHeader(String key, String value); String getHeader(String key); Map<String, String> getHeaders(); void setBody(byte[] body); byte[] getBody(); @Override boolean hasMultipart(); @Override Multipart getMultipart(); void addPart(Part part); }
HttpContent implements MultipartContainer { public void addHeader(String key, String value) { Assert.notNull(key, "Header key"); Assert.notNull(value, "Header value"); headers.put(key, value); } HttpContent(String url, HttpMethod method); HttpMethod getMethod(); String getUrl(); void addHeader(String key, String value); String getHeader(String key); Map<String, String> getHeaders(); void setBody(byte[] body); byte[] getBody(); @Override boolean hasMultipart(); @Override Multipart getMultipart(); void addPart(Part part);  }