@Test public void shouldIgnoreEmptyIntermediateResponseWhenRequestIsFinished() { when(mRequest.isFinished()).thenReturn(true); when(mRequest.isIntermediateResponseDelivered()).thenReturn(false); mResponseDelivery.postEmptyIntermediateResponse(mRequest, BallResponse.ResponseSource.LOCAL); verify(mRequest, new LastInteraction()).isFinished(); }
@Override public void postEmptyIntermediateResponse(BallRequest request, BallResponse.ResponseSource responseSource) { request.addMarker(MARKER_POST_EMPTY_INTERMEDIATE_RESPONSE); mResponsePoster.execute(new EmptyIntermediateDeliveryRunnable(request, responseSource, mNetworkQueue)); }
BallExecutorDelivery implements BallResponseDelivery { @Override public void postEmptyIntermediateResponse(BallRequest request, BallResponse.ResponseSource responseSource) { request.addMarker(MARKER_POST_EMPTY_INTERMEDIATE_RESPONSE); mResponsePoster.execute(new EmptyIntermediateDeliveryRunnable(request, responseSource, mNetworkQueue)); } }
BallExecutorDelivery implements BallResponseDelivery { @Override public void postEmptyIntermediateResponse(BallRequest request, BallResponse.ResponseSource responseSource) { request.addMarker(MARKER_POST_EMPTY_INTERMEDIATE_RESPONSE); mResponsePoster.execute(new EmptyIntermediateDeliveryRunnable(request, responseSource, mNetworkQueue)); } BallExecutorDelivery(final Handler handler, PriorityBlockingQueue<BallRequest> networkQueue);  BallExecutorDelivery(Executor executor); }
BallExecutorDelivery implements BallResponseDelivery { @Override public void postEmptyIntermediateResponse(BallRequest request, BallResponse.ResponseSource responseSource) { request.addMarker(MARKER_POST_EMPTY_INTERMEDIATE_RESPONSE); mResponsePoster.execute(new EmptyIntermediateDeliveryRunnable(request, responseSource, mNetworkQueue)); } 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 postEmptyIntermediateResponse(BallRequest request, BallResponse.ResponseSource responseSource) { request.addMarker(MARKER_POST_EMPTY_INTERMEDIATE_RESPONSE); mResponsePoster.execute(new EmptyIntermediateDeliveryRunnable(request, responseSource, mNetworkQueue)); } 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; }