@Test public void update_shouldFireCallbacks_success() throws Exception { TestCallbacks callbacks = new TestCallbacks(); recentActivities.update(callbacks); assertThat(callbacks.startWasCalled, equalTo(true)); apiGateway.simulateResponse(200, TestResponses.RECENT_ACTIVITY); assertThat(callbacks.successWasCalled, equalTo(true)); assertThat(callbacks.failureWasCalled, equalTo(false)); assertThat(callbacks.completeWasCalled, equalTo(true)); }
public void update(Callbacks... callbacks) { MultiCallbacks multiCallbacks = new MultiCallbacks(callbacks); multiCallbacks.onStart(); apiGateway.makeRequest( new RecentActivityRequest(authenticationGateway.getToken()), new RecentActivityApiResponseCallbacks(multiCallbacks)); }
RecentActivities extends ArrayList<RecentActivity> { public void update(Callbacks... callbacks) { MultiCallbacks multiCallbacks = new MultiCallbacks(callbacks); multiCallbacks.onStart(); apiGateway.makeRequest( new RecentActivityRequest(authenticationGateway.getToken()), new RecentActivityApiResponseCallbacks(multiCallbacks)); } }
RecentActivities extends ArrayList<RecentActivity> { public void update(Callbacks... callbacks) { MultiCallbacks multiCallbacks = new MultiCallbacks(callbacks); multiCallbacks.onStart(); apiGateway.makeRequest( new RecentActivityRequest(authenticationGateway.getToken()), new RecentActivityApiResponseCallbacks(multiCallbacks)); } RecentActivities(ApiGateway apiGateway, AuthenticationGateway authenticationGateway); }
RecentActivities extends ArrayList<RecentActivity> { public void update(Callbacks... callbacks) { MultiCallbacks multiCallbacks = new MultiCallbacks(callbacks); multiCallbacks.onStart(); apiGateway.makeRequest( new RecentActivityRequest(authenticationGateway.getToken()), new RecentActivityApiResponseCallbacks(multiCallbacks)); } RecentActivities(ApiGateway apiGateway, AuthenticationGateway authenticationGateway); void update(Callbacks... callbacks); }
RecentActivities extends ArrayList<RecentActivity> { public void update(Callbacks... callbacks) { MultiCallbacks multiCallbacks = new MultiCallbacks(callbacks); multiCallbacks.onStart(); apiGateway.makeRequest( new RecentActivityRequest(authenticationGateway.getToken()), new RecentActivityApiResponseCallbacks(multiCallbacks)); } RecentActivities(ApiGateway apiGateway, AuthenticationGateway authenticationGateway); void update(Callbacks... callbacks);  }