RFR: 8367068: Remove redundant HttpRequest.BodyPublisher tests

Volkan Yazici vyazici at openjdk.org
Mon Sep 22 11:15:42 UTC 2025


On Mon, 22 Sep 2025 10:12:28 GMT, Volkan Yazici <vyazici at openjdk.org> wrote:

> Remove `HttpRequest.BodyPublisher` tests rendered redundant by [JDK-8367067] (#26876).
> 
> [JDK-8367067]: https://bugs.openjdk.org/browse/JDK-8367067

test/jdk/java/net/httpclient/FilePublisherTest.java line 160:

> 158: 
> 159:     @Test
> 160:     public void testFileNotFound() throws Exception {

Duplicates [OfFileTest::testNonExistentPath].

[OfFileTest::testNonExistentPath]: https://github.com/openjdk/jdk/blob/e8db14f584fa92db170e056bc68074ccabae82c9/test/jdk/java/net/httpclient/HttpRequestBodyPublishers/OfFileTest.java#L97

test/jdk/java/net/httpclient/FlowAdapterPublisherTest.java line 110:

> 108:     private HttpClient newHttpClient(String uri) {
> 109:         var version = Optional.ofNullable(version(uri));
> 110:         var builder = version.isEmpty() || version.get() != Version.HTTP_3

Duplicates [FromPublisherTest].

[FromPublisherTest]: https://github.com/openjdk/jdk/blob/e8db14f584fa92db170e056bc68074ccabae82c9/test/jdk/java/net/httpclient/HttpRequestBodyPublishers/FromPublisherTest.java

test/jdk/java/net/httpclient/HttpRequestBodyPublishers/OfByteArraysTest.java line 47:

> 45: /*
> 46:  * @test
> 47:  * @bug 8226303 8364733

Copied 8226303 from `RelayingPublishers` to preserve the association.

test/jdk/java/net/httpclient/HttpRequestBodyPublishers/OfFileTest.java line 52:

> 50: /*
> 51:  * @test
> 52:  * @bug 8226303 8235459 8358688 8364733

Copied 8226303 and 8358688 from `RelayingPublishers`, and 8235459 from `FilePublisherTest` to preserve the association.

test/jdk/java/net/httpclient/RelayingPublishers.java line 52:

> 50: 
> 51:     @Test
> 52:     public void ofFile0() throws IOException {

Duplicates [OfFileTest::testIrregularFile].

[OfFileTest::testIrregularFile]: https://github.com/openjdk/jdk/blob/e8db14f584fa92db170e056bc68074ccabae82c9/test/jdk/java/net/httpclient/HttpRequestBodyPublishers/OfFileTest.java#L131C10-L131C27

test/jdk/java/net/httpclient/RelayingPublishers.java line 66:

> 64: 
> 65:     @Test
> 66:     public void ofFile1() throws IOException {

Duplicates [OfFileTest::testNonExistentPath].

[OfFileTest::testNonExistentPath]: https://github.com/openjdk/jdk/blob/e8db14f584fa92db170e056bc68074ccabae82c9/test/jdk/java/net/httpclient/HttpRequestBodyPublishers/OfFileTest.java#L97C10-L97C29

test/jdk/java/net/httpclient/RelayingPublishers.java line 76:

> 74: 
> 75:     @Test
> 76:     public void ofByteArrays() {

Duplicates [OfByteArraysTest::testNullArray].

[OfByteArraysTest::testNullArray]: https://github.com/openjdk/jdk/blob/e8db14f584fa92db170e056bc68074ccabae82c9/test/jdk/java/net/httpclient/HttpRequestBodyPublishers/OfByteArraysTest.java#L136C10-L136C23

test/jdk/java/net/httpclient/SubscriberAPIExceptions.java line 1:

> 1: /*

Duplicates [HttpRequestBodyPublishers/*Test].

[HttpRequestBodyPublishers/*Test]: https://github.com/openjdk/jdk/tree/e8db14f584fa92db170e056bc68074ccabae82c9/test/jdk/java/net/httpclient/HttpRequestBodyPublishers

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/27421#discussion_r2367460633
PR Review Comment: https://git.openjdk.org/jdk/pull/27421#discussion_r2367577590
PR Review Comment: https://git.openjdk.org/jdk/pull/27421#discussion_r2367678247
PR Review Comment: https://git.openjdk.org/jdk/pull/27421#discussion_r2367690928
PR Review Comment: https://git.openjdk.org/jdk/pull/27421#discussion_r2367606889
PR Review Comment: https://git.openjdk.org/jdk/pull/27421#discussion_r2367609281
PR Review Comment: https://git.openjdk.org/jdk/pull/27421#discussion_r2367627229
PR Review Comment: https://git.openjdk.org/jdk/pull/27421#discussion_r2367616967


More information about the net-dev mailing list