Ktor / Kodein - How to write Integration Tests
Currently I write a small demo-app which uses Ktor as its Application Environment and Kodein as the Dependency Injection Framework.
During the initialization of the Application I do import some modules, one of those I would like to replace during the initialization of the Integration Tests:
fun Application.module(testing: Boolean = false) {
logger.debug { "Starting main" }
restModule()
di {
bind() with singleton {
Json {
...
}
}
import(persistenceModule)
}
In the test,...