@Test(expected = IllegalStateException.class) public void requestBuilderShouldThrowIllegalStateExceptionWhensetErrorListenerMethodIsCalledAgain() { String url = "http: HttpMethod method = HttpMethod.GET; VolleyerConfiguration configuration = DefaultVolleyerConfigurationFactory.create(); TestPurposeRequestBuilder builder = new TestPurposeRequestBuilder(requestQueue, configuration, url, method); ErrorListener errorListener = new ErrorListener(){ @Override public void onErrorResponse(VolleyError error) { }}; builder.withErrorListener(errorListener); builder.withErrorListener(errorListener); }
public ResponseBuilder<String> withErrorListener(ErrorListener errorListener) { assertFinishState(); ResponseBuilder<String> builder = withTargetClass(String.class); builder.withErrorListener(errorListener); return builder; }
RequestBuilder { public ResponseBuilder<String> withErrorListener(ErrorListener errorListener) { assertFinishState(); ResponseBuilder<String> builder = withTargetClass(String.class); builder.withErrorListener(errorListener); return builder; } }
RequestBuilder { public ResponseBuilder<String> withErrorListener(ErrorListener errorListener) { assertFinishState(); ResponseBuilder<String> builder = withTargetClass(String.class); builder.withErrorListener(errorListener); return builder; } RequestBuilder(RequestQueue requestQueue, VolleyerConfiguration configuration, String url, HttpMethod method); }
RequestBuilder { public ResponseBuilder<String> withErrorListener(ErrorListener errorListener) { assertFinishState(); ResponseBuilder<String> builder = withTargetClass(String.class); builder.withErrorListener(errorListener); return builder; } 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 { public ResponseBuilder<String> withErrorListener(ErrorListener errorListener) { assertFinishState(); ResponseBuilder<String> builder = withTargetClass(String.class); builder.withErrorListener(errorListener); return builder; } 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();  }