@Test public void testGetChildrenWhenRequestFailure() throws Exception { String path = "path"; AsyncCallback asyncCallback = mock(AsyncCallback.class); projectNode.getChildren(path, asyncCallback); verify(projectServiceClient).getChildren(eq(path), asyncRequestCallbackCaptor.capture()); AsyncRequestCallback<Array<ItemReference>> requestCallback = asyncRequestCallbackCaptor.getValue(); GwtReflectionUtils.callOnFailure(requestCallback, mock(Throwable.class)); verify(asyncCallback).onFailure(Matchers.<Throwable>anyObject()); }