HttpJob { public void submitRequest() { client.executeRequest(file, completionHandler); } HttpJob(final ThreadSafeAsyncHttpClient client, final File file, final AsyncCompletionHandler<Response> completionHandler); void submitRequest();  }
@Test(groups = "fast") public void testSubmitRequest() throws Exception { final ThreadSafeAsyncHttpClient client = Mockito.mock(ThreadSafeAsyncHttpClient.class); final File file = Mockito.mock(File.class); final AsyncCompletionHandler<Response> completionHandler = Mockito.mock(AsyncResponseCompletionHandler.class); final HttpJob job = new HttpJob(client, file, completionHandler); Mockito.verify(client, Mockito.times(0)).executeRequest(file, completionHandler); job.submitRequest(); Mockito.verify(client, Mockito.times(1)).executeRequest(file, completionHandler); }