From 649b9c8ca822d6601d9191185ec702b0d251a9d3 Mon Sep 17 00:00:00 2001 From: Uwe Klinger Date: Wed, 9 Jun 2021 08:11:51 +0200 Subject: [PATCH] Test script added as requests --- README.md | 7 +++-- suppliers/requests.http | 58 +++++++++++++++++++++-------------------- 2 files changed, 33 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 42461ee1..ba71c072 100644 --- a/README.md +++ b/README.md @@ -85,13 +85,12 @@ In case you've a question, find a bug, or otherwise need support, use our [commu Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, version 2.0 except as noted otherwise in the [LICENSE](LICENSE.txt) file. -# Suppliers - in progress for Service Consumption - +# Suppliers - in progress for Messaging & Service Consumption - ## TODOs -1. Fix problem with `await S4bupa.read (Suppliers).where('ID in',IDs)` --> Johannes -2. Fix issues when running in same process -3. Automated tests +1. Fix issues when running in same process +2. Automated tests ## Usage diff --git a/suppliers/requests.http b/suppliers/requests.http index 8913944c..48ca0c1f 100644 --- a/suppliers/requests.http +++ b/suppliers/requests.http @@ -1,16 +1,41 @@ -@server = http://localhost:4004 +@server = http://localhost:4006 @bpServer = http://localhost:5001 @authAlice = Authorization: Basic alice: -PATCH {{server}}/api-business-partner/A_BusinessPartner('ACME') +### +### Replication on changed Business Partner +### + +### 1. Check supplier name before update ("A Company Making Everything") + +GET {{server}}/admin/Books(299)?$expand=supplier +{{authAlice}} + +### 2. Change Business Partner -> Triggers event that updates supplier replication + +PATCH {{bpServer}}/api-business-partner/A_BusinessPartner('ACME') Content-Type: application/json { - "BusinessPartnerFullName": "Alice Changed" + "BusinessPartnerFullName": "A Company Making Everything *better*" } +### 3. Check supplier name after update ("A Company Making Everything *better*") + +GET {{server}}/admin/Books(299)?$expand=supplier +{{authAlice}} + ### +### Replication on new assigned supplier +### + +### 1. No supplier is assigned to "Wuthering Heights" + +GET {{server}}/admin/Books(201)?$expand=supplier +{{authAlice}} + +### 2. Assign supplier ID "PNG" PATCH {{server}}/admin/Books(201) {{authAlice}} @@ -20,30 +45,7 @@ Content-Type: application/json "supplier_ID": "PNG" } -### +### 3. Supplier information is replicated -PATCH {{bpServer}}/api-business-partner/A_BusinessPartner('PNG') -Content-Type: application/json - -{ - "BusinessPartnerFullName": "Penguin Books (Changed)" -} - -### - -GET {{server}}/admin/Books?$top=11&$expand=supplier +GET {{server}}/admin/Books(201)?$expand=supplier {{authAlice}} - -@S4bupa = http://localhost:4006/api-business-partner - -################################################# -# -# Suppliers Service (-> S/4) -# - -PATCH {{S4bupa}}/A_BusinessPartner('ACME') -Content-Type: application/json - -{ "FirstName":"ACME" } - -###