Skip to content

Commit 3b8feb6

Browse files
go2helvietj
authored andcommitted
Added Unit test
1 parent 14f3cff commit 3b8feb6

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

vertx-core/src/test/java/io/vertx/tests/context/ContextTest.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import io.vertx.core.spi.context.storage.ContextLocal;
2222
import io.vertx.test.core.ContextLocalHelper;
2323
import io.vertx.test.core.VertxTestBase;
24+
import io.vertx.test.fakemetrics.FakeMetricsFactory;
2425
import org.junit.Assume;
2526
import org.junit.Test;
2627

@@ -1241,4 +1242,14 @@ public void testContextLocals() {
12411242
assertSame(contextLocal, locals.get(1));
12421243
assertSame(locals, ((VertxInternal) vertx).contextLocals());
12431244
}
1245+
1246+
@Test
1247+
public void testVirtualThreadContextHasPoolMetrics() {
1248+
Assume.assumeTrue(isVirtualThreadAvailable());
1249+
Vertx vertxWithMetrics = Vertx.builder()
1250+
.withMetrics(new FakeMetricsFactory())
1251+
.build();
1252+
ContextInternal context = ((VertxImpl) vertxWithMetrics).createVirtualThreadContext();
1253+
assertNotNull(context.workerPool().metrics());
1254+
}
12441255
}

0 commit comments

Comments
 (0)