@Test public void responseShouldFailWhenNetworkResponseParserIsWrong() { NetworkResponseParser otherResponseParser = new JacksonNetworkResponseParser(); String content = "test response"; NetworkResponse networkResponse = new NetworkResponse(content.getBytes()); VolleyerRequest<String> request = new VolleyerRequest<String>(httpContent, clazz, otherResponseParser, listener, errorListener); Response<String> response = request.parseNetworkResponse(networkResponse); assertThat(response.isSuccess(), is(false)); }
protected Response<T> parseNetworkResponse(NetworkResponse response) { return responseParser.parseNetworkResponse(response, clazz); }
VolleyerRequest extends Request<T> implements MultipartContainer { protected Response<T> parseNetworkResponse(NetworkResponse response) { return responseParser.parseNetworkResponse(response, clazz); } }
VolleyerRequest extends Request<T> implements MultipartContainer { protected Response<T> parseNetworkResponse(NetworkResponse response) { return responseParser.parseNetworkResponse(response, clazz); } VolleyerRequest(HttpContent httpContent, Class<T> clazz, NetworkResponseParser responseParser, Listener<T> listener, ErrorListener errorListener); }
VolleyerRequest extends Request<T> implements MultipartContainer { protected Response<T> parseNetworkResponse(NetworkResponse response) { return responseParser.parseNetworkResponse(response, clazz); } VolleyerRequest(HttpContent httpContent, Class<T> clazz, NetworkResponseParser responseParser, Listener<T> listener, ErrorListener errorListener); @Override Map<String, String> getHeaders(); @Override byte[] getBody(); @Override boolean hasMultipart(); @Override Multipart getMultipart(); }
VolleyerRequest extends Request<T> implements MultipartContainer { protected Response<T> parseNetworkResponse(NetworkResponse response) { return responseParser.parseNetworkResponse(response, clazz); } VolleyerRequest(HttpContent httpContent, Class<T> clazz, NetworkResponseParser responseParser, Listener<T> listener, ErrorListener errorListener); @Override Map<String, String> getHeaders(); @Override byte[] getBody(); @Override boolean hasMultipart(); @Override Multipart getMultipart();  }