Code example for Activity

0
    private AuthenticationGateway authenticationGateway;
 
    @Before 
    public void setUp() throws Exception { 
        apiGateway = new TestApiGateway();
        context = new Activity();
        callbacks = new TestCallbacks();
        authenticationGateway = new AuthenticationGateway(apiGateway, context);
    } 
 
    @Test 
    public void shouldMakeARemoteCallWhenSigningIn() throws Exception { 
        authenticationGateway.signIn("spongebob", "squidward", callbacks);
        String urlString = apiGateway.getLatestRequest().getUrlString();
        assertThat(urlString, equalTo("https://www.pivotaltracker.com/services/v3/tokens/active"));
    } 
 
    @Test 
    public void shouldSendUsernameAndPassword() throws Exception { 
        authenticationGateway.signIn("spongebob", "squidward", callbacks);
        TrackerAuthenticationRequest request = (TrackerAuthenticationRequest) apiGateway.getLatestRequest();