Versions Compared

Key

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

USE:

int4 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.

...

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

Info

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

PROCEDURE:

Creating a synchronous REST/JSON test case: 

...

Now the procedure differs depending of on the type of REST operation/action as also the way and 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 a request:

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

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

  3. Select xml editor... 

  4. past the request JSON or XML request payload:

  5. ...or upload upload it from file

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

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

  8. Now the int4 Int4 IFTT will place a call to the tested service to collect a 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 Otherwise, the popup with errors will be displayed.

  10. [Optionally] you can review the response payload by clicking the 'Content' button.

Info

Please note that the service's 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 function is part of the used configuration object). In such case If 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 descriptions based on the material number provided in the URL.

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

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

  2. Provide values that you will modify the URL:

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

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

    otherwise

Otherwise, the popup with errors will be displayed.

5. [Optionally] you can review the response payload by clicking the 'Content' button.

The example of execution of the above interface:

...

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

...

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

...

When creating Automation Object for an 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 operation operation - this parameter defines HTTP operation to be performed (if . If this parameter will be is empty, then by default IFTT will perform POST operation). Example definition below:

...

To read more about these and other parameters please Please refer to the section Automation Object - Additional Parameters to read more about these and other 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.

...