I'm using `withTestApplication` to test my microse...
# ktor
m
I'm using
withTestApplication
to test my microservice, and wanted to send it data classes rather than JSON strings, and receive unmarshalled data classes as responses (rather than raw JSON strings from HTTP response bodies). Is it a case of just using Jackson directly, or is there any special support available in Ktor for this?
c
Can't you install ktor-jackson to test app as well?
Or you want to eliminate actual serialization in tests?
m
Yeah, more the latter -- I'd like to be able to call
TestApplicationRequest.setBody(requestObject)
and
TestApplicationResponse.bodyAs<ResponseDTO>
So I've ended up with just writing some extension methods that do the above, which seems OK