Chapter 13: Testing Incoming and Outgoing Calls
In the connected world that we are in, chances are big that your extension enables external systems to call into Business Central by providing one or more APIs and/or makes its own outgoing calls to external services. Both incoming and outgoing calls are two mirrored sides of the same medal, where a so-called client process is calling into a service. With an incoming call, it's our service being called upon by an external client, whereas with an outgoing call, it's an external service being called upon by our client process. Testing the one – handling an incoming call – is about verifying the validity of the service, while testing the other – handling an outgoing call – is about verifying the validity of the client process. To test the incoming call, we need to mimic the calling client; to test the outgoing call, we need to mimic the service being called. In both cases, our challenge is how to do...