@Test public void shouldReturnFalseWhenSignedInWithWrongCaptchaCode() throws Exception { assertThat(Douban.isLogged(), equalTo(false)); authenticationGateway.signIn(loginParams, new Callback()); Header[] header = new Header[0]; apiGateway.simulateTextResponse(200, TestResponses.AUTH_ERROR, null); assertThat(Douban.isLogged(), equalTo(false)); assertThat(douban.mApiRespErrorCode.getCode(), equalTo("1")); assertThat(douban.mApiRespErrorCode.getMsg(), equalTo("验证码不正确")); }
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; }