Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
}
}