diff --git a/reader/src/test/java/io/github/dfa1/vortex/reader/VortexHttpReaderIT.java b/reader/src/test/java/io/github/dfa1/vortex/reader/VortexHttpReaderIT.java index 061473ac..da3c087b 100644 --- a/reader/src/test/java/io/github/dfa1/vortex/reader/VortexHttpReaderIT.java +++ b/reader/src/test/java/io/github/dfa1/vortex/reader/VortexHttpReaderIT.java @@ -61,21 +61,6 @@ void open_remoteFile_layoutRowCountIsPositive() throws Exception { } } - @Test - void open_withCustomRegistry_parsesMetadata() throws Exception { - // Given the two-arg overload: caller supplies a registry, default shared HttpClient. - // The three-arg overload is exercised by the mock-client unit tests, but this - // delegating overload was otherwise untested. - - // When - try (var sut = VortexHttpReader.open(FOR_ARRAY, ReadRegistry.loadAll())) { - - // Then - assertThat(sut.version()).isEqualTo(1); - assertThat(sut.dtype()).isNotNull(); - } - } - @Test void scan_forVortex_decodesAllRows() throws Exception { // Given diff --git a/reader/src/test/java/io/github/dfa1/vortex/reader/VortexHttpReaderOpenOverloadTest.java b/reader/src/test/java/io/github/dfa1/vortex/reader/VortexHttpReaderOpenOverloadTest.java new file mode 100644 index 00000000..9ba24d22 --- /dev/null +++ b/reader/src/test/java/io/github/dfa1/vortex/reader/VortexHttpReaderOpenOverloadTest.java @@ -0,0 +1,23 @@ +package io.github.dfa1.vortex.reader; + +import org.junit.jupiter.api.Test; + +import java.net.URI; + +import static org.assertj.core.api.Assertions.assertThatThrownBy; + +/// Unit coverage for the [VortexHttpReader#open(URI, ReadRegistry)] overload, which wires the +/// shared default [java.net.http.HttpClient]. A non-HTTP URI makes the request builder reject +/// the scheme before any socket is opened, so the delegation runs without real network I/O. +class VortexHttpReaderOpenOverloadTest { + + @Test + void open_uriAndRegistry_delegatesToDefaultClient() { + // Given a URI whose scheme HttpRequest.newBuilder rejects (no network performed) + URI uri = URI.create("ftp://example.invalid/file.vortex"); + + // When / Then the two-arg overload runs and surfaces the rejection + assertThatThrownBy(() -> VortexHttpReader.open(uri, ReadRegistry.empty())) + .isInstanceOf(IllegalArgumentException.class); + } +}