@Test
    void testAuthenticationUserinfoInRequest() throws Exception {
        configureServer(bootstrap -> bootstrap
                .register("*", new EchoHandler()));
        final HttpHost target = startServer();

        final TestClient client = client();
        final HttpGet httpget = new HttpGet("http://test:test@" + target.toHostString() + "/");

        final HttpClientContext context = HttpClientContext.create();
        Assertions.assertThrows(ClientProtocolException.class, () -> client.execute(target, httpget, context, response -> null));
    }
Unit tests for automatic client authentication.
httpclient5-testing/src/test/java/org/apache/hc/client5/testing/sync/TestClientAuthentication.java