I would like to know if it is possible migrate this kind of rule(junit) to vertx-junit5 way. The original example is the RunOnContextTest.java from the public vertx-example repository in github. Here is the code:
@RunWith(VertxUnitRunner.class)
public class RunOnContextTest {
/*
* This rule wraps the junit calls in a Vert.x context, the Vert.x instance can be created by the
* rule or provided like in this case.
*/
@Rule
public final RunTestOnContext rule = new RunTestOnContext(Vertx::vertx);
private Thread thread;
@Before
public void before(TestContext context) {
context.assertTrue(Context.isOnEventLoopThread());
thread = Thread.currentThread();
}
@Test
public void theTest(TestContext context) {
context.assertTrue(Context.isOnEventLoopThread());
context.assertEquals(thread, Thread.currentThread());
}
@After
public void after(TestContext context) {
context.assertTrue(Context.isOnEventLoopThread());
context.assertEquals(thread, Thread.currentThread());
}
And the highlighted dependencies are:
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-unit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>