@Test
    void verifyExecWithExistingClient() {
        try (val webServer = new MockWebServer(HttpStatus.OK)) {
            webServer.start();
            val exec = HttpExecutionRequest.builder()
                .basicAuthPassword("password")
                .basicAuthUsername("user")
                .method(HttpMethod.GET)
                .entity("entity")
                .url("http://localhost:%s".formatted(webServer.getPort()))
                .httpClient(new SimpleHttpClientFactoryBean().getObject())
                .build();
            assertNotNull(HttpUtils.execute(exec));
        }
    }
This is {@link HttpUtilsTests}.

@author Misagh Moayyed
@since 6.3.0
core/cas-server-core-util-api/src/test/java/org/apereo/cas/util/HttpUtilsTests.java