Jeff Hudson
07/31/2024, 7:19 PMtestApplication
is supposed to load application.conf
by default? At least, according to the docs.
I’m using CIO (not embeddedServer) and it doesn’t seem to be working.
Does not work
@Test
fun testRoot() = testApplication {
client.get("/").apply {
assertEquals(HttpStatusCode.OK, status)
assertEquals("Hello World!", bodyAsText())
}
}
Works
@Test
fun testRoot() = testApplication {
environment {
config = HoconApplicationConfig(ConfigFactory.load())
}
client.get("/").apply {
assertEquals(HttpStatusCode.OK, status)
assertEquals("Hello World!", bodyAsText())
}
}
Aleksei Tirman [JB]
07/31/2024, 8:30 PMJeff Hudson
07/31/2024, 8:30 PMAleksei Tirman [JB]
07/31/2024, 8:32 PMJeff Hudson
07/31/2024, 9:11 PM