diff options
author | ByteHamster <info@bytehamster.com> | 2020-03-25 22:45:14 +0100 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2020-03-25 22:50:41 +0100 |
commit | 902215c18d7afa29a0207ca7600770f583a6c0df (patch) | |
tree | f4952efc61a18f1cc1dda18560ea7de71c8b474a /core/src/test/java | |
parent | 3399be1290592eff1b6ad5dd1a9b7807f7e7fcaa (diff) | |
download | AntennaPod-902215c18d7afa29a0207ca7600770f583a6c0df.zip |
Removed unused code
Diffstat (limited to 'core/src/test/java')
-rw-r--r-- | core/src/test/java/de/danoeh/antennapod/core/storage/ItemEnqueuePositionCalculatorTest.java | 4 | ||||
-rw-r--r-- | core/src/test/java/de/danoeh/antennapod/core/util/FeedItemUtilTest.java | 92 |
2 files changed, 40 insertions, 56 deletions
diff --git a/core/src/test/java/de/danoeh/antennapod/core/storage/ItemEnqueuePositionCalculatorTest.java b/core/src/test/java/de/danoeh/antennapod/core/storage/ItemEnqueuePositionCalculatorTest.java index 275b104ea..80777d036 100644 --- a/core/src/test/java/de/danoeh/antennapod/core/storage/ItemEnqueuePositionCalculatorTest.java +++ b/core/src/test/java/de/danoeh/antennapod/core/storage/ItemEnqueuePositionCalculatorTest.java @@ -120,10 +120,6 @@ public class ItemEnqueuePositionCalculatorTest { return ItemEnqueuePositionCalculatorTest.getCurrentlyPlaying(idCurrentlyPlaying); } - private static Playable externalMedia() { - return new ExternalMedia("http://example.com/episode.mp3", MediaType.AUDIO); - } - private static final long ID_CURRENTLY_PLAYING_NULL = -1L; private static final long ID_CURRENTLY_PLAYING_NOT_FEEDMEDIA = -9999L; diff --git a/core/src/test/java/de/danoeh/antennapod/core/util/FeedItemUtilTest.java b/core/src/test/java/de/danoeh/antennapod/core/util/FeedItemUtilTest.java index 0b64cb10f..2560ac6a0 100644 --- a/core/src/test/java/de/danoeh/antennapod/core/util/FeedItemUtilTest.java +++ b/core/src/test/java/de/danoeh/antennapod/core/util/FeedItemUtilTest.java @@ -13,61 +13,49 @@ import de.danoeh.antennapod.core.feed.FeedItem; import static org.junit.Assert.assertEquals; +@RunWith(Parameterized.class) public class FeedItemUtilTest { + private static final String FEED_LINK = "http://example.com"; + private static final String ITEM_LINK = "http://example.com/feedItem1"; + + private final String msg; + private final String feedLink; + private final String itemLink; + private final String expected; + + @Parameters + public static Collection<Object[]> data() { + return Arrays.asList(new Object[][] { + { "average", FEED_LINK, ITEM_LINK, ITEM_LINK }, + { "null item link - fallback to feed", FEED_LINK, null, FEED_LINK}, + { "empty item link - same as null", FEED_LINK, "", FEED_LINK}, + { "blank item link - same as null", FEED_LINK, " ", FEED_LINK}, + { "fallback, but feed link is null too", null, null, null }, + { "fallback - but empty feed link - same as null", "", null, null}, + { "fallback - but blank feed link - same as null", " ", null, null} + }); + } + public FeedItemUtilTest(String msg, String feedLink, String itemLink, String expected) { + this.msg = msg; + this.feedLink = feedLink; + this.itemLink = itemLink; + this.expected = expected; + } - @RunWith(Parameterized.class) - public static class LinkWithFallbackTest { - private static final String FEED_LINK = "http://example.com"; - private static final String ITEM_LINK = "http://example.com/feedItem1"; - - @Parameters - public static Collection<Object[]> data() { - return Arrays.asList(new Object[][] { - { "average", - FEED_LINK, ITEM_LINK, ITEM_LINK }, - { "null item link - fallback to feed", - FEED_LINK, null, FEED_LINK}, - { "empty item link - same as null", - FEED_LINK, "", FEED_LINK}, - { "blank item link - same as null", - FEED_LINK, " ", FEED_LINK}, - { "fallback, but feed link is null too", - null, null, null }, - { "fallback - but empty feed link - same as null", - "", null, null}, - { "fallback - but blank feed link - same as null", - " ", null, null} - }); - } - - private final String msg; - private final String feedLink; - private final String itemLink; - private final String expected; - - public LinkWithFallbackTest(String msg, String feedLink, String itemLink, String expected) { - this.msg = msg; - this.feedLink = feedLink; - this.itemLink = itemLink; - this.expected = expected; - } - - - @Test - public void testLinkWithFallback() { - String actual = FeedItemUtil.getLinkWithFallback(createFeedItem(feedLink, itemLink)); - assertEquals(msg, expected, actual); - } + @Test + public void testLinkWithFallback() { + String actual = FeedItemUtil.getLinkWithFallback(createFeedItem(feedLink, itemLink)); + assertEquals(msg, expected, actual); + } - private static FeedItem createFeedItem(String feedLink, String itemLink) { - Feed feed = new Feed(); - feed.setLink(feedLink); - FeedItem feedItem = new FeedItem(); - feedItem.setLink(itemLink); - feedItem.setFeed(feed); - feed.setItems(Arrays.asList(feedItem)); - return feedItem; - } + private static FeedItem createFeedItem(String feedLink, String itemLink) { + Feed feed = new Feed(); + feed.setLink(feedLink); + FeedItem feedItem = new FeedItem(); + feedItem.setLink(itemLink); + feedItem.setFeed(feed); + feed.setItems(Arrays.asList(feedItem)); + return feedItem; } } |