@Test(expected=NullPointerException.class) public void addHeaderMethodShouldThrowNpeWhenValueIsNull() { String key = "test"; String nullValue = null; String url = "test"; HttpMethod method = HttpMethod.GET; VolleyerConfiguration configuration = DefaultVolleyerConfigurationFactory.create(); TestPurposeRequestBuilder builder = new TestPurposeRequestBuilder(requestQueue, configuration, url, method); builder.addHeader(key, nullValue); }
@SuppressWarnings("unchecked") public B addHeader(String key, String value) { assertFinishState(); httpContent.addHeader(key, value); return (B) this; }
RequestBuilder { @SuppressWarnings("unchecked") public B addHeader(String key, String value) { assertFinishState(); httpContent.addHeader(key, value); return (B) this; } }
RequestBuilder { @SuppressWarnings("unchecked") public B addHeader(String key, String value) { assertFinishState(); httpContent.addHeader(key, value); return (B) this; } RequestBuilder(RequestQueue requestQueue, VolleyerConfiguration configuration, String url, HttpMethod method); }
RequestBuilder { @SuppressWarnings("unchecked") public B addHeader(String key, String value) { assertFinishState(); httpContent.addHeader(key, value); return (B) this; } RequestBuilder(RequestQueue requestQueue, VolleyerConfiguration configuration, String url, HttpMethod method); @SuppressWarnings("unchecked") B addHeader(String key, String value); ResponseBuilder<T> withTargetClass(Class<T> clazz); ResponseBuilder<String> withListener(Listener<String> listener); ResponseBuilder<String> withErrorListener(ErrorListener errorListener); Request<Void> execute(); }
RequestBuilder { @SuppressWarnings("unchecked") public B addHeader(String key, String value) { assertFinishState(); httpContent.addHeader(key, value); return (B) this; } RequestBuilder(RequestQueue requestQueue, VolleyerConfiguration configuration, String url, HttpMethod method); @SuppressWarnings("unchecked") B addHeader(String key, String value); ResponseBuilder<T> withTargetClass(Class<T> clazz); ResponseBuilder<String> withListener(Listener<String> listener); ResponseBuilder<String> withErrorListener(ErrorListener errorListener); Request<Void> execute();  }