@Test
    void test() throws Exception {
        final AtomicReference<String> actualKeyName = new AtomicReference<>();

        // Create a new ClientFactory with a TrustManager that records the received certificate.
        try (ClientFactory clientFactory =
                     ClientFactory.builder()
                                  .tlsCustomizer(b -> {
                                      b.trustManager(new TrustManagerFactoryImpl(actualKeyName));
                                  })
                                  .build()) {

            // Send a request to make the TrustManager record the certificate.
            final WebClient client = WebClient.builder("h2://127.0.0.1:" + port)
                                              .factory(clientFactory)
                                              .build();
            client.get("/").aggregate().join();

            assertThat(actualKeyName).hasValue(expectedKeyName);
        }
    }
Makes sure the specified certificate is selected.
spring/boot3-webflux-autoconfigure/src/test/java/com/linecorp/armeria/spring/web/reactive/AbstractReactiveWebServerCustomKeyAliasTest.java