OAuth2Service extends OAuthService { void requestGuestToken(final Callback<GuestTokenResponse> callback, OAuth2Token appAuthToken) { api.getGuestToken(getAuthorizationHeader(appAuthToken)).enqueue(callback); } OAuth2Service(TwitterCore twitterCore, TwitterApi api); void requestGuestAuthToken(final Callback<GuestAuthToken> callback);  }
@Test public void testRequestGuestToken() { final OAuth2Token token = new OAuth2Token("type", "token"); final String bearerAuth = OAuthConstants.AUTHORIZATION_BEARER + " " + token.getAccessToken(); service.api = spy(new MockOAuth2Api()); service.requestGuestToken(mock(Callback.class), token); verify(service.api).getGuestToken(bearerAuth); }