@Test
public void processRequestNotifiesListener() throws Exception {

    RequestQueue.RequestEventListener listener = mock(RequestQueue.RequestEventListener.class);
    RequestQueue queue = new RequestQueue(mCache, mNetwork, 0, mDelivery);
    queue.addRequestEventListener(listener);
    mRequest.setRequestQueue(queue);
    Cache.Entry entry = CacheTestUtils.makeRandomCacheEntry(null, false, false);
    when(mCache.get(anyString())).thenReturn(entry);
    mDispatcher.processRequest(mRequest);
    InOrder inOrder = inOrder(listener);
    inOrder.verify(listener)
            .onRequestEvent(mRequest, RequestQueue.RequestEvent.REQUEST_CACHE_LOOKUP_STARTED);
    inOrder.verify(listener)
            .onRequestEvent(mRequest, RequestQueue.RequestEvent.REQUEST_CACHE_LOOKUP_FINISHED);
    inOrder.verifyNoMoreInteractions();
}