diff --git a/api/src/test/java/com/readrops/api/localfeed/atom/ATOMFeedAdapterTest.kt b/api/src/test/java/com/readrops/api/localfeed/atom/ATOMFeedAdapterTest.kt index 18cb0686..331f40bf 100644 --- a/api/src/test/java/com/readrops/api/localfeed/atom/ATOMFeedAdapterTest.kt +++ b/api/src/test/java/com/readrops/api/localfeed/atom/ATOMFeedAdapterTest.kt @@ -1,5 +1,6 @@ package com.readrops.api.localfeed.atom +import com.gitlab.mvysny.konsumexml.konsumeXml import com.readrops.api.TestUtils import junit.framework.TestCase.assertEquals import org.junit.Test @@ -12,7 +13,7 @@ class ATOMFeedAdapterTest { fun normalCasesTest() { val stream = TestUtils.loadResource("localfeed/atom/atom_feed.xml") - val feed = adapter.fromXml(stream) + val feed = adapter.fromXml(stream.konsumeXml()) assertEquals(feed.name, "Recent Commits to Readrops:develop") assertEquals(feed.url, "https://github.com/readrops/Readrops/commits/develop.atom") diff --git a/api/src/test/java/com/readrops/api/localfeed/atom/ATOMItemsAdapterTest.kt b/api/src/test/java/com/readrops/api/localfeed/atom/ATOMItemsAdapterTest.kt index 6b014126..c26c9954 100644 --- a/api/src/test/java/com/readrops/api/localfeed/atom/ATOMItemsAdapterTest.kt +++ b/api/src/test/java/com/readrops/api/localfeed/atom/ATOMItemsAdapterTest.kt @@ -1,5 +1,6 @@ package com.readrops.api.localfeed.atom +import com.gitlab.mvysny.konsumexml.konsumeXml import com.readrops.api.TestUtils import com.readrops.api.utils.DateUtils import com.readrops.api.utils.exceptions.ParseException @@ -20,7 +21,7 @@ class ATOMItemsAdapterTest { fun normalCasesTest() { val stream = TestUtils.loadResource("localfeed/atom/atom_items.xml") - val items = adapter.fromXml(stream) + val items = adapter.fromXml(stream.konsumeXml()) val item = items[0] assertEquals(items.size, 4) @@ -37,7 +38,7 @@ class ATOMItemsAdapterTest { fun noDateTest() { val stream = TestUtils.loadResource("localfeed/atom/atom_items_no_date.xml") - val item = adapter.fromXml(stream).first() + val item = adapter.fromXml(stream.konsumeXml()).first() assertNotNull(item.pubDate) } @@ -48,7 +49,7 @@ class ATOMItemsAdapterTest { expectedException.expect(ParseException::class.java) expectedException.expectMessage("Item title is required") - adapter.fromXml(stream) + adapter.fromXml(stream.konsumeXml()) } @Test @@ -58,7 +59,7 @@ class ATOMItemsAdapterTest { expectedException.expect(ParseException::class.java) expectedException.expectMessage("Item link is required") - adapter.fromXml(stream) + adapter.fromXml(stream.konsumeXml()) } } \ No newline at end of file diff --git a/api/src/test/java/com/readrops/api/localfeed/rss1/RSS1FeedAdapterTest.kt b/api/src/test/java/com/readrops/api/localfeed/rss1/RSS1FeedAdapterTest.kt index ddee8ead..0ae52049 100644 --- a/api/src/test/java/com/readrops/api/localfeed/rss1/RSS1FeedAdapterTest.kt +++ b/api/src/test/java/com/readrops/api/localfeed/rss1/RSS1FeedAdapterTest.kt @@ -1,5 +1,6 @@ package com.readrops.api.localfeed.rss1 +import com.gitlab.mvysny.konsumexml.konsumeXml import com.readrops.api.TestUtils import junit.framework.Assert.assertEquals import org.junit.Test @@ -12,7 +13,7 @@ class RSS1FeedAdapterTest { fun normalCaseTest() { val stream = TestUtils.loadResource("localfeed/rss1/rss1_feed.xml") - val feed = adapter.fromXml(stream) + val feed = adapter.fromXml(stream.konsumeXml()) assertEquals(feed.name, "Slashdot") assertEquals(feed.url, "https://slashdot.org/") diff --git a/api/src/test/java/com/readrops/api/localfeed/rss1/RSS1ItemsAdapterTest.kt b/api/src/test/java/com/readrops/api/localfeed/rss1/RSS1ItemsAdapterTest.kt index 7efda78f..ae46e931 100644 --- a/api/src/test/java/com/readrops/api/localfeed/rss1/RSS1ItemsAdapterTest.kt +++ b/api/src/test/java/com/readrops/api/localfeed/rss1/RSS1ItemsAdapterTest.kt @@ -1,5 +1,6 @@ package com.readrops.api.localfeed.rss1 +import com.gitlab.mvysny.konsumexml.konsumeXml import com.readrops.api.TestUtils import com.readrops.api.utils.DateUtils import com.readrops.api.utils.exceptions.ParseException @@ -20,7 +21,7 @@ class RSS1ItemsAdapterTest { fun normalCasesTest() { val stream = TestUtils.loadResource("localfeed/rss1/rss1_feed.xml") - val items = adapter.fromXml(stream) + val items = adapter.fromXml(stream.konsumeXml()) val item = items.first() assertEquals(items.size, 4) @@ -39,7 +40,7 @@ class RSS1ItemsAdapterTest { fun specialCasesTest() { val stream = TestUtils.loadResource("localfeed/rss1/rss1_items_special_cases.xml") - val item = adapter.fromXml(stream).first() + val item = adapter.fromXml(stream.konsumeXml()).first() assertEquals(item.author, "msmash, creator 2, creator 3, creator 4, ...") assertEquals(item.link, "https://news.slashdot.org/story/20/09/23/1420240/a-new-york-clock-" + @@ -50,7 +51,7 @@ class RSS1ItemsAdapterTest { fun nullDateTest() { val stream = TestUtils.loadResource("localfeed/rss1/rss1_items_no_date.xml") - val item = adapter.fromXml(stream).first() + val item = adapter.fromXml(stream.konsumeXml()).first() assertNotNull(item.pubDate) } @@ -61,7 +62,7 @@ class RSS1ItemsAdapterTest { expectedException.expect(ParseException::class.java) expectedException.expectMessage("Item title is required") - adapter.fromXml(stream) + adapter.fromXml(stream.konsumeXml()) } @Test @@ -71,6 +72,6 @@ class RSS1ItemsAdapterTest { expectedException.expect(ParseException::class.java) expectedException.expectMessage("RSS1 link or about element is required") - adapter.fromXml(stream) + adapter.fromXml(stream.konsumeXml()) } } \ No newline at end of file diff --git a/api/src/test/java/com/readrops/api/localfeed/rss2/RSS2FeedAdapterTest.kt b/api/src/test/java/com/readrops/api/localfeed/rss2/RSS2FeedAdapterTest.kt index c16a1581..6f09d7e2 100644 --- a/api/src/test/java/com/readrops/api/localfeed/rss2/RSS2FeedAdapterTest.kt +++ b/api/src/test/java/com/readrops/api/localfeed/rss2/RSS2FeedAdapterTest.kt @@ -1,5 +1,6 @@ package com.readrops.api.localfeed.rss2 +import com.gitlab.mvysny.konsumexml.konsumeXml import com.readrops.api.TestUtils import com.readrops.api.utils.exceptions.ParseException import junit.framework.TestCase.assertEquals @@ -14,7 +15,7 @@ class RSS2FeedAdapterTest { fun normalCasesTest() { val stream = TestUtils.loadResource("localfeed/rss2/rss_full_feed.xml") - val feed = adapter.fromXml(stream) + val feed = adapter.fromXml(stream.konsumeXml()) assertEquals(feed.name, "Hacker News") assertEquals(feed.url, "https://news.ycombinator.com/feed/") @@ -26,6 +27,6 @@ class RSS2FeedAdapterTest { @Test(expected = ParseException::class) fun nullTitleTest() { val stream = TestUtils.loadResource("localfeed/rss2/rss_feed_special_cases.xml") - adapter.fromXml(stream) + adapter.fromXml(stream.konsumeXml()) } } \ No newline at end of file diff --git a/api/src/test/java/com/readrops/api/localfeed/rss2/RSS2ItemsAdapterTest.kt b/api/src/test/java/com/readrops/api/localfeed/rss2/RSS2ItemsAdapterTest.kt index 49862135..df0d0095 100644 --- a/api/src/test/java/com/readrops/api/localfeed/rss2/RSS2ItemsAdapterTest.kt +++ b/api/src/test/java/com/readrops/api/localfeed/rss2/RSS2ItemsAdapterTest.kt @@ -1,5 +1,6 @@ package com.readrops.api.localfeed.rss2 +import com.gitlab.mvysny.konsumexml.konsumeXml import com.readrops.api.TestUtils import com.readrops.api.utils.DateUtils import com.readrops.api.utils.exceptions.ParseException @@ -20,7 +21,7 @@ class RSS2ItemsAdapterTest { fun normalCasesTest() { val stream = TestUtils.loadResource("localfeed/rss_feed.xml") - val items = adapter.fromXml(stream) + val items = adapter.fromXml(stream.konsumeXml()) val item = items.first() assertEquals(items.size, 7) @@ -35,7 +36,7 @@ class RSS2ItemsAdapterTest { @Test fun otherNamespacesTest() { val stream = TestUtils.loadResource("localfeed/rss2/rss_items_other_namespaces.xml") - val item = adapter.fromXml(stream).first() + val item = adapter.fromXml(stream.konsumeXml()).first() assertEquals(item.guid, "guid") assertEquals(item.author, "creator 1, creator 2, creator 3, creator 4") @@ -46,7 +47,7 @@ class RSS2ItemsAdapterTest { @Test fun noDateTest() { val stream = TestUtils.loadResource("localfeed/rss2/rss_items_no_date.xml") - val item = adapter.fromXml(stream).first() + val item = adapter.fromXml(stream.konsumeXml()).first() assertNotNull(item.pubDate) } @@ -58,7 +59,7 @@ class RSS2ItemsAdapterTest { expectedException.expect(ParseException::class.java) expectedException.expectMessage("Item title is required") - adapter.fromXml(stream) + adapter.fromXml(stream.konsumeXml()) } @Test @@ -68,13 +69,13 @@ class RSS2ItemsAdapterTest { expectedException.expect(ParseException::class.java) expectedException.expectMessage("Item link is required") - adapter.fromXml(stream) + adapter.fromXml(stream.konsumeXml()) } @Test fun enclosureTest() { val stream = TestUtils.loadResource("localfeed/rss2/rss_items_enclosure.xml") - val item = adapter.fromXml(stream).first() + val item = adapter.fromXml(stream.konsumeXml()).first() assertEquals(item.imageLink, "https://image1.jpg") } @@ -82,7 +83,7 @@ class RSS2ItemsAdapterTest { @Test fun mediaContentTest() { val stream = TestUtils.loadResource("localfeed/rss2/rss_items_media_content.xml") - val items = adapter.fromXml(stream) + val items = adapter.fromXml(stream.konsumeXml()) assertEquals(items.first().imageLink, "https://image1.jpg") assertEquals(items[1].imageLink, "https://image2.jpg") @@ -91,7 +92,7 @@ class RSS2ItemsAdapterTest { @Test fun mediaGroupTest() { val stream = TestUtils.loadResource("localfeed/rss2/rss_items_media_group.xml") - val item = adapter.fromXml(stream).first() + val item = adapter.fromXml(stream.konsumeXml()).first() assertEquals(item.imageLink, "https://image1.jpg") } diff --git a/api/src/test/java/com/readrops/api/services/nextcloudnews/adapters/NextNewsUserAdapterTest.kt b/api/src/test/java/com/readrops/api/services/nextcloudnews/adapters/NextNewsUserAdapterTest.kt index 6638f16b..03c3d7c3 100644 --- a/api/src/test/java/com/readrops/api/services/nextcloudnews/adapters/NextNewsUserAdapterTest.kt +++ b/api/src/test/java/com/readrops/api/services/nextcloudnews/adapters/NextNewsUserAdapterTest.kt @@ -1,5 +1,6 @@ package com.readrops.api.services.nextcloudnews.adapters +import com.gitlab.mvysny.konsumexml.konsumeXml import com.readrops.api.TestUtils import org.junit.Assert.assertEquals import org.junit.Test @@ -12,6 +13,6 @@ class NextNewsUserAdapterTest { fun validXmlTest() { val stream = TestUtils.loadResource("services/nextcloudnews/user.xml") - assertEquals(adapter.fromXml(stream), "Shinokuni") + assertEquals(adapter.fromXml(stream.konsumeXml()), "Shinokuni") } } \ No newline at end of file