diff --git a/extensions/vertx/deployment/src/test/java/io/quarkus/vertx/deployment/MessageConsumerMethodTest.java b/extensions/vertx/deployment/src/test/java/io/quarkus/vertx/deployment/MessageConsumerMethodTest.java index 5bcc0e2fbf3ac..3fd71db859df2 100644 --- a/extensions/vertx/deployment/src/test/java/io/quarkus/vertx/deployment/MessageConsumerMethodTest.java +++ b/extensions/vertx/deployment/src/test/java/io/quarkus/vertx/deployment/MessageConsumerMethodTest.java @@ -12,6 +12,7 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; import javax.enterprise.context.RequestScoped; import javax.inject.Inject; @@ -56,6 +57,23 @@ public void testSend() throws InterruptedException { assertEquals("HELLO", synchronizer.poll(2, TimeUnit.SECONDS)); } + @Test + public void testSendGenericType() throws InterruptedException { + BlockingQueue synchronizer = new LinkedBlockingQueue<>(); + eventBus.request("foos", List.of(1, 2), ar -> { + if (ar.succeeded()) { + try { + synchronizer.put(ar.result().body()); + } catch (InterruptedException e) { + fail(e); + } + } else { + fail(ar.cause()); + } + }); + assertEquals(3, synchronizer.poll(2, TimeUnit.SECONDS)); + } + @Test public void testSendAsync() throws InterruptedException { BlockingQueue synchronizer = new LinkedBlockingQueue<>(); @@ -252,6 +270,11 @@ void consumeBlockingUsingRunOnWorkerThread(String message) { String blockingRequestContextActive(String message) { return transformer.transform(message); } + + @ConsumeEvent("foos") + int reply(List numbers) { + return numbers.stream().collect(Collectors.summingInt(Integer::intValue)); + } } @RequestScoped