Closed matthewadams closed 6 years ago
For anyone looking for the solution to the potential issue this PR attempted to identify, it's to use vertx.runOnContext()
:
@ExtendWith(VertxExtension.class)
@DisplayName("Configure extension to run tests in a VertxThread")
class RunOnVertxThreadTest {
@Test
public void ensureVertxThread(Vertx vertx) {
vertx.runOnContext(event -> { /////////////////// <- this is the fix
assertTrue(Thread.currentThread() instanceof VertxThread);
assertNotNull(Vertx.currentContext());
});
}
}
This PR provides a response to @jponge 's question at https://groups.google.com/forum/?fromgroups#!topic/vertx/hZKptoExh1c