Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

USE:

int4 IFTT allows testing the SAP PO REST/JSON interfaces for both synchronous and asynchronous scenarios. The procedures for these types of the interfaces are described in the relevant sections below.

Table of Contents

PI/PO Synchronous testing

Synchronous REST/JSON scenarios can be tested using PI E2E Synchronous test type.  The principle is also the same, int4 IFTT uses the request XML or JSON message to trigger the interface and then validates the XML or JSON response and the final document creation on the SAP backend (if there is such receiver and business need).

Info

PREREQUISITES:
You have completed the steps described in General rules for a test case creation.

PROCEDURE:

Creating a synchronous REST/JSON test case: 

  1. Select "PI Synchronous" Interface Type.

  2. Leave “Document Number” empty

  3. Save the test case.

Now the procedure differs depending of the type of REST operation/action as also the way how the interface works is different.

A) Operations that create a new resource or document like PUT or POST (the operation is defined in the configuration object). For such operation interface requires a payload (body) with request:

  1. Click the Content button of the created test case.

  2. In Content Selection pop-up window select content type to be displayed. In order to create a new test case Request xml has to be added. 

  3. Select xml editor... 

  4. past the request JSON or XML request payload:

  5. ...or upload from file

  6. Press Save icon still in the message editor after placing the content and press back.

  7. On next popup confirm that the payload should be stored:

  8. Now the int4 IFTT will place a call to tested service to collect response. This response payload will be a reference for further test case executions.

  9. If the call was successful user should receive confirmation status:

    otherwise the popup with errors will be displayed.

  10. Optionally you can review response payload by 'Content' button.

Info

Please note that the response of the service is collected automatically during test case creation by calling the service. If the sample request payload was already used and the interface requires unique values then you need to enrich them manually and provide unique identification numbers (like for example Purchase Order Number)

B) Operations that retrieve or delete records like GET or DELETE (the operation is part of used configuration object). In such case the request payload(body) is not needed, the parameters are passed in the URL when calling the service.

Example screenshots are from our sample JSON interface that returns material description based on material number provided in the URL.

The URL template is stored in configuration object. int4 IFTT variables will modify the endpoint and call service with proper parameters. One of the way of assigning values to variables is test case container.

  1. Select created test case and click 'container' button.

  2. Provide values that you will modify the URL:

  3. Now the int4 IFTT will place a call to tested service to collect response. This response payload will be a reference for further test case executions.

  4. If the call was successful user should receive confirmation status:

    otherwise the popup with errors will be displayed.

  5. Optionally you can review response payload by 'Content' button.

The example of execution of above interface:

Image RemovedImage Added

As you can see the service was called based on the parameter value set in the cockpit.


PI/PO Asynchronous testing

Asynchronous REST/JSON scenarios can be tested using PI GUID E2E Inbound test type. The procedure is similar to the standard one described in PI E2E GUID section, however in order to test properly asynchronous scenarios, some additional steps described below need to be followed.

PROCEDURE:

A. Automation Object creation

When creating Automation Object for asynchronous interface the following parameters (apart from the other settings that should be specified for a given scenario) in the additional parameters of Automation Object should be defined:

  • PI: Asynchronous: Direct HTTP URL - it is mandatory to select this parameter to test the asynchronous scenario using the PI GUID E2E Inbound IFTT interface type. Example definition below:

  • PI: Asynchronous: Direct HTTP operation - this parameter defines HTTP operation to be performed (if this parameter will be empty, then by default IFTT will perform POST operation). Example definition below:

To read more about these and other parameters please refer to the section Automation Object - Additional Parameters.

B. Test case creation

  1. Select "PI GUID E2E Inbound" Interface Type.

  2. Select Automation Object created according to the procedure described in section A above.

  3. Select the reference document number.

  4. Save the test case and then execute it.