RFR: 8318662: Refactor some jdk/java/net/httpclient/http2 tests to JUnit [v2]

Mahendra Chhipa mchhipa at openjdk.org
Tue Sep 23 16:48:22 UTC 2025


On Mon, 22 Sep 2025 07:56:18 GMT, Volkan Yazici <vyazici at openjdk.org> wrote:

>> Mahendra Chhipa has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Implemented the review comments.
>
> test/jdk/java/net/httpclient/http2/BadHeadersTest.java line 247:
> 
>> 245: 
>> 246:     @BeforeAll
>> 247:     public static void setup() throws Exception {
> 
> `setup()` and `teardown()` can be package-private.
> 
> Note that this comment applies to all `@AfterAll`- and `@BeforeAll`-annotated methods also present in other touched files.

Now all AfterAll and BeforeAll methods are package private.

> test/jdk/java/net/httpclient/http2/BasicTest.java line 129:
> 
>> 127: 
>> 128:     @Test
>> 129:     public void test() throws Exception {
> 
> `@[Parameterized]Test`-annotated methods can be package-private.

Now all all test methods are package private.

> test/jdk/java/net/httpclient/http2/ConnectionFlowControlTest.java line 83:
> 
>> 81:     static HttpTestServer https2TestServer;  // HTTP/2 ( h2  )
>> 82:     static String http2URI;
>> 83:     static String https2URI;
> 
> These can be `private`.

Now these variables are private.

> test/jdk/java/net/httpclient/http2/ConnectionFlowControlTest.java line 90:
> 
>> 88:                 Arguments.of(http2URI),
>> 89:                 Arguments.of(https2URI)
>> 90:         );
> 
> You can use `Object[][]`.

reverted to Object[][]

> test/jdk/java/net/httpclient/http2/ContinuationFrameTest.java line 137:
> 
>> 135:         };
>> 136: 
>> 137:     static Stream<Arguments> variants() {
> 
> This can be `Object[][]`.

reverted to Object[][].

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27388#discussion_r2372904500
PR Review Comment: https://git.openjdk.org/jdk/pull/27388#discussion_r2372909168
PR Review Comment: https://git.openjdk.org/jdk/pull/27388#discussion_r2372911379
PR Review Comment: https://git.openjdk.org/jdk/pull/27388#discussion_r2372910141
PR Review Comment: https://git.openjdk.org/jdk/pull/27388#discussion_r2372912184


More information about the net-dev mailing list