@Test
public void getResponseShouldReturnAParcableIfEverythingIsOk() {

    String responseUrl = "testschema://callback/#access_token=test_access_token" +
            "&token_type=Bearer&expires_in=3600&state=test_state";
    Uri responseUri = Uri.parse(responseUrl);
    AuthenticationResponse result = AuthenticationResponse.fromUri(responseUri);
    Intent intent = mock(Intent.class);
    Bundle bundle = new Bundle();
    bundle.putParcelable(LoginActivity.RESPONSE_KEY, result);
    when(intent.getBundleExtra(eq(LoginActivity.EXTRA_AUTH_RESPONSE)))
            .thenReturn(bundle);
    AuthenticationResponse response =
            AuthenticationClient.getResponse(Activity.RESULT_OK, intent);
    assertEquals(result.getType(), response.getType());
    assertEquals(result.getAccessToken(), response.getAccessToken());
}