Antonio Acuña Prieto
08/26/2023, 3:19 PMapplication.conf
file like this:
ktor {
deployment {
host = 0.0.0.0
port = 8080
}
application {
modules = [
com.example.plugins.RoutingKt.routingModule
]
}
}
And then I have a test:
@Test
fun `should return hello world`() = testApplication {
val response = client.get("/")
assertEquals(HttpStatusCode.OK, response.status)
assertEquals("Hello, world!", response.bodyAsText())
}
But if I want to extend the configuration using:
@Test
fun `should return hello world`() = testApplication {
environment {
config = config.mergeWith(
MapApplicationConfig("test" to "test")
)
}
val response = client.get("/")
assertEquals(HttpStatusCode.OK, response.status)
assertEquals("Hello, world!", response.bodyAsText())
}
Then the endpoint couldn't be reached and it returns 404.
Anybody knows what I'm doing wrong?