@Test public void shouldDeliverFinalIdenticalSuccessResponse() { Object response = new Object(); BallResponse.ResponseSource responseSource = BallResponse.ResponseSource.NETWORK; when(mRequest.isIntermediateResponseDelivered()).thenReturn(true); when(mResponse.isIntermediate()).thenReturn(false); when(mResponse.isSuccess()).thenReturn(true); when(mResponse.isIdentical()).thenReturn(true); when(mResponse.getResult()).thenReturn(response); when(mResponse.getResponseSource()).thenReturn(responseSource); mResponseDelivery.postResponse(mRequest, mResponse); verify(mRequest).setFinalResponseDelivered(true); verify(mRequest).deliverIdenticalFinalResponse(responseSource); verify(mRequest, new LastInteraction()).finish(String.format(BallExecutorDelivery.MARKER_DONE_WITH_RESPONSE_FROM, mResponse.getResponseSource().toString().toLowerCase())); }
@Override public void postResponse(BallRequest<?> request, BallResponse<?> response) { request.addMarker(MARKER_POST_RESPONSE); mResponsePoster.execute(new ResponseDeliveryRunnable(request, response, null)); }
BallExecutorDelivery implements BallResponseDelivery { @Override public void postResponse(BallRequest<?> request, BallResponse<?> response) { request.addMarker(MARKER_POST_RESPONSE); mResponsePoster.execute(new ResponseDeliveryRunnable(request, response, null)); } }
BallExecutorDelivery implements BallResponseDelivery { @Override public void postResponse(BallRequest<?> request, BallResponse<?> response) { request.addMarker(MARKER_POST_RESPONSE); mResponsePoster.execute(new ResponseDeliveryRunnable(request, response, null)); } BallExecutorDelivery(final Handler handler, PriorityBlockingQueue<BallRequest> networkQueue);  BallExecutorDelivery(Executor executor); }
BallExecutorDelivery implements BallResponseDelivery { @Override public void postResponse(BallRequest<?> request, BallResponse<?> response) { request.addMarker(MARKER_POST_RESPONSE); mResponsePoster.execute(new ResponseDeliveryRunnable(request, response, null)); } BallExecutorDelivery(final Handler handler, PriorityBlockingQueue<BallRequest> networkQueue);  BallExecutorDelivery(Executor executor); @Override void postResponse(BallRequest<?> request, BallResponse<?> response); @Override void postResponseAndForwardToNetwork(BallRequest<?> request, BallResponse<?> response); @Override void postError(BallRequest<?> request, VolleyError error); @Override void postEmptyIntermediateResponse(BallRequest request, BallResponse.ResponseSource responseSource); }
BallExecutorDelivery implements BallResponseDelivery { @Override public void postResponse(BallRequest<?> request, BallResponse<?> response) { request.addMarker(MARKER_POST_RESPONSE); mResponsePoster.execute(new ResponseDeliveryRunnable(request, response, null)); } BallExecutorDelivery(final Handler handler, PriorityBlockingQueue<BallRequest> networkQueue);  BallExecutorDelivery(Executor executor); @Override void postResponse(BallRequest<?> request, BallResponse<?> response); @Override void postResponseAndForwardToNetwork(BallRequest<?> request, BallResponse<?> response); @Override void postError(BallRequest<?> request, VolleyError error); @Override void postEmptyIntermediateResponse(BallRequest request, BallResponse.ResponseSource responseSource); static final String MARKER_POST_EMPTY_INTERMEDIATE_RESPONSE; static final String MARKER_POST_RESPONSE; static final String MARKER_POST_ERROR; static final String MARKER_INTERMEDIATE_RESPONSE_ALREADY_DELIVERED; static final String MARKER_DONE_WITH_RESPONSE_FROM; static final String MARKER_ERROR_IN_FINAL_RESPONSE_LET_INTERMEDIATE_CONTINUE; static final String MARKER_DONE_WITH_INTERMEDIATE_EMPTY_RESPONSE; static final String MARKER_DONE_WITH_INTERMEDIATE_RESPONSE; }