@VisibleForTesting FlickrPhotosExporter(Flickr flickr) { this.flickr = flickr; this.photosInterface = flickr.getPhotosInterface(); this.photosetsInterface = flickr.getPhotosetsInterface(); }
public FlickrPhotosExporter(AppCredentials appCredentials) { this.flickr = new Flickr(appCredentials.getKey(), appCredentials.getSecret(), new REST()); this.photosetsInterface = flickr.getPhotosetsInterface(); this.photosInterface = flickr.getPhotosInterface(); }
when(authInterface.checkToken(any(Token.class))).thenReturn(auth); when(flickr.getPhotosetsInterface()).thenReturn(photosetsInterface); when(flickr.getPhotosInterface()).thenReturn(photosInterface); when(flickr.getAuthInterface()).thenReturn(authInterface);
when(authInterface.checkToken(any(Token.class))).thenReturn(auth); when(flickr.getPhotosetsInterface()).thenReturn(photosetsInterface); when(flickr.getPhotosInterface()).thenReturn(photosInterface); when(flickr.getAuthInterface()).thenReturn(authInterface);
private void setUpFlickr() { try { Flickr flickr = new Flickr(flickrApiKey, flickrSecret, new REST()); flickrConnection = flickr.getPhotosInterface(); } catch (ParserConfigurationException e) { e.printStackTrace(); //Proper error handling goes here } }
String apikey; String secret; // Create a Flickr instance with your data. No need to authenticate Flickr flickr = new Flickr(apikey, secret, new REST()); // Set the wanted search parameters (I'm not using real variables in the example) SearchParameters searchParameters = new SearchParameters(); searchParameters.setAccuracy(accuracyLevel); searchParameters.setBBox(minimum_longitude, minimum_latitude, maximum_longitude, maximum_latitude); PhotoList<Photo> list = flickr.getPhotosInterface().search(searchParameters, 0, 0); // Do something with the list
final PhotoList<Photo> first = flickr.getPhotosInterface().search(params, 250, 0); photos.addAll(first); final PhotoList<Photo> result = flickr.getPhotosInterface().search(params, 250, page); photos.addAll(result); n += result.size();
final PhotoList<Photo> first = flickr.getPhotosInterface().search(params, 250, 0); photos.addAll(first); final PhotoList<Photo> result = flickr.getPhotosInterface().search(params, 250, page); photos.addAll(result); n += result.size();