diff --git a/extensions/mutiny/deployment/src/test/java/io/quarkus/mutiny/deployment/test/MutinyTest.java b/extensions/mutiny/deployment/src/test/java/io/quarkus/mutiny/deployment/test/MutinyTest.java index 2012c53515982b..0f491458283f7a 100644 --- a/extensions/mutiny/deployment/src/test/java/io/quarkus/mutiny/deployment/test/MutinyTest.java +++ b/extensions/mutiny/deployment/src/test/java/io/quarkus/mutiny/deployment/test/MutinyTest.java @@ -14,6 +14,7 @@ import javax.enterprise.context.ApplicationScoped; import javax.inject.Inject; +import io.quarkus.mutiny.runtime.MutinyInfrastructure; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.junit.jupiter.api.Assertions; @@ -91,7 +92,7 @@ public void testForbiddenUniBlocking() throws InterruptedException { throwable.set(err); } latch.countDown(); - }, "vert.x-eventloop-thread-0").start(); + }, MutinyInfrastructure.VERTX_EVENT_LOOP_THREAD_PREFIX + "0").start(); Assertions.assertTrue(latch.await(5, TimeUnit.SECONDS)); Assertions.assertNull(item.get()); diff --git a/extensions/mutiny/runtime/src/main/java/io/quarkus/mutiny/runtime/MutinyInfrastructure.java b/extensions/mutiny/runtime/src/main/java/io/quarkus/mutiny/runtime/MutinyInfrastructure.java index 4c298f9a113c1e..1304b385f6c8b0 100644 --- a/extensions/mutiny/runtime/src/main/java/io/quarkus/mutiny/runtime/MutinyInfrastructure.java +++ b/extensions/mutiny/runtime/src/main/java/io/quarkus/mutiny/runtime/MutinyInfrastructure.java @@ -12,6 +12,8 @@ @Recorder public class MutinyInfrastructure { + public static final String VERTX_EVENT_LOOP_THREAD_PREFIX = "vert.x-eventloop-thread-"; + public void configureMutinyInfrastructure(ExecutorService exec) { Infrastructure.setDefaultExecutor(exec); } @@ -36,7 +38,7 @@ public boolean getAsBoolean() { * calling from a Vert.x event-loop context / thread. */ String threadName = Thread.currentThread().getName(); - return !threadName.startsWith("vert.x-eventloop-thread-"); + return !threadName.startsWith(VERTX_EVENT_LOOP_THREAD_PREFIX); } }); }