diff --git a/src/test/java/org/cactoos/io/InputOfTest.java b/src/test/java/org/cactoos/io/InputOfTest.java index da17d0964..1cdfecf88 100644 --- a/src/test/java/org/cactoos/io/InputOfTest.java +++ b/src/test/java/org/cactoos/io/InputOfTest.java @@ -28,7 +28,8 @@ import java.io.IOException; import java.io.InputStream; import java.io.StringReader; -import java.net.URL; +import java.net.URI; +import java.net.URISyntaxException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; @@ -54,8 +55,8 @@ /** * Test case for {@link InputOf}. * - * @since 0.1 * @checkstyle ClassFanOutComplexityCheck (500 lines) + * @since 0.1 */ @SuppressWarnings({"PMD.TooManyMethods", "PMD.ExcessiveImports", "unchecked", "PMD.JUnitTestsShouldIncludeAssert"}) @@ -146,15 +147,15 @@ void readsRealUrl() throws Exception { } @Test - void readsStringUrl() throws IOException { + void readsStringUrl() throws IOException, URISyntaxException { new Assertion<>( "must fetch bytes from the HTTPS URL", new TextOf( new BytesOf( new InputOf( - new URL( + new URI( "file:src/test/resources/org/cactoos/large-text.txt" - ) + ).toURL() ) ) ), diff --git a/src/test/java/org/cactoos/io/StickyTest.java b/src/test/java/org/cactoos/io/StickyTest.java index e52ba01c7..1ab94ee25 100644 --- a/src/test/java/org/cactoos/io/StickyTest.java +++ b/src/test/java/org/cactoos/io/StickyTest.java @@ -24,7 +24,8 @@ package org.cactoos.io; import java.net.MalformedURLException; -import java.net.URL; +import java.net.URI; +import java.net.URISyntaxException; import org.cactoos.bytes.BytesOf; import org.cactoos.func.Repeated; import org.cactoos.scalar.LengthOf; @@ -37,6 +38,7 @@ /** * Test case for {@link Sticky}. + * * @since 0.6 */ @SuppressWarnings("PMD.JUnitTestsShouldIncludeAssert") @@ -63,15 +65,15 @@ void readsFileContent() { } @Test - void readsRealUrl() throws MalformedURLException { + void readsRealUrl() throws MalformedURLException, URISyntaxException { new Assertion<>( "Must fetch text page from the URL", new TextOf( new Sticky( new InputOf( - new URL( + new URI( "file:src/test/resources/org/cactoos/large-text.txt" - ) + ).toURL() ) ) ),