@Test public void testOnResponseNetworkErrorCalledForNetworkErrors() { OnStatusCodeAwareResponseListener onStatusCodeAwareResponseListener = mock(OnStatusCodeAwareResponseListener.class); ForwardingResponse forwardingResponse = new ForwardingResponse(onStatusCodeAwareResponseListener); RequestStats requestStats = new RequestStats(1); requestStats.statusCode = (400); requestStats.hostName = ("flipkart.com"); NetworkInfo info = mock(NetworkInfo.class); IOException e = new IOException("Test error"); forwardingResponse.onResponseError(info, requestStats, e); verify(onStatusCodeAwareResponseListener, times(1)).onResponseNetworkError(info, requestStats, e); }
@Override public void onResponseError(NetworkInfo info, RequestStats requestStats, Exception e) { mOnStatusCodeAwareResponseListener.onResponseNetworkError(info, requestStats, e); }
ForwardingResponse implements OnResponseListener { @Override public void onResponseError(NetworkInfo info, RequestStats requestStats, Exception e) { mOnStatusCodeAwareResponseListener.onResponseNetworkError(info, requestStats, e); } }
ForwardingResponse implements OnResponseListener { @Override public void onResponseError(NetworkInfo info, RequestStats requestStats, Exception e) { mOnStatusCodeAwareResponseListener.onResponseNetworkError(info, requestStats, e); } ForwardingResponse(OnStatusCodeAwareResponseListener onStatusCodeAwareResponseListener); }
ForwardingResponse implements OnResponseListener { @Override public void onResponseError(NetworkInfo info, RequestStats requestStats, Exception e) { mOnStatusCodeAwareResponseListener.onResponseNetworkError(info, requestStats, e); } ForwardingResponse(OnStatusCodeAwareResponseListener onStatusCodeAwareResponseListener); @Override void onResponseSuccess(NetworkInfo info, RequestStats requestStats); @Override void onResponseError(NetworkInfo info, RequestStats requestStats, Exception e); }
ForwardingResponse implements OnResponseListener { @Override public void onResponseError(NetworkInfo info, RequestStats requestStats, Exception e) { mOnStatusCodeAwareResponseListener.onResponseNetworkError(info, requestStats, e); } ForwardingResponse(OnStatusCodeAwareResponseListener onStatusCodeAwareResponseListener); @Override void onResponseSuccess(NetworkInfo info, RequestStats requestStats); @Override void onResponseError(NetworkInfo info, RequestStats requestStats, Exception e);  }