Hello guys, I'm having a problem with testing conf...
# ktor
a
Hello guys, I'm having a problem with testing configuration. I've the modules defined in the
application.conf
file like this:
Copy code
ktor {
    deployment {
        host = 0.0.0.0
        port = 8080
    }

    application {
        modules = [
            com.example.plugins.RoutingKt.routingModule
        ]
    }
}
And then I have a test:
Copy code
@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:
Copy code
@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?