@Test public void shouldCallOnFailureWhenCallerError() throws Exception { authenticationGateway.signIn(loginParams, badCallback); apiGateway.simulateTextResponse(200, TestResponses.AUTH_SUCCESS, null); assertNotNull(authenticationGateway.failureResponse); assertThat(douban.mApiRespErrorCode.getCode(), equalTo(ApiInternalError.CALLER_ERROR.getCode())); }
public void signIn(LoginParams login, Callback responseCallback) { apiGateway.makeRequest(new AuthenticationRequest(login), new AuthenticationApiResponseCallback(responseCallback, this, douban)); }
AuthenticationGateway extends BaseApiGateway { public void signIn(LoginParams login, Callback responseCallback) { apiGateway.makeRequest(new AuthenticationRequest(login), new AuthenticationApiResponseCallback(responseCallback, this, douban)); } }
AuthenticationGateway extends BaseApiGateway { public void signIn(LoginParams login, Callback responseCallback) { apiGateway.makeRequest(new AuthenticationRequest(login), new AuthenticationApiResponseCallback(responseCallback, this, douban)); } AuthenticationGateway(Douban douban, ApiGateway apiGateway); }
AuthenticationGateway extends BaseApiGateway { public void signIn(LoginParams login, Callback responseCallback) { apiGateway.makeRequest(new AuthenticationRequest(login), new AuthenticationApiResponseCallback(responseCallback, this, douban)); } AuthenticationGateway(Douban douban, ApiGateway apiGateway); void signOut(); void signIn(LoginParams login, Callback responseCallback); }
AuthenticationGateway extends BaseApiGateway { public void signIn(LoginParams login, Callback responseCallback) { apiGateway.makeRequest(new AuthenticationRequest(login), new AuthenticationApiResponseCallback(responseCallback, this, douban)); } AuthenticationGateway(Douban douban, ApiGateway apiGateway); void signOut(); void signIn(LoginParams login, Callback responseCallback); static final Gson GSON; }