On Mon, 9 Jun 2025 14:21:45 GMT, Daniel Fuchs <dfu...@openjdk.org> wrote:

>> test/jdk/java/net/httpclient/HttpClientAuthRetryLimitTest.java line 132:
>> 
>>> 130:                 assertEquals("too many authentication attempts. Limit: 
>>> " + RETRY_LIMIT, exception.getMessage());
>>> 131:                 assertEquals(RETRY_LIMIT > 0 ? RETRY_LIMIT : 0,
>>> 132:                         RETRY_LIMIT > 0 ? 
>>> requestCount.get():requestCount.decrementAndGet());
>> 
>> Could you split that in two statements for better readability? The double 
>> ternary operator makes it difficult to parse.
>> 
>> 
>>     if (RETRY_LIMIT > 0) {
>>         assertEquals(...);
>>     } else {
>>         assertEquals(...);
>>     }
>
> Also it would be better not to change the request count. The request count 
> should only be changed by the Authenticator. Maybe introducing a variable:
> 
>    int expectedRequetedCount = ...;
> 
> would be beneficial.

Thank you for your review. The changes have been made in 
7a9eb0b2969991aafc3d1bdfba283ece6e458370

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25490#discussion_r2137959494

Reply via email to