From 934e90a6e696634c722ca3ae4d3e6682cdccdc22 Mon Sep 17 00:00:00 2001 From: Niklas Schulte Date: Wed, 9 Oct 2024 08:39:32 +0200 Subject: [PATCH] feat: add check for a non-empty body in Get cached EDRs --- .../postman/MVD.postman_collection.json | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/deployment/postman/MVD.postman_collection.json b/deployment/postman/MVD.postman_collection.json index fda48145..e3dcb33b 100644 --- a/deployment/postman/MVD.postman_collection.json +++ b/deployment/postman/MVD.postman_collection.json @@ -710,6 +710,25 @@ { "name": "Get cached EDRs", "event": [ + { + "listen": "test", + "script": { + "exec": [ + "response = pm.response.json();", + "pm.test('Body is not empty', () =>{", + " pm.expect(response.length).to.be.greaterThan(0);", + "})", + "", + "// get the transfer process id of \"asset-1\" and save it as an environment variable if the response body is not empty", + "if(pm.response.code < 300 && pm.response.code >= 200 && response.length > 0){", + " const transferProcessId = pm.response.json()[0][\"transferProcessId\"];", + " pm.environment.set(\"TRANSFER_PROCESS_ID\", transferProcessId);", + "}" + ], + "type": "text/javascript", + "packages": {} + } + }, { "listen": "test", "script": {