public static Auth getAuth(AuthData authData, Flickr flickr) throws FlickrException { checkArgument( authData instanceof TokenSecretAuthData, "authData expected to be TokenSecretAuthData not %s", authData.getClass().getCanonicalName()); TokenSecretAuthData tokenAuthData = (TokenSecretAuthData) authData; Token requestToken = new Token(tokenAuthData.getToken(), tokenAuthData.getSecret()); return flickr.getAuthInterface().checkToken(requestToken); } }
when(authInterface.checkToken(any(Token.class))).thenReturn(auth);
when(authInterface.checkToken(any(Token.class))).thenReturn(auth); when(flickr.getPhotosetsInterface()).thenReturn(photosetsInterface); when(flickr.getPhotosInterface()).thenReturn(photosInterface);
when(authInterface.checkToken(any(Token.class))).thenReturn(auth); when(flickr.getPhotosetsInterface()).thenReturn(photosetsInterface); when(flickr.getPhotosInterface()).thenReturn(photosInterface);
/** * Returns the credentials attached to an OAuth authentication token. * * @param accessToken * The authentication token * @return The Auth object * @throws FlickrException */ public Auth checkToken(OAuth1Token accessToken) throws FlickrException { return checkToken(accessToken.getToken(), accessToken.getTokenSecret()); }
/** * Returns the credentials attached to an OAuth authentication token. * * @param accessToken * The authentication token * @return The Auth object * @throws FlickrException */ public Auth checkToken(Token accessToken) throws FlickrException { return checkToken(accessToken.getToken(), accessToken.getSecret()); }