[#1032] Added mock server integration#1097
Conversation
|
|
||
| val response = { | ||
| val responseValue = expectedOutput.merge | ||
| val encodeOutputBody: EncodeOutputBody[Any, Any, Nothing] = new EncodeOutputBody[Any, Any, Nothing] { |
There was a problem hiding this comment.
Probably can be refactored so that both sttp-stub-server and sttp-mock-server will use the same logic
|
I have no idea why doesn't it compile on the CI server 😢 Locally it runs successfully |
|
I think using the REST API directly is definitely a good choice :) Same with circe - it doesn't bring in many dependencies so it's also a safe (and popular) choice. As for the compile errors - maybe you rebased before pushing? There have been some changes to server interpreters, see the stub implementation (but shouldn't impact your impl much) |
|
@adamw got it, I'll rebase my branch soon. |
|
@adamw @ghostbuster91 I've added the most used functionality (creating strict expectations, verifying them, clearing, etc.). I would like to receive your feedback before I go further implementing tests 😄 |
|
Looks good - I don't think I have any significant comments :) |
|
I guess for unit-testing you might end up stubbing the mock server ;) |
|
Awesome, thanks for the great work :) I think we should also mention it somewhere in the docs, probably in testing section (https://github.com/softwaremill/tapir/blob/master/doc/testing.md) |
|
@adamw @ghostbuster91 I'm done with unit tests and the documentation 😃 |
|
Thank you! |
@adamw @ghostbuster91 added DRAFT implementation with mock-server .
You may try it by running mock-server locally in docker:
There are few questions about the implementation: