Testing with Simulators
Last updated
Was this helpful?
Last updated
Was this helpful?
This page outlines the usage of Response Simulator by AA, FIU or FIP with entity APIs for the integration of Router. This Response Simulator will simulate the behaviour of the actual entity APIs to facilitate Sahamati router usage and testing.
The Response Simulator is designed to simulate the behaviour of real Entity’s Protocol APIs. It provides a controlled environment for developers to test and verify router service without relying on an actual entity.
The sample workflow diagram below illustrates the usage of the Response Simulator by including a simulated response with the expected response.
The following two details are required in the request to use the APIs with Response Simulator:
recipient-id: This is specified in the x-request-meta header through which the router that will route the request to the respective response simulator. The available options are,
AA-SIMULATOR
FIU-SIMULATOR and
FIP-SIMULATOR
x-simulate-res: This header should contain a hint for the expected response from the response simulator. It can be any of the options listed in the specific entity tables. If this is not included, the response simulator will default to returning a 200 OK response.
The FIP's Accounts/link/verify API is the only one that utilizes the OTP received from the customer. This API is responsible for submitting the token/OTP back to the FIP to complete the account linkage process. The Response Simulator is set up to accept a predefined list of OTPs for successful account linkage. If an OTP outside of this list is used, the account linkage will fail. This is the default behavior of the Response Simulator, functioning without the need for the x-simulate-res header.
1234
123456
654321
999999
223344
567890
456789
234567
345678
555444
222333
The sample workflow diagram below illustrates the usage of the valid OTP
The sample workflow diagram below illustrates the usage of the invalid OTP