Search in sources :

Example 6 with PhotoModel

use of org.dataportabilityproject.types.transfer.models.photos.PhotoModel in project data-transfer-project by google.

the class FlickrPhotosExporterTest method toCommonPhoto.

@Test
public void toCommonPhoto() {
    Photo photo = FlickrTestUtils.initializePhoto(PHOTO_TITLE, FETCHABLE_URL, PHOTO_DESCRIPTION, MEDIA_TYPE);
    PhotoModel photoModel = FlickrPhotosExporter.toCommonPhoto(photo, ALBUM_ID);
    assertThat(photoModel.getAlbumId()).isEqualTo(ALBUM_ID);
    assertThat(photoModel.getFetchableUrl()).isEqualTo(FETCHABLE_URL);
    assertThat(photoModel.getTitle()).isEqualTo(PHOTO_TITLE);
    assertThat(photoModel.getDescription()).isEqualTo(PHOTO_DESCRIPTION);
    assertThat(photoModel.getMediaType()).isEqualTo("image/jpeg");
}
Also used : PhotoModel(org.dataportabilityproject.types.transfer.models.photos.PhotoModel) Photo(com.flickr4java.flickr.photos.Photo) Test(org.junit.Test)

Aggregations

PhotoModel (org.dataportabilityproject.types.transfer.models.photos.PhotoModel)6 IOException (java.io.IOException)3 ArrayList (java.util.ArrayList)3 ExportResult (org.dataportabilityproject.spi.transfer.provider.ExportResult)3 ResultType (org.dataportabilityproject.spi.transfer.provider.ExportResult.ResultType)3 ContinuationData (org.dataportabilityproject.spi.transfer.types.ContinuationData)3 PhotoAlbum (org.dataportabilityproject.types.transfer.models.photos.PhotoAlbum)3 PhotosContainerResource (org.dataportabilityproject.types.transfer.models.photos.PhotosContainerResource)3 FlickrException (com.flickr4java.flickr.FlickrException)2 Auth (com.flickr4java.flickr.auth.Auth)2 Photo (com.flickr4java.flickr.photos.Photo)2 Photoset (com.flickr4java.flickr.photosets.Photoset)2 ImportResult (org.dataportabilityproject.spi.transfer.provider.ImportResult)2 PaginationData (org.dataportabilityproject.spi.transfer.types.PaginationData)2 StringPaginationToken (org.dataportabilityproject.spi.transfer.types.StringPaginationToken)2 Flickr (com.flickr4java.flickr.Flickr)1 REST (com.flickr4java.flickr.REST)1 RequestContext (com.flickr4java.flickr.RequestContext)1 PhotoList (com.flickr4java.flickr.photos.PhotoList)1 PhotosInterface (com.flickr4java.flickr.photos.PhotosInterface)1