This message was deleted.
# help
s
This message was deleted.
t
Hi @xiao ma, I would say it depends on your context to some extent. There are some teams who mix mocks with real APIs e.g. you might run your real login service but mock your payments service while testing. I would suggest you mock anything where it’s hard to set up the test conditions you need, or that the real API’s sandbox is slow/flakey/incorrect in some way. Having said that there are teams who test each service completely isolated via mocks (us included). This can have significant advantages in terms of speed and reliability of test execution, not to mention flexibility in defining both happy path and negative test conditions.
x
Thank you for your answer. I think we are currently in a mixed scenario where we only need to request mock servers from specific interfaces. What I would like to know more is whether we need to implement routing for interfaces ourselves?
t
Provided you can set the base URL or domain name for each API your service communicates with, that it usually enough
So you’d e.g. change a setting like
<https://api.stripe.com>
->
<https://mock-stripe.mymockapis.com>
x
Thank you, I understand what you mean