papsign / Ktor-OpenAPI-Generator

Ktor OpenAPI/Swagger 3 Generator
Apache License 2.0
243 stars 42 forks source link

Testing of POST method does not work #21

Closed SerVB closed 4 years ago

SerVB commented 4 years ago

Hi!

In https://github.com/SerVB/e-shop/tree/938d357e4ff2b4e06a557102c65f73773b4d67c3, I have two similar tests (in server/src/test/kotlin/io/github/servb/eShop/product/route/singleOperation dir):

When I run tests, I get the following:

image

For POST variant, both call.response.status() and call.response.content are null. So the test fails.

Any ideas how can I test it?

SerVB commented 4 years ago

I've just fixed it: https://github.com/SerVB/e-shop/commit/7800c1142952f07feead16cf3d354c2680d3c579! The problem is that I haven't added "content type" header.

So I'm closing the issue.