To mock endpoints in SAP Cloud Integration/CPI you need to set up the Cloud Connector to point to the Figaf system.
If you deploy in SAP BTP there is no need to set up Cloud Connector because it is hosted on a public URL.
This guide helps you set it up the Cloud Connector to Figaf to your CPI system.
1) First you need to install the Cloud Connector. See the guide. You need to connect with the subaccount where your SAP CPI system is hosted.
2) Expose your internal Figaf Host with an external HostPort. You will need to expose all url Paths to it.
3) Now test you can create a connection and reach the Figaf system. It is best to a new Destination from your BTP Cockpit and see if you can reach the Figaf server.
4) In the configuration of the Figaf system you need to add the following configurations.
- irt.cloud-connector.url - the URL from the CPI to IRT. Usage: --irt.cloud-connector.url=http://<HOSTFROMCPI>:<PORT>/irt/api/cpi-testing-mock-data/step/. This property is used during testing with mock data on CPI systems.
- irt.cloud-connector.locationId - the location of the cloud connector. Usage: --irt.cloud-connector.locationId=<YOURLOCATION>. This property is used during testing with mock data on CPI systems.
- irt.cloud-connector.on-premise - If you want not to use Cloud Connector and the CPI has direct access to your Figaf system. Default is true so no need to configure it. Set it to false to skip Cloud Connector, and remember to configure the URL.
The host in the above example would then be http://sapserv02:8000/irt/api/cpi-testing-mock-data/step/
Now you should be able to run test cases that are Mocked by Figaf system. To make sure the test cases have all the information needed.
Notice you can only have one configuration to Figaf, but you will always be able to set up the same value into different sub-accounts.