maxmello
08/14/2019, 7:06 PMval verifyCalled = mockk<VerifyCalled>()
withTestApplication({
...
routing {
test(verifyCalled) // extension function to create a route /test
}
}) {
handleRequest(...) {
// In calling the request, a httpClient will call the test route above
...
}.apply {
verify { verifyCalled.callMe() }
}
}
It doesn’t seem to work though. My first problem is that I don’t actually know on which port the test application runs (I would assume the same as in the application.conf, but i’m not sure that one is even used) or if the application is even accessible during testing via localhost. I’m also not sure the route will even exist when created that way, as I get a 404 for calling http://localhost:8080/test during the test at the moment.