@Test
    public void testCallback() throws Exception {
        final TransmittableThreadLocal<String> transmittableThreadLocal = new TransmittableThreadLocal<>();
        final InheritableThreadLocal<String> inheritableThreadLocal = new InheritableThreadLocal<>();
        final String transmittedData = "transmitted_data_ttl";
        final String inheritedData = "inherited_data_ttl";

        final Vertx vertx = Vertx.vertx();
        //here will bind eventLoop to client and create a new Thread for eventLoop
        final WebClient client = WebClient.create(vertx);
        client.get(80, "bing.com", "/")
                .send()
                .onSuccess(response -> {
                    System.out.println("===================warmup callback=====================");
                    System.out.println(response.headers());
                    System.out.println("===================warmup  callback=====================");
                })
                .toCompletionStage().toCompletableFuture().get(10, TimeUnit.SECONDS);

        //set value after eventLoop thread was created
        transmittableThreadLocal.set(transmittedData);
        inheritableThreadLocal.set(inheritedData);

        final Future<HttpResponse<Buffer>> future = client.get(80, "bing.com", "/")
                .send()
                .onSuccess(response -> {
                    System.out.println("===================callback=====================");
                    System.out.println(response.headers());

                    if (TtlAgent.isTtlAgentLoaded()) {
                        System.out.println("Test **WITH** TTL Agent");
                        assertEquals(transmittedData, transmittableThreadLocal.get());
                    } else {
                        System.out.println("Test WITHOUT TTL Agent");
                        assertNull(transmittableThreadLocal.get());
                    }

                    System.out.println("===================callback=====================");
                });

        // block and wait to finish
        future.toCompletionStage().toCompletableFuture().get(10, TimeUnit.SECONDS);
    }
@author tk (soulmate.tangk at gmail dot com)
ttl-integrations/vertx4-ttl-integration/src/test/java/com/alibaba/ttl/integration/vertx4/VertxTransformletTest.java