RFR: 8352431: java/net/httpclient/EmptyAuthenticate.java uses "localhost"

Jaikiran Pai jpai at openjdk.org
Wed Apr 9 11:38:35 UTC 2025


On Wed, 9 Apr 2025 11:12:31 GMT, Volkan Yazici <vyazici at openjdk.org> wrote:

> Overhauls `EmptyAuthenticate` to
> 
> - Test all supported HTTP versions (i.e., HTTP/1.1 and HTTP/2)
> - Test both clear-text and SSL
> - Use `HttpServerAdapters.HttpTestServer::create` to avoid host-related problems

test/jdk/java/net/httpclient/EmptyAuthenticate.java line 74:

> 72:     @MethodSource("args")
> 73:     void test(Version version, boolean secure) throws Exception {
> 74:         HttpTestServer server = createStartedServerRespondingWithEmptyWwwAuthHeader(version, secure);

Nit - in general, I think it should be OK to have simpler names for these methods. So `startServer()` should be fine. Similarly the `ServerHandlerRespondingWithEmptyWwwAuthHeader` handler class could be named just `Handler`. If the method or the class in these tests does something very involved (unlike in this case), I think, the names can still stay simple and a brief code comment on the method/class would be fine.

However, if you prefer it to use the current form, that's fine with me.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24542#discussion_r2035177810


More information about the net-dev mailing list