Mocking in Testing

Ridwan Yusuf
Nov 16, 2022

--

Say you have two separate microservices (Auth/User service & Order service) where both of them need to communicate.

The Order service needs to know which specific User is making an order of a product.

Mocking comes in place when testing because you don’t want to set-up a separate #server (local/remote) for Service A when testing Service B which needs Service A to be up and running.

In addition, mocking saves time in testing since you won't have to make an actual call to the other service.

Literally any #object can be mocked in coding. The same goes for third party APIs.

--

--

Ridwan Yusuf
Ridwan Yusuf

Written by Ridwan Yusuf

RidwanRay.com -I provide engineers with actionable tips and guides for immediate use

No responses yet