Closed u6f6o closed 4 years ago
I realised that I got checkpoints wrong in the way, that you should not call completeNow()
on the test context manually as this is done by the checkpoint classes internally.
A minor adaption fixed this problem:
@Test
fun allVerticlesStart(
vertx: Vertx,
testContext: VertxTestContext)
{
val messageCodecCP = testContext.checkpoint()
val applicationConfigCP = testContext.checkpoint()
val stationAmbassadorCP = testContext.checkpoint()
val restEndpointCP = testContext.checkpoint()
val allSucceededCP = testContext.checkpoint()
val bootstrapper = object: ApplicationBootstrapper(listOf()) {
override fun messageCodecs() = succeedingVerticle(messageCodecCP)
override fun applicationConfig() = succeedingVerticle(applicationConfigCP)
override fun stationAmbassador() = succeedingVerticle(stationAmbassadorCP)
override fun restEndpoint() = succeedingVerticle(restEndpointCP)
}
vertx.deployVerticle(bootstrapper, testContext.succeeding { allSucceededCP.flag() })
}
I wrote a bootstrap class that basically deploys all necessary verticles in the right order:
Seems to work as expected. I also wrote a simple unit test, using vertx-junit5:
As it looks like though, the checkpoints I defined do not get evaluated at all. No matter if I set them to an arbitrary high value or if I do not flag them at all.
I wonder if I am doing something wrong or if this is maybe a bug?
Below you can find the library versions I am using: