Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URI instead of URL #1691

Merged
merged 5 commits into from
Feb 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/test/java/org/cactoos/io/InputOfTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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"})
Expand Down Expand Up @@ -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()
)
)
),
Expand Down
10 changes: 6 additions & 4 deletions src/test/java/org/cactoos/io/StickyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -37,6 +38,7 @@

/**
* Test case for {@link Sticky}.
*
* @since 0.6
*/
@SuppressWarnings("PMD.JUnitTestsShouldIncludeAssert")
Expand All @@ -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()
)
)
),
Expand Down
Loading