From 78e6e7d51e3390dc9c996fa92540f99dd6ea4c04 Mon Sep 17 00:00:00 2001 From: soloturn Date: Tue, 13 Jun 2023 06:56:27 +0200 Subject: [PATCH] new URI instead of new URL in tests, 7. --- .../tst/ripper/rippers/ImgboxRipperTest.java | 10 ++-- .../tst/ripper/rippers/ImgurRipperTest.java | 52 ++++++++++--------- .../ripper/rippers/InstagramRipperTest.java | 36 +++++++------ .../ripper/rippers/JagodibujaRipperTest.java | 7 +-- .../ripper/rippers/KingcomixRipperTest.java | 10 ++-- .../tst/ripper/rippers/ListalRipperTest.java | 16 +++--- .../ripper/rippers/LusciousRipperTest.java | 16 +++--- .../ripper/rippers/MangadexRipperTest.java | 11 ++-- .../ripper/rippers/ManganeloRipperTest.java | 10 ++-- 9 files changed, 92 insertions(+), 76 deletions(-) diff --git a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/ImgboxRipperTest.java b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/ImgboxRipperTest.java index 9e3b6b32..98e3dfc5 100644 --- a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/ImgboxRipperTest.java +++ b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/ImgboxRipperTest.java @@ -1,6 +1,8 @@ package com.rarchives.ripme.tst.ripper.rippers; import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; import java.net.URL; import com.rarchives.ripme.ripper.rippers.ImgboxRipper; @@ -11,14 +13,14 @@ import org.junit.jupiter.api.Test; public class ImgboxRipperTest extends RippersTest { @Test @Tag("flaky") - public void testImgboxRip() throws IOException { - ImgboxRipper ripper = new ImgboxRipper(new URL("https://imgbox.com/g/FJPF7t26FD")); + public void testImgboxRip() throws IOException, URISyntaxException { + ImgboxRipper ripper = new ImgboxRipper(new URI("https://imgbox.com/g/FJPF7t26FD").toURL()); testRipper(ripper); } @Test - public void testGetGID() throws IOException { - URL url = new URL("https://imgbox.com/g/FJPF7t26FD"); + public void testGetGID() throws IOException, URISyntaxException { + URL url = new URI("https://imgbox.com/g/FJPF7t26FD").toURL(); ImgboxRipper ripper = new ImgboxRipper(url); Assertions.assertEquals("FJPF7t26FD", ripper.getGID(url)); } diff --git a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/ImgurRipperTest.java b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/ImgurRipperTest.java index 28f18bff..5eeb077f 100644 --- a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/ImgurRipperTest.java +++ b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/ImgurRipperTest.java @@ -10,21 +10,23 @@ import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; import java.net.URL; import java.util.ArrayList; import java.util.List; public class ImgurRipperTest extends RippersTest { @Test - public void testImgurURLFailures() throws IOException { + public void testImgurURLFailures() throws IOException, URISyntaxException { List failURLs = new ArrayList<>(); // Imgur urls that should not work - failURLs.add(new URL("http://imgur.com")); - failURLs.add(new URL("http://imgur.com/")); - failURLs.add(new URL("http://i.imgur.com")); - failURLs.add(new URL("http://i.imgur.com/")); - failURLs.add(new URL("http://imgur.com/image.jpg")); - failURLs.add(new URL("http://i.imgur.com/image.jpg")); + failURLs.add(new URI("http://imgur.com").toURL()); + failURLs.add(new URI("http://imgur.com/").toURL()); + failURLs.add(new URI("http://i.imgur.com").toURL()); + failURLs.add(new URI("http://i.imgur.com/").toURL()); + failURLs.add(new URI("http://imgur.com/image.jpg").toURL()); + failURLs.add(new URI("http://i.imgur.com/image.jpg").toURL()); for (URL url : failURLs) { try { new ImgurRipper(url); @@ -37,21 +39,21 @@ public class ImgurRipperTest extends RippersTest { @Test @Tag("flaky") - public void testImgurAlbums() throws IOException { + public void testImgurAlbums() throws IOException, URISyntaxException { List contentURLs = new ArrayList<>(); // URLs that should return more than 1 image - //contentURLs.add(new URL("http://imgur.com/a/dS9OQ#0")); // Horizontal layout - //contentURLs.add(new URL("http://imgur.com/a/YpsW9#0")); // Grid layout - contentURLs.add(new URL("http://imgur.com/a/WxG6f/layout/vertical#0")); - contentURLs.add(new URL("http://imgur.com/a/WxG6f/layout/horizontal#0")); - contentURLs.add(new URL("http://imgur.com/a/WxG6f/layout/grid#0")); - contentURLs.add(new URL("http://imgur.com/gallery/FmP2o")); // Gallery URL + //contentURLs.add(new URI("http://imgur.com/a/dS9OQ#0").toURL()); // Horizontal layout + //contentURLs.add(new URI("http://imgur.com/a/YpsW9#0").toURL()); // Grid layout + contentURLs.add(new URI("http://imgur.com/a/WxG6f/layout/vertical#0").toURL()); + contentURLs.add(new URI("http://imgur.com/a/WxG6f/layout/horizontal#0").toURL()); + contentURLs.add(new URI("http://imgur.com/a/WxG6f/layout/grid#0").toURL()); + contentURLs.add(new URI("http://imgur.com/gallery/FmP2o").toURL()); // Gallery URL // Imgur seems not to support URLs with lists of images anymore. // contentURLs.add(new // URL("http://imgur.com/758qD43,C6iVJex,bP7flAu,J3l85Ri,1U7fhu5,MbuAUCM,JF4vOXQ")); // Sometimes hangs up - // contentURLs.add(new URL("http://imgur.com/r/nsfw_oc/top/all")); - // contentURLs.add(new URL("http://imgur.com/a/bXQpH")); // Album with + // contentURLs.add(new URI("http://imgur.com/r/nsfw_oc/top/all").toURL()); + // contentURLs.add(new URI("http://imgur.com/a/bXQpH").toURL()); // Album with // titles/descriptions for (URL url : contentURLs) { ImgurRipper ripper = new ImgurRipper(url); @@ -61,10 +63,10 @@ public class ImgurRipperTest extends RippersTest { @Test @Disabled("test or ripper broken") - public void testImgurSingleImage() throws IOException { + public void testImgurSingleImage() throws IOException, URISyntaxException { List contentURLs = new ArrayList<>(); - contentURLs.add(new URL("http://imgur.com/qbfcLyG")); // Single image URL - contentURLs.add(new URL("https://imgur.com/KexUO")); // Single image URL + contentURLs.add(new URI("http://imgur.com/qbfcLyG").toURL()); // Single image URL + contentURLs.add(new URI("https://imgur.com/KexUO").toURL()); // Single image URL for (URL url : contentURLs) { ImgurRipper ripper = new ImgurRipper(url); testRipper(ripper); @@ -72,22 +74,22 @@ public class ImgurRipperTest extends RippersTest { } @Test - public void testImgurAlbumWithMoreThan20Pictures() throws IOException { - ImgurAlbum album = ImgurRipper.getImgurAlbum(new URL("http://imgur.com/a/HUMsq")); + public void testImgurAlbumWithMoreThan20Pictures() throws IOException, URISyntaxException { + ImgurAlbum album = ImgurRipper.getImgurAlbum(new URI("http://imgur.com/a/HUMsq").toURL()); Assertions.assertTrue(album.images.size() >= 20, "Failed to find 20 files from " + album.url.toExternalForm() + ", only got " + album.images.size()); } @Test - public void testImgurAlbumWithMoreThan100Pictures() throws IOException { - ImgurAlbum album = ImgurRipper.getImgurAlbum(new URL("https://imgur.com/a/HX3JSrD")); + public void testImgurAlbumWithMoreThan100Pictures() throws IOException, URISyntaxException { + ImgurAlbum album = ImgurRipper.getImgurAlbum(new URI("https://imgur.com/a/HX3JSrD").toURL()); Assertions.assertTrue(album.images.size() >= 100, "Failed to find 100 files from " + album.url.toExternalForm() + ", only got " + album.images.size()); } @Test public void testImgurVideoFromGetFilesFromURL() throws Exception { - List urls = RipUtils.getFilesFromURL(new URL("https://i.imgur.com/4TtwxRN.gifv")); + List urls = RipUtils.getFilesFromURL(new URI("https://i.imgur.com/4TtwxRN.gifv").toURL()); Assertions.assertEquals("https://i.imgur.com/4TtwxRN.mp4", urls.get(0).toExternalForm()); } @@ -97,7 +99,7 @@ public class ImgurRipperTest extends RippersTest { * "over capacity" warning on the page. // I wonder if our testing automation is * what is putting this album over capacity? // See issue #376. public void * testImgurAlbumWithMoreThan1000Pictures() throws IOException { ImgurAlbum - * album = ImgurRipper.getImgurAlbum(new URL("http://imgur.com/a/vsuh5")); + * album = ImgurRipper.getImgurAlbum(new URI("http://imgur.com/a/vsuh5").toURL()); * assertTrue("Failed to find 1000 files from " + album.url.toExternalForm() + * ", only got " + album.images.size(), album.images.size() >= 1000); } */ diff --git a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/InstagramRipperTest.java b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/InstagramRipperTest.java index c7af1a16..5b929faf 100644 --- a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/InstagramRipperTest.java +++ b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/InstagramRipperTest.java @@ -7,6 +7,8 @@ import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; import java.net.URL; import java.util.ArrayList; import java.util.HashMap; @@ -15,19 +17,19 @@ import java.util.Map; public class InstagramRipperTest extends RippersTest { @Test - public void testInstagramGID() throws IOException { + public void testInstagramGID() throws IOException, URISyntaxException { Map testURLs = new HashMap<>(); - testURLs.put(new URL("http://instagram.com/Test_User"), "Test_User"); - testURLs.put(new URL("http://instagram.com/_test_user_"), "_test_user_"); - testURLs.put(new URL("http://instagram.com/_test_user_/?pinned"), "_test_user__pinned"); - testURLs.put(new URL("http://instagram.com/stories/_test_user_/"), "_test_user__stories"); - testURLs.put(new URL("http://instagram.com/_test_user_/tagged"), "_test_user__tagged"); - testURLs.put(new URL("http://instagram.com/_test_user_/channel"), "_test_user__igtv"); - testURLs.put(new URL("http://instagram.com/explore/tags/test_your_tag"), "tag_test_your_tag"); - testURLs.put(new URL("https://www.instagram.com/p/BZ4egP7njW5/?hl=en"), "post_BZ4egP7njW5"); - testURLs.put(new URL("https://www.instagram.com/p/BZ4egP7njW5"), "post_BZ4egP7njW5"); - testURLs.put(new URL("https://www.instagram.com/p/BaNPpaHn2zU/?taken-by=hilaryduff"), "post_BaNPpaHn2zU"); - testURLs.put(new URL("https://www.instagram.com/p/BaNPpaHn2zU/"), "post_BaNPpaHn2zU"); + testURLs.put(new URI("http://instagram.com/Test_User").toURL(), "Test_User"); + testURLs.put(new URI("http://instagram.com/_test_user_").toURL(), "_test_user_"); + testURLs.put(new URI("http://instagram.com/_test_user_/?pinned").toURL(), "_test_user__pinned"); + testURLs.put(new URI("http://instagram.com/stories/_test_user_/").toURL(), "_test_user__stories"); + testURLs.put(new URI("http://instagram.com/_test_user_/tagged").toURL(), "_test_user__tagged"); + testURLs.put(new URI("http://instagram.com/_test_user_/channel").toURL(), "_test_user__igtv"); + testURLs.put(new URI("http://instagram.com/explore/tags/test_your_tag").toURL(), "tag_test_your_tag"); + testURLs.put(new URI("https://www.instagram.com/p/BZ4egP7njW5/?hl=en").toURL(), "post_BZ4egP7njW5"); + testURLs.put(new URI("https://www.instagram.com/p/BZ4egP7njW5").toURL(), "post_BZ4egP7njW5"); + testURLs.put(new URI("https://www.instagram.com/p/BaNPpaHn2zU/?taken-by=hilaryduff").toURL(), "post_BaNPpaHn2zU"); + testURLs.put(new URI("https://www.instagram.com/p/BaNPpaHn2zU/").toURL(), "post_BaNPpaHn2zU"); for (URL url : testURLs.keySet()) { InstagramRipper ripper = new InstagramRipper(url); ripper.setup(); @@ -38,10 +40,10 @@ public class InstagramRipperTest extends RippersTest { @Test @Disabled("Ripper broken for single items") - public void testInstagramSingle() throws IOException { + public void testInstagramSingle() throws IOException, URISyntaxException { List contentURLs = new ArrayList<>(); - contentURLs.add(new URL("https://www.instagram.com/p/BaNPpaHn2zU/?hl=en")); - contentURLs.add(new URL("https://www.instagram.com/p/BaNPpaHn2zU/")); + contentURLs.add(new URI("https://www.instagram.com/p/BaNPpaHn2zU/?hl=en").toURL()); + contentURLs.add(new URI("https://www.instagram.com/p/BaNPpaHn2zU/").toURL()); for (URL url : contentURLs) { InstagramRipper ripper = new InstagramRipper(url); testRipper(ripper); @@ -50,10 +52,10 @@ public class InstagramRipperTest extends RippersTest { @Test @Tag("flaky") - public void testInstagramAlbums() throws IOException { + public void testInstagramAlbums() throws IOException, URISyntaxException { // do not test, in case of rate limit 200/hr since 2021. see // https://github.com/ripmeapp2/ripme/issues/32 - URL url = new URL("https://www.instagram.com/Test_User/"); + URL url = new URI("https://www.instagram.com/Test_User/").toURL(); InstagramRipper ripper = new InstagramRipper(url); testRipper(ripper); } diff --git a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/JagodibujaRipperTest.java b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/JagodibujaRipperTest.java index af4314c8..3f5c199e 100644 --- a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/JagodibujaRipperTest.java +++ b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/JagodibujaRipperTest.java @@ -1,7 +1,8 @@ package com.rarchives.ripme.tst.ripper.rippers; import java.io.IOException; -import java.net.URL; +import java.net.URI; +import java.net.URISyntaxException; import com.rarchives.ripme.ripper.rippers.JagodibujaRipper; import org.junit.jupiter.api.Disabled; @@ -10,9 +11,9 @@ import org.junit.jupiter.api.Test; public class JagodibujaRipperTest extends RippersTest { @Test @Disabled("fails on github ubuntu automated PR check 2020-07-29") - public void testJagodibujaRipper() throws IOException { + public void testJagodibujaRipper() throws IOException, URISyntaxException { // a photo set - JagodibujaRipper ripper = new JagodibujaRipper(new URL("http://www.jagodibuja.com/comic-in-me/")); + JagodibujaRipper ripper = new JagodibujaRipper(new URI("http://www.jagodibuja.com/comic-in-me/").toURL()); testRipper(ripper); } } \ No newline at end of file diff --git a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/KingcomixRipperTest.java b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/KingcomixRipperTest.java index bea92e8b..ae543c36 100644 --- a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/KingcomixRipperTest.java +++ b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/KingcomixRipperTest.java @@ -1,6 +1,8 @@ package com.rarchives.ripme.tst.ripper.rippers; import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; import java.net.URL; import com.rarchives.ripme.ripper.rippers.KingcomixRipper; @@ -13,14 +15,14 @@ public class KingcomixRipperTest extends RippersTest { @Test @Disabled("test or ripper broken") - public void testRip() throws IOException { - KingcomixRipper ripper = new KingcomixRipper(new URL("https://kingcomix.com/aunt-cumming-tracy-scops/")); + public void testRip() throws IOException, URISyntaxException { + KingcomixRipper ripper = new KingcomixRipper(new URI("https://kingcomix.com/aunt-cumming-tracy-scops/").toURL()); testRipper(ripper); } @Test - public void testGetGID() throws IOException { - URL url = new URL("https://kingcomix.com/aunt-cumming-tracy-scops/"); + public void testGetGID() throws IOException, URISyntaxException { + URL url = new URI("https://kingcomix.com/aunt-cumming-tracy-scops/").toURL(); KingcomixRipper ripper = new KingcomixRipper(url); Assertions.assertEquals("aunt-cumming-tracy-scops", ripper.getGID(url)); } diff --git a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/ListalRipperTest.java b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/ListalRipperTest.java index bb4897ba..ca3aee41 100644 --- a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/ListalRipperTest.java +++ b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/ListalRipperTest.java @@ -1,7 +1,9 @@ package com.rarchives.ripme.tst.ripper.rippers; import java.io.IOException; -import java.net.URL; +import java.net.URI; +import java.net.URISyntaxException; + import com.rarchives.ripme.ripper.rippers.ListalRipper; import org.junit.jupiter.api.Test; @@ -11,9 +13,9 @@ public class ListalRipperTest extends RippersTest { * Test for list type url. */ @Test - public void testPictures() throws IOException { + public void testPictures() throws IOException, URISyntaxException { ListalRipper ripper = - new ListalRipper(new URL("https://www.listal.com/emma-stone_iii/pictures")); + new ListalRipper(new URI("https://www.listal.com/emma-stone_iii/pictures").toURL()); testRipper(ripper); } @@ -21,9 +23,9 @@ public class ListalRipperTest extends RippersTest { * Test for list type url. */ @Test - public void testRipListType() throws IOException { + public void testRipListType() throws IOException, URISyntaxException { ListalRipper ripper = - new ListalRipper(new URL("https://www.listal.com/list/evolution-emma-stone")); + new ListalRipper(new URI("https://www.listal.com/list/evolution-emma-stone").toURL()); testRipper(ripper); } @@ -31,9 +33,9 @@ public class ListalRipperTest extends RippersTest { * Test for folder type url. */ @Test - public void testRipFolderType() throws IOException { + public void testRipFolderType() throws IOException, URISyntaxException { ListalRipper ripper = - new ListalRipper(new URL("https://www.listal.com/chet-atkins/pictures")); + new ListalRipper(new URI("https://www.listal.com/chet-atkins/pictures").toURL()); testRipper(ripper); } diff --git a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/LusciousRipperTest.java b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/LusciousRipperTest.java index 7c797b4b..25dcb94d 100644 --- a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/LusciousRipperTest.java +++ b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/LusciousRipperTest.java @@ -1,6 +1,8 @@ package com.rarchives.ripme.tst.ripper.rippers; import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; import java.net.URL; import com.rarchives.ripme.ripper.rippers.LusciousRipper; @@ -11,28 +13,28 @@ import org.junit.jupiter.api.Test; public class LusciousRipperTest extends RippersTest { @Test @Disabled("test or ripper broken") - public void testPahealRipper() throws IOException { + public void testPahealRipper() throws IOException, URISyntaxException { // a photo set LusciousRipper ripper = new LusciousRipper( - new URL("https://luscious.net/albums/h-na-alice-wa-suki-desu-ka-do-you-like-alice-when_321609/")); + new URI("https://luscious.net/albums/h-na-alice-wa-suki-desu-ka-do-you-like-alice-when_321609/").toURL()); testRipper(ripper); } @Test - public void testGetGID() throws IOException { - URL url = new URL("https://luscious.net/albums/h-na-alice-wa-suki-desu-ka-do-you-like-alice-when_321609/"); + public void testGetGID() throws IOException, URISyntaxException { + URL url = new URI("https://luscious.net/albums/h-na-alice-wa-suki-desu-ka-do-you-like-alice-when_321609/").toURL(); LusciousRipper ripper = new LusciousRipper(url); Assertions.assertEquals("h-na-alice-wa-suki-desu-ka-do-you-like-alice-when_321609", ripper.getGID(url)); } @Test @Disabled("test or ripper broken") - public void testGetNextPage() throws IOException { - URL multiPageAlbumUrl = new URL("https://luscious.net/albums/women-of-color_58/"); + public void testGetNextPage() throws IOException, URISyntaxException { + URL multiPageAlbumUrl = new URI("https://luscious.net/albums/women-of-color_58/").toURL(); LusciousRipper multiPageRipper = new LusciousRipper(multiPageAlbumUrl); assert (multiPageRipper.getNextPage(multiPageRipper.getFirstPage()) != null); - URL singlePageAlbumUrl = new URL("https://members.luscious.net/albums/bakaneko-navidarks_332097/"); + URL singlePageAlbumUrl = new URI("https://members.luscious.net/albums/bakaneko-navidarks_332097/").toURL(); LusciousRipper singlePageRipper = new LusciousRipper(singlePageAlbumUrl); try { singlePageRipper.getNextPage(singlePageRipper.getFirstPage()); diff --git a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/MangadexRipperTest.java b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/MangadexRipperTest.java index 62aabf7c..fe957e32 100644 --- a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/MangadexRipperTest.java +++ b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/MangadexRipperTest.java @@ -4,17 +4,18 @@ package com.rarchives.ripme.tst.ripper.rippers; import com.rarchives.ripme.ripper.rippers.MangadexRipper; import java.io.IOException; -import java.net.URL; +import java.net.URI; +import java.net.URISyntaxException; public class MangadexRipperTest extends RippersTest{ - public void testRip() throws IOException { - MangadexRipper ripper = new MangadexRipper(new URL("https://mangadex.org/chapter/467904/")); + public void testRip() throws IOException, URISyntaxException { + MangadexRipper ripper = new MangadexRipper(new URI("https://mangadex.org/chapter/467904/").toURL()); testRipper(ripper); } public class testMangaRip extends RippersTest{ - public void testRip() throws IOException { - MangadexRipper ripper = new MangadexRipper(new URL("https://mangadex.org/title/44625/this-croc-will-die-in-100-days")); + public void testRip() throws IOException, URISyntaxException { + MangadexRipper ripper = new MangadexRipper(new URI("https://mangadex.org/title/44625/this-croc-will-die-in-100-days").toURL()); testRipper(ripper); } } diff --git a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/ManganeloRipperTest.java b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/ManganeloRipperTest.java index 37818121..5095553c 100644 --- a/src/test/java/com/rarchives/ripme/tst/ripper/rippers/ManganeloRipperTest.java +++ b/src/test/java/com/rarchives/ripme/tst/ripper/rippers/ManganeloRipperTest.java @@ -1,6 +1,8 @@ package com.rarchives.ripme.tst.ripper.rippers; import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; import java.net.URL; import com.rarchives.ripme.ripper.rippers.ManganeloRipper; @@ -11,14 +13,14 @@ import org.junit.jupiter.api.Test; public class ManganeloRipperTest extends RippersTest { @Test @Disabled("no images found, test or ripper broken") - public void testRip() throws IOException { - ManganeloRipper ripper = new ManganeloRipper(new URL("https://manganelo.com/manga/demonic_housekeeper")); + public void testRip() throws IOException, URISyntaxException { + ManganeloRipper ripper = new ManganeloRipper(new URI("https://manganelo.com/manga/demonic_housekeeper").toURL()); testRipper(ripper); } @Test - public void testGetGID() throws IOException { - URL url = new URL("https://manganelo.com/manga/demonic_housekeeper"); + public void testGetGID() throws IOException, URISyntaxException { + URL url = new URI("https://manganelo.com/manga/demonic_housekeeper").toURL(); ManganeloRipper ripper = new ManganeloRipper(url); Assertions.assertEquals("demonic_housekeeper", ripper.getGID(url)); }