@Test
public void successNotifiesListener() throws Exception {

    RequestQueue.RequestEventListener listener = mock(RequestQueue.RequestEventListener.class);
    RequestQueue queue = new RequestQueue(new NoCache(), mNetwork, 0, mDelivery);
    queue.addRequestEventListener(listener);
    mRequest.setRequestQueue(queue);
    when(mNetwork.performRequest(any(Request.class)))
            .thenReturn(new NetworkResponse(CANNED_DATA));
    mDispatcher.processRequest(mRequest);
    InOrder inOrder = inOrder(listener);
    inOrder.verify(listener)
            .onRequestEvent(
                    mRequest, RequestQueue.RequestEvent.REQUEST_NETWORK_DISPATCH_STARTED);
    inOrder.verify(listener)
            .onRequestEvent(
                    mRequest, RequestQueue.RequestEvent.REQUEST_NETWORK_DISPATCH_FINISHED);
    inOrder.verifyNoMoreInteractions();
}