I’ll break this article into:
One great advantage of relying on git is that you can have the freedom to organize your git repository however you want. We thought that we usually struggle on regular interface development to have sample data to test our interfaces. What if we could stored these test data on git as part of our scenario and unit test it at the end of the day?
This is exactly what we've done!
Let's create a folder named Sample at same level as the "Preparation Steps" folder.
Then inside of the Sample folder we'll have key pair files of REQ (requests) and their respective RSP (responses)
This is a great way to test for regressions since our Jenkins pipeline is prepared to check for each of the dynamic interfaces deployed if there is a 'Samples' folder. If so, it calls the dynamic interface with each of the REQ files and asserts a match on the response to the respective RSP associated file. Whenever running via test automation, we skip the sending to any target. It's just Unit testing of all payload transformations.
Now let's try to manually test one of these files just to see it working. We can test requirement 3 which was one of the most complex that we've defined. Example of input
<?xml version="1.0" encoding="UTF-8"?>
<root>
<process>CreateBatch</process>
<region>EMEA</region>
<prod_date>20240730</prod_date> <!-- format of dates in S4 is yyyymmdd -->
<quantity>1000</quantity>
<batch>1</batch>
<batchplant>CH01</batchplant>
<material>12345678901</material>
<country>PT</country>
<!-- other fields not relevant for this demo -->
</root>
What shall we expect?
It's a CreateBatch process so we shall format the date into yyyy-MM-dd, its EMEA region so the quantity shall be formatted. Finally country is PT therefore quantity shall be doubled. From target perspective, final url should be https://testnupeemeabatch.free.beeceptor.com
And it worked!
In this chapter we covered how hard it is to find sample payload files for our tests and how cool would it be to test them automatically whenever they exist. On the final part we'll look into current limitations and future plans for this dynamic interface
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 22 | |
| 19 | |
| 13 | |
| 12 | |
| 11 | |
| 11 | |
| 11 | |
| 9 | |
| 8 | |
| 8 |