@Test public void shouldSendLoginParams() throws Exception { authenticationGateway.signIn(loginParams, new Callback()); AuthenticationRequest authenticationRequest = (AuthenticationRequest) apiGateway.getLatestRequest(); assertThat(authenticationRequest, equalTo(new AuthenticationRequest(loginParams))); HttpEntity postEntity = authenticationRequest.getPostEntity(); assertThat(postEntity.getContentType().getValue(), equalTo("application/x-www-form-urlencoded; charset=UTF-8")); String content = HiUtil.dump(postEntity); }
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; }