val call = TestApplicationEngine().createCall {
this.method = <http://HttpMethod.Post|HttpMethod.Post>
this.setBody(mapper.writeValueAsBytes(mockRequest))
}
but I cannot read the object back using
call.receive<Foo>()
(can only read it as plain text) -> am I missing anything?
👀 1
Dariusz Kuc
03/07/2023, 10:23 PM
so it looks like the reason why it doesn't work is that request created by using the above is a client request that still has to be processed by the server (which would include the content negotiation plugin)
it appears that it is not possible to unit test functionality that relies on
ApplicationRequest
and we are pretty much stuck with integration tests....