I am getting an issue when combining `MockEngine` ...
# ktor
j
I am getting an issue when combining
MockEngine
with
Json
, but the same exact logic is working when fetching from remote, more info in 🧵
Copy code
No transformation found: class io.ktor.utils.io.ByteBufferChannel -> class com.javiersc.either.network.ktor.TodoDTO
with response from <http://localhost/path>:
status: 200 OK
response headers: 

io.ktor.client.call.NoTransformationFoundException: No transformation found: class io.ktor.utils.io.ByteBufferChannel -> class com.javiersc.either.network.ktor.TodoDTO
with response from <http://localhost/path>:
status: 200 OK
response headers:
image.png,image.png
the
CIO
one is working perfectly, meanwhile the
MockEngine
one, which I think is doing the same, it fails
TodoDTO
is the same class for both tests
The
TODO
string can be serialized if I use it with the Json without using Ktor
a
Could you please try to respond with the
Content-Type
header?
Copy code
respond(TODO, headers = headersOf(HttpHeaders.ContentType, ContentType.Application.Json.toString()))
j
It works! thank you 🙂