CLOVIS
05/29/2021, 9:32 AMwithTestApplication
ignore authentication? It accesses an endpoint behind authenticate()
without any specific setupRohde Fischer
05/29/2021, 9:34 AMCLOVIS
05/29/2021, 9:43 AMwithTestApplication
gives null, but no error.Rohde Fischer
05/29/2021, 9:51 AMval testEnvironment: () -> ApplicationEngineEnvironment
fun withTestApplication(
method: HttpMethod,
uri: String,
applicationRequest: (TestApplicationRequest.() -> Unit) = {},
testSetup: (TestApplicationCall.() -> Unit)
) {
withApplication(testEnvironment()) {
application.publikum()
with(
handleRequest(method, uri, applicationRequest),
testSetup
)
}
}
I think you can use the raw test environment for your purposes, we override it to simulate various configs from application.conf
testEnvironment = {
createTestEnvironment {
config = (config as MapApplicationConfig).let {
it.put("foo.bar", "value")
it
}
}
}
I hope it can get you started, even though it's bit's and pieces, I'm in the middle of an urgent issue, so can't dive much deeper right now 😞CLOVIS
05/29/2021, 10:43 AM