@Test public void shouldDispatchUponReceivingResponse() throws Exception { Robolectric.getBackgroundScheduler().pause(); Robolectric.getUiThreadScheduler().pause(); Robolectric.addPendingHttpResponse(200, GENERIC_XML); apiGateway.makeRequest(new TestGetRequest(), responseCallbacks); Robolectric.getBackgroundScheduler().runOneTask(); assertThat(responseCallbacks.successResponse, nullValue()); Robolectric.getUiThreadScheduler().runOneTask(); assertThat(asString(responseCallbacks.successResponse.getResponseDocument()), equalTo(GENERIC_XML)); }
public <T extends ApiResponse> void makeRequest(ApiRequest<T> apiRequest, final ApiResponseCallbacks<T> responseCallbacks) { new RemoteCallTask(responseCallbacks).execute(apiRequest); }
ApiGateway { public <T extends ApiResponse> void makeRequest(ApiRequest<T> apiRequest, final ApiResponseCallbacks<T> responseCallbacks) { new RemoteCallTask(responseCallbacks).execute(apiRequest); } }
ApiGateway { public <T extends ApiResponse> void makeRequest(ApiRequest<T> apiRequest, final ApiResponseCallbacks<T> responseCallbacks) { new RemoteCallTask(responseCallbacks).execute(apiRequest); }  }
ApiGateway { public <T extends ApiResponse> void makeRequest(ApiRequest<T> apiRequest, final ApiResponseCallbacks<T> responseCallbacks) { new RemoteCallTask(responseCallbacks).execute(apiRequest); }  void makeRequest(ApiRequest<T> apiRequest, final ApiResponseCallbacks<T> responseCallbacks); }
ApiGateway { public <T extends ApiResponse> void makeRequest(ApiRequest<T> apiRequest, final ApiResponseCallbacks<T> responseCallbacks) { new RemoteCallTask(responseCallbacks).execute(apiRequest); }  void makeRequest(ApiRequest<T> apiRequest, final ApiResponseCallbacks<T> responseCallbacks);  }