2. Ktor¶
Here you can jump immediately to the Ktor example application.
Deps¶
Example Setup¶
TestSystem(baseUrl = "http://localhost:8080")
.with {
httpClient()
bridge()
postgresql {
PostgresqlOptions(configureExposedConfiguration = { cfg ->
listOf(
"database.jdbcUrl=${cfg.jdbcUrl}",
"database.host=${cfg.host}",
"database.port=${cfg.port}",
"database.name=${cfg.database}",
"database.username=${cfg.username}",
"database.password=${cfg.password}"
)
})
}
kafka {
stoveKafkaObjectMapperRef = objectMapperRef
KafkaSystemOptions {
listOf(
"kafka.bootstrapServers=${it.bootstrapServers}"
)
}
}
wiremock {
WireMockSystemOptions(
port = 9090,
removeStubAfterRequestMatched = true,
afterRequest = { e, _ ->
logger.info(e.request.toString())
}
)
}
ktor(
withParameters = listOf(
"port=8080"
),
runner = { parameters ->
stove.ktor.example.run(parameters) {
addTestSystemDependencies()
}
}
)
}.run()