your mother was a SOAP request
Ask HN: Best Way to Mock APIs in 2020?
21–30 of 63 posts
Re: Ask HN: Best Way to Mock APIs in 2020?
#22Can someone explain to me what this is all about? Shouldn't you hide all your API calls behind an interface, and then mock that interface? Dependency inversion principle, depend upon abstractions and all that.
Re: Ask HN: Best Way to Mock APIs in 2020?
#23Re: Ask HN: Best Way to Mock APIs in 2020?
#24If anytime, write integration tests using something like selenium or whatever the latest hotness is.
Re: Ask HN: Best Way to Mock APIs in 2020?
#25I've found mitmproxy ( https://mitmproxy.org ) in reverse mode really useful. I'm a mobile dev and when the backend work is still pending I usually mock the backend requirements by selectively patching or adding endpoint support, it can be used like so: mitmproxy --mode reverse:https://my.privateapi.com -s ./path/to/mockscript.py This allows me to implement most of the UI and server interactions w/o being blocked by…
I think we can use both: https://docs.mitmproxy.org/stable/addons-scripting/
For mocking, and dump/replay for debugging for some of our projects.
Re: Ask HN: Best Way to Mock APIs in 2020?
#26I was wondering if you had a chance to have a look at Microcks ( https://microcks.io/ ) ?
Re: Ask HN: Best Way to Mock APIs in 2020?
#27Re: Ask HN: Best Way to Mock APIs in 2020?
#28Can someone explain to me what this is all about? Shouldn't you hide all your API calls behind an interface, and then mock that interface? Dependency inversion principle, depend upon abstractions and all that.
Re: Ask HN: Best Way to Mock APIs in 2020?
#29I would suggest having a look at Microcks ( https://microcks.io ) as a way to produce mocks from OpenAPI contracts, Postman collection or other assets... Full disclosure : I am the founder of the project ;-)