TweetMediaUtils { static boolean isPhotoType(MediaEntity mediaEntity) { return PHOTO_TYPE.equals(mediaEntity.type); } private  TweetMediaUtils(); static MediaEntity getPhotoEntity(Tweet tweet); static List<MediaEntity> getPhotoEntities(Tweet tweet); static boolean hasPhoto(Tweet tweet); static MediaEntity getVideoEntity(Tweet tweet); static boolean hasSupportedVideo(Tweet tweet); static VideoInfo.Variant getSupportedVariant(MediaEntity mediaEntity); static boolean isLooping(MediaEntity mediaEntity); static boolean showVideoControls(MediaEntity mediaEntity); static final String PHOTO_TYPE; static final String VIDEO_TYPE; static final String GIF_TYPE; }
@Test public void testIsPhotoType_photoEntity() { final MediaEntity entity = TestFixtures.newMediaEntity(TEST_INDICES_START, TEST_INDICES_END, TEST_MEDIA_TYPE_PHOTO); assertTrue(TweetMediaUtils.isPhotoType(entity)); }
@Test public void testIsPhotoType_videoEntity() { final MediaEntity entity = TestFixtures.newMediaEntity(TEST_INDICES_START, TEST_INDICES_END, TEST_MEDIA_TYPE_VIDEO); assertFalse(TweetMediaUtils.isPhotoType(entity)); }
@Test public void testIsPhotoType_animatedGifEntity() { final MediaEntity entity = TestFixtures.newMediaEntity(TEST_INDICES_START, TEST_INDICES_END, TEST_MEDIA_TYPE_ANIMATED_GIF); assertFalse(TweetMediaUtils.isPhotoType(entity)); }