From c590fd5f7a8a0db90231d66bf3ecf1bffa7f1c63 Mon Sep 17 00:00:00 2001 From: --show-origin Date: Fri, 5 Jan 2024 05:21:03 -0800 Subject: [PATCH 01/10] feat: added postman collection for integration test --- .../Local Dev.postman_environment.json | 129 ++ local/postman/README.md | 15 + ...s-integration-test.postman_collection.json | 1299 +++++++++++++++++ 3 files changed, 1443 insertions(+) create mode 100644 local/postman/Local Dev.postman_environment.json create mode 100644 local/postman/README.md create mode 100644 local/postman/puris-integration-test.postman_collection.json diff --git a/local/postman/Local Dev.postman_environment.json b/local/postman/Local Dev.postman_environment.json new file mode 100644 index 00000000..f71f73ca --- /dev/null +++ b/local/postman/Local Dev.postman_environment.json @@ -0,0 +1,129 @@ +{ + "id": "59b7073c-ad98-434c-bea1-b6d7d45d735e", + "name": "Local Dev", + "values": [ + { + "key": "PROVIDER_EDC", + "value": "http://localhost:8181", + "type": "default", + "enabled": true + }, + { + "key": "PROVIDER_EDC_API_KEY", + "value": "", + "type": "default", + "enabled": true + }, + { + "key": "PROTOCOL_PATH", + "value": "api/v1/dsp", + "type": "default", + "enabled": true + }, + { + "key": "MANAGEMENT_PATH", + "value": "management", + "type": "default", + "enabled": true + }, + { + "key": "CONSUMER_EDC", + "value": "http://localhost:9181", + "type": "default", + "enabled": true + }, + { + "key": "CONSUMER_EDC_API_KEY", + "value": "", + "type": "default", + "enabled": true + }, + { + "key": "CONSUMER_BPN", + "value": "BPNL1234567890ZZ", + "type": "default", + "enabled": true + }, + { + "key": "PROVIDER_BPN", + "value": "BPNL4444444444XX", + "type": "default", + "enabled": true + }, + { + "key": "PROVIDER_EDC_EXT_HOSTNAME", + "value": "http://customer-control-plane:8184", + "type": "default", + "enabled": true + }, + { + "key": "PROVIDER_PURIS_BACKEND", + "value": "http://localhost:8081", + "type": "default", + "enabled": true + }, + { + "key": "PROVIDER_PURIS_API_KEY", + "value": "", + "type": "default", + "enabled": true + }, + { + "key": "PROVIDER_BPNS", + "value": "BPNS4444444444XX", + "type": "default", + "enabled": true + }, + { + "key": "PROVIDER_BPNA", + "value": "BPNA4444444444AA", + "type": "default", + "enabled": true + }, + { + "key": "CONSUMER_EDC_EXT_HOSTNAME", + "value": "http://supplier-control-plane:9184", + "type": "default", + "enabled": true + }, + { + "key": "CONSUMER_PURIS_BACKEND", + "value": "http://localhost:8082", + "type": "default", + "enabled": true + }, + { + "key": "CONSUMER_PURIS_API_KEY", + "value": "", + "type": "default", + "enabled": true + }, + { + "key": "CONSUMER_BPNS", + "value": "BPNS1234567890ZZ", + "type": "default", + "enabled": true + }, + { + "key": "CONSUMER_BPNA", + "value": "BPNA1234567890AA", + "type": "default", + "enabled": true + }, + { + "key": "CONSUMER_BPNS2", + "value": "BPNS2222222222SS", + "type": "default", + "enabled": true + }, + { + "key": "CONSUMER_BPNA2", + "value": "BPNA2222222222AA", + "type": "default", + "enabled": true + } + ], + "_postman_variable_scope": "environment", + "_postman_exported_at": "2024-01-05T12:40:05.194Z", + "_postman_exported_using": "Postman/10.21.11" +} \ No newline at end of file diff --git a/local/postman/README.md b/local/postman/README.md new file mode 100644 index 00000000..066b112d --- /dev/null +++ b/local/postman/README.md @@ -0,0 +1,15 @@ +# Running Integration Tests + +To run integration tests import the collection and the environment file to postman. +Follow the description on collection level to identify the secrets (API KEYS) you need to set in the environment +variables. + +The collection has two folders: +1. One folder to create a test setup and test most of the master data interfaces +2. One folder to test the created assets via catalog requests. + +It creates a setup of a partner and customer that refer to the same material from the other perspective: +- The customer has the material and a material stock +- The supplier has the product and a product stock +- Both partners know each other and each other's EDC +- The setup is ready to trigger the update from customer to supplier diff --git a/local/postman/puris-integration-test.postman_collection.json b/local/postman/puris-integration-test.postman_collection.json new file mode 100644 index 00000000..864c5f1d --- /dev/null +++ b/local/postman/puris-integration-test.postman_collection.json @@ -0,0 +1,1299 @@ +{ + "info": { + "_postman_id": "1b4626c9-01e5-42c1-a1de-d386572888df", + "name": "puris-integration-test", + "description": "The collection assumes the following roles:\n\n- Customer PURIS (upper tier) = Provider\n- Supplier PURIS (lower tier) = Consumer\n \n\nIt creates the opposite partner and the respective view on the semiconductor material or product.\n\nTo run the tests correctly, take the environment and fill the respective secrets:\n\n- PROVIDER_EDC_API_KEY\n \n- PROVIDER_PURIS_BACKEND_API_KEY\n \n- CONSUMER_EDC_API_KEY\n \n- CONSUMER_PURIS_BACKEND_API_KEY\n \n\nWhen using the another environment, update / create a new environment.", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "26605468" + }, + "item": [ + { + "name": "Test_01-MAD", + "item": [ + { + "name": "CustomerInit", + "item": [ + { + "name": "Create Semiconductor Material", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "})" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"materialFlag\": true,\n \"productFlag\": false,\n \"ownMaterialNumber\": \"{{MATERIAL_NUMBER_CUSTOMER}}\",\n \"materialNumberCx\": \"{{MATERIAL_NUMBER_CX}}\",\n \"name\": \"Semiconductor\"\n}" + }, + "url": { + "raw": "{{PROVIDER_PURIS_BACKEND}}/catena/materials", + "host": [ + "{{PROVIDER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "materials" + ] + } + }, + "response": [] + }, + { + "name": "Create Control Unit Product", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "})" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"materialFlag\": false,\n \"productFlag\": true,\n \"ownMaterialNumber\": \"MNR-4177-S\",\n \"materialNumberCx\": null,\n \"name\": \"central control unit\"\n}" + }, + "url": { + "raw": "{{PROVIDER_PURIS_BACKEND}}/catena/materials", + "host": [ + "{{PROVIDER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "materials" + ] + } + }, + "response": [] + }, + { + "name": "Get All Materials", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "})", + "", + "pm.test(\"Verify response contains two objects\", function () {", + " pm.expect(pm.response.json()).to.be.an(\"array\").with.lengthOf(2);", + "});", + "", + "pm.test(\"Verify ownMaterialNumber values\", function () {", + " var responseJson = pm.response.json();", + "", + " var foundValues = [];", + " ", + " responseJson.forEach(function (obj) {", + " pm.expect(obj).to.have.property(\"ownMaterialNumber\");", + " pm.expect(obj.ownMaterialNumber).to.be.oneOf([\"MNR-4177-S\", pm.collectionVariables.get(\"MATERIAL_NUMBER_CUSTOMER\")]);", + "", + " // Put found value into foundValues to ensure that each value is only found once", + " pm.expect(foundValues).to.not.include(obj.ownMaterialNumber);", + " foundValues.push(obj.ownMaterialNumber);", + " });", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{PROVIDER_PURIS_BACKEND}}/catena/materials/all", + "host": [ + "{{PROVIDER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "materials", + "all" + ] + } + }, + "response": [] + }, + { + "name": "Register Supplier Partner", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "})" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"NewPartner Inc.\",\n \"edcUrl\": \"{{PROVIDER_EDC_EXT_HOSTNAME}}/{{PROTOCOL_PATH}}\",\n \"bpnl\": \"{{CONSUMER_BPN}}\",\n \"addresses\": [],\n \"sites\": [\n {\n \"bpns\": \"{{CONSUMER_BPNS}}\",\n \"name\": \"New Partner Global Headquarter\",\n \"addresses\": [\n {\n \"bpna\": \"{{CONSUMER_BPNA}}\",\n \"streetAndNumber\": \"Wall Street 101\",\n \"zipCodeAndCity\": \"10001 New York\",\n \"country\": \"USA\"\n }\n ]\n }\n ]\n}" + }, + "url": { + "raw": "{{PROVIDER_PURIS_BACKEND}}/catena/partners", + "host": [ + "{{PROVIDER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "partners" + ] + } + }, + "response": [] + }, + { + "name": "Get Supplier Partner", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function () {", + " pm.response.to.have.status(200);", + "})", + "", + "pm.test(\"Verify parnter values (BPNL with one BPNS with one BPNA)\", function () {", + " var responseJson = pm.response.json();", + "", + " pm.expect(responseJson).to.have.property(\"bpnl\");", + " pm.expect(responseJson.bpnl).to.equal(pm.environment.get(\"CONSUMER_BPN\"));", + "", + " pm.expect(responseJson.sites).to.be.an(\"array\").with.lengthOf(1);", + "", + " var site = responseJson.sites[0];", + " pm.expect(site).to.have.property(\"bpns\", pm.environment.get(\"CONSUMER_BPNS\"));", + "", + " pm.expect(site.addresses).to.be.an(\"array\").with.lengthOf(1);", + "", + " var address = site.addresses[0];", + " pm.expect(address).to.have.property(\"bpna\", pm.environment.get(\"CONSUMER_BPNA\"));", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{PROVIDER_PURIS_BACKEND}}/catena/partners?partnerBpnl={{CONSUMER_BPN}}", + "host": [ + "{{PROVIDER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "partners" + ], + "query": [ + { + "key": "partnerBpnl", + "value": "{{CONSUMER_BPN}}" + } + ] + } + }, + "response": [] + }, + { + "name": "Add New Site to Supplier Partner", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "})", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\"bpns\": \"{{CONSUMER_BPNS2}}\",\n\"name\": \"NewPartner Inc. Secondary Site\",\n\"addresses\": [\n {\n \"bpna\": \"{{CONSUMER_BPNA2}}\",\n \"streetAndNumber\": \"Sunset Blvd. 345\",\n \"zipCodeAndCity\": \"90001 Los Angeles\",\n \"country\": \"USA\"\n }\n]\n}" + }, + "url": { + "raw": "{{PROVIDER_PURIS_BACKEND}}/catena/partners/putSite?partnerBpnl={{CONSUMER_BPN}}", + "host": [ + "{{PROVIDER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "partners", + "putSite" + ], + "query": [ + { + "key": "partnerBpnl", + "value": "{{CONSUMER_BPN}}" + } + ] + } + }, + "response": [] + }, + { + "name": "Get All Partners", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "})", + "", + "pm.test(\"Verify response contains two objects (puris owner, supplier partner)\", function () {", + " pm.expect(pm.response.json()).to.be.an(\"array\").with.lengthOf(2);", + "});", + "", + "pm.test(\"Verify supplier partner values (BPNL with one BPNS with one BPNA)\", function () {", + " const responseJson = pm.response.json();", + "", + " var supplierPartners = responseJson.filter(function (partner) {", + " return partner.bpnl === pm.environment.get(\"CONSUMER_BPN\");", + " });", + "", + " const supplierPartner = supplierPartners[0];", + " pm.expect(supplierPartner).to.have.property(\"bpnl\");", + "", + " pm.expect(supplierPartner.bpnl).to.equal(pm.environment.get(\"CONSUMER_BPN\"));", + "", + " pm.expect(supplierPartner.sites).to.be.an(\"array\").with.lengthOf(2);", + "", + " // check only the newly added site as the other one has been checked earlier", + " var sites = supplierPartner.sites.filter(function (site) {", + " return site.bpns === pm.environment.get(\"CONSUMER_BPNS2\");", + " });", + "", + " const site = sites[0];", + " pm.expect(site.addresses).to.be.an(\"array\").with.lengthOf(1);", + "", + " var address = site.addresses[0];", + " pm.expect(address).to.have.property(\"bpna\", pm.environment.get(\"CONSUMER_BPNA2\"));", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{PROVIDER_PURIS_BACKEND}}/catena/partners/all", + "host": [ + "{{PROVIDER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "partners", + "all" + ] + } + }, + "response": [] + }, + { + "name": "Create Material Partner Relation", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "})" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "url": { + "raw": "{{PROVIDER_PURIS_BACKEND}}/catena/materialpartnerrelations?partnerBpnl={{CONSUMER_BPN}}&ownMaterialNumber={{MATERIAL_NUMBER_CUSTOMER}}&partnerMaterialNumber={{MATERIAL_NUMBER_SUPPLIER}}&partnerSupplies=true&partnerBuys=false", + "host": [ + "{{PROVIDER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "materialpartnerrelations" + ], + "query": [ + { + "key": "partnerBpnl", + "value": "{{CONSUMER_BPN}}" + }, + { + "key": "ownMaterialNumber", + "value": "{{MATERIAL_NUMBER_CUSTOMER}}" + }, + { + "key": "partnerMaterialNumber", + "value": "{{MATERIAL_NUMBER_SUPPLIER}}" + }, + { + "key": "partnerSupplies", + "value": "true" + }, + { + "key": "partnerBuys", + "value": "false" + } + ] + } + }, + "response": [] + }, + { + "name": "Get Material Partner Mappings", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "})", + "", + "pm.test(\"Verify material partner mapping\", function () {", + " pm.response.to.have.jsonBody(pm.environment.get(\"CONSUMER_BPN\"), pm.collectionVariables.get(\"MATERIAL_NUMBER_SUPPLIER\"))", + " .and.have.jsonBody(pm.environment.get(\"PROVIDER_BPN\"), pm.collectionVariables.get(\"MATERIAL_NUMBER_CUSTOMER\"));", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{PROVIDER_PURIS_BACKEND}}/catena/stockView/materialnumbers-mapping?ownMaterialNumber={{MATERIAL_NUMBER_CUSTOMER}}", + "host": [ + "{{PROVIDER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "stockView", + "materialnumbers-mapping" + ], + "query": [ + { + "key": "ownMaterialNumber", + "value": "{{MATERIAL_NUMBER_CUSTOMER}}" + } + ] + } + }, + "response": [] + }, + { + "name": "Get Own Sites", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "})", + "", + "pm.test(\"Verify own site values (one BPNS with one BPNA)\", function () {", + " const responseJson = pm.response.json();", + "", + " const sites = responseJson.filter(function (site) {", + " return site.bpns === pm.environment.get(\"PROVIDER_BPNS\");", + " });", + "", + " const site = sites[0];", + " pm.expect(site.addresses).to.be.an(\"array\").with.lengthOf(1);", + "", + " const address = site.addresses[0];", + " pm.expect(address).to.have.property(\"bpna\", pm.environment.get(\"PROVIDER_BPNA\"));", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{PROVIDER_PURIS_BACKEND}}/catena/partners/ownSites", + "host": [ + "{{PROVIDER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "partners", + "ownSites" + ] + } + }, + "response": [] + }, + { + "name": "Create Semiconductor Material Stock Customer", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Verify stock composition (material number with BPNS, BPNA and Partner BPNL)\", function () {", + " var responseJson = pm.response.json();", + "", + " pm.expect(responseJson).to.have.property(\"material\");", + " pm.expect(responseJson.material).to.have.property(\"materialNumberCustomer\");", + " pm.expect(responseJson.material.materialNumberCustomer).to.equal(pm.collectionVariables.get(\"MATERIAL_NUMBER_CUSTOMER\"));", + "", + " pm.expect(responseJson).to.have.property(\"stockLocationBpns\");", + " pm.expect(responseJson.stockLocationBpns).to.equal(pm.environment.get(\"PROVIDER_BPNS\"));", + "", + " pm.expect(responseJson).to.have.property(\"stockLocationBpna\");", + " pm.expect(responseJson.stockLocationBpna).to.equal(pm.environment.get(\"PROVIDER_BPNA\"));", + "", + " pm.expect(responseJson).to.have.property(\"partner\");", + " pm.expect(responseJson.partner).to.have.property(\"bpnl\");", + " pm.expect(responseJson.partner.bpnl).to.equal(pm.environment.get(\"CONSUMER_BPN\"));", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"material\": {\n \"materialFlag\": true,\n \"productFlag\": false,\n \"materialNumberCustomer\": \"{{MATERIAL_NUMBER_CUSTOMER}}\",\n \"materialNumberCx\": \"{{MATERIAL_NUMBER_CX}}\",\n \"name\": \"Semiconductor\"\n },\n \"quantity\": 5.0,\n \"measurementUnit\": \"unit:piece\",\n \"stockLocationBpns\": \"{{PROVIDER_BPNS}}\",\n \"stockLocationBpna\": \"{{PROVIDER_BPNA}}\",\n \"type\": \"MATERIAL\",\n \"lastUpdatedOn\": \"2023-12-18T13:12:48.466+00:00\",\n \"isBlocked\": true,\n \"customerOrderNumber\": \"\",\n \"customerOrderPositionNumber\": \"\",\n \"supplierOrderNumber\": \"\",\n \"partner\":{\n \"bpnl\": \"{{CONSUMER_BPN}}\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{PROVIDER_PURIS_BACKEND}}/catena/stockView/material-stocks", + "host": [ + "{{PROVIDER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "stockView", + "material-stocks" + ] + } + }, + "response": [] + }, + { + "name": "Get Semiconductor Material Stock Customer", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Verify response contains one stock\", function () {", + " pm.expect(pm.response.json()).to.be.an(\"array\").with.lengthOf(1);", + "});" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"material\": {\n \"materialFlag\": true,\n \"productFlag\": false,\n \"materialNumberCustomer\": \"{{MATERIAL_NUMBER_CUSTOMER}}\",\n \"materialNumberCx\": \"{{MATERIAL_NUMBER_CX}}\",\n \"name\": \"Semiconductor\"\n },\n \"quantity\": 5.0,\n \"measurementUnit\": \"unit:piece\",\n \"stockLocationBpns\": \"{{PROVIDER_BPNS}}\",\n \"stockLocationBpna\": \"{{PROVIDER_BPNA}}\",\n \"type\": \"MATERIAL\",\n \"lastUpdatedOn\": \"2023-12-18T13:12:48.466+00:00\",\n \"isBlocked\": true,\n \"customerOrderNumber\": \"\",\n \"customerOrderPositionNumber\": \"\",\n \"supplierOrderNumber\": \"\",\n \"partner\":{\n \"bpnl\": \"{{CONSUMER_BPN}}\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{PROVIDER_PURIS_BACKEND}}/catena/stockView/material-stocks", + "host": [ + "{{PROVIDER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "stockView", + "material-stocks" + ] + } + }, + "response": [] + } + ], + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{PROVIDER_PURIS_API_KEY}}", + "type": "string" + }, + { + "key": "key", + "value": "X-API-KEY", + "type": "string" + } + ] + }, + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "SupplierInit", + "item": [ + { + "name": "Create Semiconductor Product", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "})" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"materialFlag\": false,\n \"productFlag\": true,\n \"ownMaterialNumber\": \"{{MATERIAL_NUMBER_SUPPLIER}}\",\n \"materialNumberCx\": \"{{MATERIAL_NUMBER_CX}}\",\n \"name\": \"Semiconductor\"\n}" + }, + "url": { + "raw": "{{CONSUMER_PURIS_BACKEND}}/catena/materials", + "host": [ + "{{CONSUMER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "materials" + ] + } + }, + "response": [] + }, + { + "name": "Get All Materials", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "})", + "", + "pm.test(\"Verify response contains one material objects\", function () {", + " pm.expect(pm.response.json()).to.be.an(\"array\").with.lengthOf(1);", + "});", + "", + "pm.test(\"Verify ownMaterialNumber values\", function () {", + " const materialStock = pm.response.json()[0];", + "", + " pm.expect(materialStock).to.have.property(\"ownMaterialNumber\");", + " pm.expect(materialStock.ownMaterialNumber).to.equal(pm.collectionVariables.get(\"MATERIAL_NUMBER_SUPPLIER\"));", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{CONSUMER_PURIS_BACKEND}}/catena/materials/all", + "host": [ + "{{CONSUMER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "materials", + "all" + ] + } + }, + "response": [] + }, + { + "name": "Register Customer Partner", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "})" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"Control Unit Creator Inc.\",\n \"edcUrl\": \"{{PROVIDER_EDC_EXT_HOSTNAME}}/{{PROTOCOL_PATH}}\",\n \"bpnl\": \"{{PROVIDER_BPN}}\",\n \"addresses\": [],\n \"sites\": [\n {\n \"bpns\": \"{{PROVIDER_BPNS}}\",\n \"name\": \"Control Unit Creator Headquarter\",\n \"addresses\": [\n {\n \"bpna\": \"{{PROVIDER_BPNA}}\",\n \"streetAndNumber\": \"13th Street 47\",\n \"zipCodeAndCity\": \"10011 New York\",\n \"country\": \"USA\"\n }\n ]\n }\n ]\n}" + }, + "url": { + "raw": "{{CONSUMER_PURIS_BACKEND}}/catena/partners", + "host": [ + "{{CONSUMER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "partners" + ] + } + }, + "response": [] + }, + { + "name": "Get Customer Partner", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function () {", + " pm.response.to.have.status(200);", + "})", + "", + "pm.test(\"Verify parnter values (BPNL with one BPNS with one BPNA)\", function () {", + " var responseJson = pm.response.json();", + "", + " pm.expect(responseJson).to.have.property(\"bpnl\");", + " pm.expect(responseJson.bpnl).to.equal(pm.environment.get(\"PROVIDER_BPN\"));", + "", + " pm.expect(responseJson.sites).to.be.an(\"array\").with.lengthOf(1);", + "", + " var site = responseJson.sites[0];", + " pm.expect(site).to.have.property(\"bpns\", pm.environment.get(\"PROVIDER_BPNS\"));", + "", + " pm.expect(site.addresses).to.be.an(\"array\").with.lengthOf(1);", + "", + " var address = site.addresses[0];", + " pm.expect(address).to.have.property(\"bpna\", pm.environment.get(\"PROVIDER_BPNA\"));", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{CONSUMER_PURIS_BACKEND}}/catena/partners?partnerBpnl={{PROVIDER_BPN}}", + "host": [ + "{{CONSUMER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "partners" + ], + "query": [ + { + "key": "partnerBpnl", + "value": "{{PROVIDER_BPN}}" + } + ] + } + }, + "response": [] + }, + { + "name": "Create Material Partner Relation", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "})" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "url": { + "raw": "{{CONSUMER_PURIS_BACKEND}}/catena/materialpartnerrelations?partnerBpnl={{PROVIDER_BPN}}&ownMaterialNumber={{MATERIAL_NUMBER_SUPPLIER}}&partnerMaterialNumber={{MATERIAL_NUMBER_CUSTOMER}}&partnerSupplies=false&partnerBuys=true", + "host": [ + "{{CONSUMER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "materialpartnerrelations" + ], + "query": [ + { + "key": "partnerBpnl", + "value": "{{PROVIDER_BPN}}" + }, + { + "key": "ownMaterialNumber", + "value": "{{MATERIAL_NUMBER_SUPPLIER}}" + }, + { + "key": "partnerMaterialNumber", + "value": "{{MATERIAL_NUMBER_CUSTOMER}}" + }, + { + "key": "partnerSupplies", + "value": "false" + }, + { + "key": "partnerBuys", + "value": "true" + } + ] + } + }, + "response": [] + }, + { + "name": "Get Material Partner Mappings", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "})", + "", + "pm.test(\"Verify material partner mapping\", function () {", + " pm.response.to.have.jsonBody(pm.environment.get(\"CONSUMER_BPN\"), pm.collectionVariables.get(\"MATERIAL_NUMBER_SUPPLIER\"))", + " .and.have.jsonBody(pm.environment.get(\"PROVIDER_BPN\"), pm.collectionVariables.get(\"MATERIAL_NUMBER_CUSTOMER\"));", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{CONSUMER_PURIS_BACKEND}}/catena/stockView/materialnumbers-mapping?ownMaterialNumber={{MATERIAL_NUMBER_SUPPLIER}}", + "host": [ + "{{CONSUMER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "stockView", + "materialnumbers-mapping" + ], + "query": [ + { + "key": "ownMaterialNumber", + "value": "{{MATERIAL_NUMBER_SUPPLIER}}" + } + ] + } + }, + "response": [] + }, + { + "name": "Get Own Sites", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "})", + "", + "pm.test(\"Verify own site values (one BPNS with one BPNA)\", function () {", + " const responseJson = pm.response.json();", + "", + " const sites = responseJson.filter(function (site) {", + " return site.bpns === pm.environment.get(\"PROVIDER_BPNS\");", + " });", + "", + " const site = sites[0];", + " pm.expect(site.addresses).to.be.an(\"array\").with.lengthOf(1);", + "", + " const address = site.addresses[0];", + " pm.expect(address).to.have.property(\"bpna\", pm.environment.get(\"PROVIDER_BPNA\"));", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{PROVIDER_PURIS_BACKEND}}/catena/partners/ownSites", + "host": [ + "{{PROVIDER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "partners", + "ownSites" + ] + } + }, + "response": [] + }, + { + "name": "Create Semiconductor Product Stock Supplier", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "})" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"material\": {\n \"materialFlag\": false,\n \"productFlag\": true,\n \"materialNumberCustomer\": \"{{MATERIAL_NUMBER_CUSTOMER}}\",\n \"materialNumberSupplier\": \"{{MATERIAL_NUMBER_SUPPLIER}}\",\n \"materialNumberCx\": \"{{MATERIAL_NUMBER_CX}}\",\n \"name\": \"Semiconductor\"\n },\n \"quantity\": 5.0,\n \"measurementUnit\": \"unit:piece\",\n \"stockLocationBpns\": \"{{CONSUMER_BPNS}}\",\n \"stockLocationBpna\": \"{{CONSUMER_BPNA}}\",\n \"type\": \"PRODUCT\",\n \"lastUpdatedOn\": \"2023-12-18T14:12:48.466+00:00\",\n \"isBlocked\": false,\n \"customerOrderNumber\": \"\",\n \"customerOrderPositionNumber\": \"\",\n \"supplierOrderNumber\": \"\",\n \"partner\":{\n \"bpnl\": \"{{PROVIDER_BPN}}\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{CONSUMER_PURIS_BACKEND}}/catena/stockView/product-stocks", + "host": [ + "{{CONSUMER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "stockView", + "product-stocks" + ] + } + }, + "response": [] + }, + { + "name": "Get Semiconductor Product Stocks (Supplier)", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Verify response contains one material objects\", function () {", + " pm.expect(pm.response.json()).to.be.an(\"array\").with.lengthOf(1);", + "});", + "", + "pm.test(\"Verify stock composition (material number with BPNS, BPNA and Partner BPNL)\", function () {", + " const stock = pm.response.json()[0];", + "", + " pm.expect(stock).to.have.property(\"material\");", + " pm.expect(stock.material).to.have.property(\"materialNumberCustomer\");", + " pm.expect(stock.material.materialNumberSupplier).to.equal(pm.collectionVariables.get(\"MATERIAL_NUMBER_SUPPLIER\"));", + "", + " pm.expect(stock).to.have.property(\"stockLocationBpns\");", + " pm.expect(stock.stockLocationBpns).to.equal(pm.environment.get(\"CONSUMER_BPNS\"));", + "", + " pm.expect(stock).to.have.property(\"stockLocationBpna\");", + " pm.expect(stock.stockLocationBpna).to.equal(pm.environment.get(\"CONSUMER_BPNA\"));", + "", + " pm.expect(stock).to.have.property(\"partner\");", + " pm.expect(stock.partner).to.have.property(\"bpnl\");", + " pm.expect(stock.partner.bpnl).to.equal(pm.environment.get(\"PROVIDER_BPN\"));", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "", + "value": "", + "type": "text" + } + ], + "url": { + "raw": "{{CONSUMER_PURIS_BACKEND}}/catena/stockView/product-stocks", + "host": [ + "{{CONSUMER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "stockView", + "product-stocks" + ] + } + }, + "response": [] + } + ], + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{CONSUMER_PURIS_API_KEY}}", + "type": "string" + }, + { + "key": "key", + "value": "X-API-KEY", + "type": "string" + } + ] + }, + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + } + ] + }, + { + "name": "Test_02-EDC", + "item": [ + { + "name": "Query Catalog for request offer as Customer from Supplier", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Verify response contains one data offer\", function () {", + " console.info(pm.response.json());", + " console.info(pm.response.json()['dcat:dataset']);", + " pm.expect(pm.response.json()['dcat:dataset']).to.be.an(\"object\");", + "});", + "", + "pm.test(\"Verify that offer matches search criteria (dct:type, cx-common:version)\", function () {", + " const contractOffer = pm.response.json()['dcat:dataset'];", + "", + " pm.expect(contractOffer).to.exist;", + "", + " pm.expect(contractOffer[\"https://w3id.org/catenax/ontology/common#version\"]).to.equal(\"1.0\");", + " pm.expect(contractOffer[\"dct:type\"][\"@id\"]).to.equal(\"https://w3id.org/catenax/taxonomy#ItemStockRequestApi\"); ", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"@context\": {},\r\n \"@type\": \"CatalogRequest\",\r\n \"protocol\": \"dataspace-protocol-http\",\r\n \"counterPartyAddress\": \"{{PROVIDER_EDC_EXT_HOSTNAME}}/{{PROTOCOL_PATH}}\",\r\n \"querySpec\": {\r\n \"offset\": 0,\r\n \"limit\": 100,\r\n \"filter\": \"\",\r\n \"range\": {\r\n \"from\": 0,\r\n \"to\": 100\r\n },\r\n \"filterExpression\": [\r\n {\r\n \"@type\" : \"CriterionDto\",\r\n \"operandLeft\": \"asset:prop:type\",\r\n \"operator\": \"=\",\r\n \"operandRight\": \"data.res.itemStockRequestApi\"\r\n },\r\n {\r\n \"@type\" : \"CriterionDto\",\r\n \"operandLeft\": \"https://w3id.org/catenax/ontology/common#version\",\r\n \"operator\": \"=\",\r\n \"operandRight\": \"1.0\"\r\n }\r\n ]\r\n }\r\n}\r\n", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{CONSUMER_EDC}}/{{MANAGEMENT_PATH}}/v2/catalog/request", + "host": [ + "{{CONSUMER_EDC}}" + ], + "path": [ + "{{MANAGEMENT_PATH}}", + "v2", + "catalog", + "request" + ] + } + }, + "response": [] + }, + { + "name": "Query Catalog for response offer as Customer from Supplier", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Verify response contains one data offer\", function () {", + " console.info(pm.response.json());", + " console.info(pm.response.json()['dcat:dataset']);", + " pm.expect(pm.response.json()['dcat:dataset']).to.be.an(\"object\");", + "});", + "", + "pm.test(\"Verify that offer matches search criteria (dct:type, cx-common:version)\", function () {", + " const contractOffer = pm.response.json()['dcat:dataset'];", + "", + " pm.expect(contractOffer).to.exist;", + "", + " pm.expect(contractOffer[\"https://w3id.org/catenax/ontology/common#version\"]).to.equal(\"1.0\");", + " pm.expect(contractOffer[\"dct:type\"][\"@id\"]).to.equal(\"https://w3id.org/catenax/taxonomy#ItemStockResponseApi\"); ", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"@context\": {},\r\n \"@type\": \"CatalogRequest\",\r\n \"protocol\": \"dataspace-protocol-http\",\r\n \"counterPartyAddress\": \"{{PROVIDER_EDC_EXT_HOSTNAME}}/{{PROTOCOL_PATH}}\",\r\n \"querySpec\": {\r\n \"offset\": 0,\r\n \"limit\": 100,\r\n \"filter\": \"\",\r\n \"range\": {\r\n \"from\": 0,\r\n \"to\": 100\r\n },\r\n \"filterExpression\": [\r\n {\r\n \"@type\" : \"CriterionDto\",\r\n \"operandLeft\": \"asset:prop:type\",\r\n \"operator\": \"=\",\r\n \"operandRight\": \"data.res.itemStockResponseApi\"\r\n },\r\n {\r\n \"@type\" : \"CriterionDto\",\r\n \"operandLeft\": \"https://w3id.org/catenax/ontology/common#version\",\r\n \"operator\": \"=\",\r\n \"operandRight\": \"1.0\" \r\n }\r\n ]\r\n }\r\n}\r\n", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{CONSUMER_EDC}}/{{MANAGEMENT_PATH}}/v2/catalog/request", + "host": [ + "{{CONSUMER_EDC}}" + ], + "path": [ + "{{MANAGEMENT_PATH}}", + "v2", + "catalog", + "request" + ] + } + }, + "response": [] + } + ], + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{CONSUMER_EDC_API_KEY}}", + "type": "string" + }, + { + "key": "key", + "value": "X-Api-Key", + "type": "string" + } + ] + }, + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ], + "variable": [ + { + "key": "MATERIAL_NUMBER_CUSTOMER", + "value": "MNR-7307-AU340474.002", + "type": "string" + }, + { + "key": "MATERIAL_NUMBER_SUPPLIER", + "value": "MNR-8101-ID146955.001", + "type": "string" + }, + { + "key": "MATERIAL_NUMBER_CX", + "value": "860fb504-b884-4009-9313-c6fb6cdc776b", + "type": "string" + } + ] +} \ No newline at end of file From 4c423674135df54a2039b19fae623738160475d7 Mon Sep 17 00:00:00 2001 From: --show-origin Date: Fri, 5 Jan 2024 05:33:21 -0800 Subject: [PATCH 02/10] docs: enhanced integration test documentation how to --- local/postman/README.md | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/local/postman/README.md b/local/postman/README.md index 066b112d..b57835b9 100644 --- a/local/postman/README.md +++ b/local/postman/README.md @@ -1,9 +1,5 @@ # Running Integration Tests -To run integration tests import the collection and the environment file to postman. -Follow the description on collection level to identify the secrets (API KEYS) you need to set in the environment -variables. - The collection has two folders: 1. One folder to create a test setup and test most of the master data interfaces 2. One folder to test the created assets via catalog requests. @@ -13,3 +9,23 @@ It creates a setup of a partner and customer that refer to the same material fro - The supplier has the product and a product stock - Both partners know each other and each other's EDC - The setup is ready to trigger the update from customer to supplier + +## Preparations +To run integration tests import the collection and the environment file to postman. +Follow the description on collection level to identify the secrets (API KEYS) you need to set in the environment +variables. The keys are defined on folder level. + +One can use the local deployment to run the integration test locally. Follow the instructions in the +[INSTALL.md](../INSTALL.md) until the the keys are generated. +- The api keys needed by the environment can be copied from the [environment file](../.env) that is generated by the + [generate-keys.sh](../generate-keys.sh) script. +- Adjust the properties file to run without `puris.demonstrator.role`. Find the properties files for the puris backend +of the [customer](../tractus-x-edc/config/customer/puris-backend.properties) and of the [supplier](../tractus-x-edc/config/supplier/puris-backend.properties) to set the property +`puris.demonstrator.role` to empty value. + +Same settings should be used for other environments. But you also need to update other variables accordingly in the +environment file. + +## Run the integration test + +You can run the integration tests on per folder level using right click > run folder. From ac0a31e3cc2246ca8528dfa4a7cd1e4169487a92 Mon Sep 17 00:00:00 2001 From: --show-origin Date: Fri, 5 Jan 2024 05:46:49 -0800 Subject: [PATCH 03/10] docs: fixed typo --- local/postman/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/local/postman/README.md b/local/postman/README.md index b57835b9..09b6205b 100644 --- a/local/postman/README.md +++ b/local/postman/README.md @@ -16,7 +16,7 @@ Follow the description on collection level to identify the secrets (API KEYS) yo variables. The keys are defined on folder level. One can use the local deployment to run the integration test locally. Follow the instructions in the -[INSTALL.md](../INSTALL.md) until the the keys are generated. +[INSTALL.md](../INSTALL.md) until the keys are generated. - The api keys needed by the environment can be copied from the [environment file](../.env) that is generated by the [generate-keys.sh](../generate-keys.sh) script. - Adjust the properties file to run without `puris.demonstrator.role`. Find the properties files for the puris backend From 137480c8c1a619dd67182160e09c6e1668f781a2 Mon Sep 17 00:00:00 2001 From: --show-origin Date: Fri, 12 Jan 2024 10:28:38 -0800 Subject: [PATCH 04/10] refactor(postman): renamed provider and consumer to customer and supplier - added documentation of test data --- .../Local Dev.postman_environment.json | 72 +++---- local/postman/README.md | 106 ++++++++++- ...s-integration-test.postman_collection.json | 178 +++++++++--------- 3 files changed, 229 insertions(+), 127 deletions(-) diff --git a/local/postman/Local Dev.postman_environment.json b/local/postman/Local Dev.postman_environment.json index f71f73ca..bc58b64f 100644 --- a/local/postman/Local Dev.postman_environment.json +++ b/local/postman/Local Dev.postman_environment.json @@ -1,19 +1,37 @@ { - "id": "59b7073c-ad98-434c-bea1-b6d7d45d735e", + "id": "c99bfe48-fce6-47f2-8f4b-98a64f9dbecc", "name": "Local Dev", "values": [ { - "key": "PROVIDER_EDC", - "value": "http://localhost:8181", + "key": "CUSTOMER_PURIS_BACKEND_API_KEY", + "value": "", + "type": "default", + "enabled": true + }, + { + "key": "SUPPLIER_EDC_API_KEY", + "value": "", + "type": "default", + "enabled": true + }, + { + "key": "SUPPLIER_PURIS_BACKEND_API_KEY", + "value": "", "type": "default", "enabled": true }, { - "key": "PROVIDER_EDC_API_KEY", + "key": "SUPPLIER_PURIS_API_KEY", "value": "", "type": "default", "enabled": true }, + { + "key": "CUSTOMER_EDC", + "value": "http://localhost:8181", + "type": "default", + "enabled": true + }, { "key": "PROTOCOL_PATH", "value": "api/v1/dsp", @@ -27,103 +45,85 @@ "enabled": true }, { - "key": "CONSUMER_EDC", + "key": "SUPPLIER_EDC", "value": "http://localhost:9181", "type": "default", "enabled": true }, { - "key": "CONSUMER_EDC_API_KEY", - "value": "", - "type": "default", - "enabled": true - }, - { - "key": "CONSUMER_BPN", + "key": "SUPPLIER_BPNL", "value": "BPNL1234567890ZZ", "type": "default", "enabled": true }, { - "key": "PROVIDER_BPN", + "key": "CUSTOMER_BPNL", "value": "BPNL4444444444XX", "type": "default", "enabled": true }, { - "key": "PROVIDER_EDC_EXT_HOSTNAME", + "key": "CUSTOMER_EDC_EXT_HOSTNAME", "value": "http://customer-control-plane:8184", "type": "default", "enabled": true }, { - "key": "PROVIDER_PURIS_BACKEND", + "key": "CUSTOMER_PURIS_BACKEND", "value": "http://localhost:8081", "type": "default", "enabled": true }, { - "key": "PROVIDER_PURIS_API_KEY", - "value": "", - "type": "default", - "enabled": true - }, - { - "key": "PROVIDER_BPNS", + "key": "CUSTOMER_BPNS", "value": "BPNS4444444444XX", "type": "default", "enabled": true }, { - "key": "PROVIDER_BPNA", + "key": "CUSTOMER_BPNA", "value": "BPNA4444444444AA", "type": "default", "enabled": true }, { - "key": "CONSUMER_EDC_EXT_HOSTNAME", + "key": "SUPPLIER_EDC_EXT_HOSTNAME", "value": "http://supplier-control-plane:9184", "type": "default", "enabled": true }, { - "key": "CONSUMER_PURIS_BACKEND", + "key": "SUPPLIER_PURIS_BACKEND", "value": "http://localhost:8082", "type": "default", "enabled": true }, { - "key": "CONSUMER_PURIS_API_KEY", - "value": "", - "type": "default", - "enabled": true - }, - { - "key": "CONSUMER_BPNS", + "key": "SUPPLIER_BPNS", "value": "BPNS1234567890ZZ", "type": "default", "enabled": true }, { - "key": "CONSUMER_BPNA", + "key": "SUPPLIER_BPNA", "value": "BPNA1234567890AA", "type": "default", "enabled": true }, { - "key": "CONSUMER_BPNS2", + "key": "SUPPLIER_BPNS2", "value": "BPNS2222222222SS", "type": "default", "enabled": true }, { - "key": "CONSUMER_BPNA2", + "key": "SUPPLIER_BPNA2", "value": "BPNA2222222222AA", "type": "default", "enabled": true } ], "_postman_variable_scope": "environment", - "_postman_exported_at": "2024-01-05T12:40:05.194Z", + "_postman_exported_at": "2024-01-12T18:25:43.497Z", "_postman_exported_using": "Postman/10.21.11" } \ No newline at end of file diff --git a/local/postman/README.md b/local/postman/README.md index 09b6205b..fd96d824 100644 --- a/local/postman/README.md +++ b/local/postman/README.md @@ -10,10 +10,112 @@ It creates a setup of a partner and customer that refer to the same material fro - Both partners know each other and each other's EDC - The setup is ready to trigger the update from customer to supplier +## Test Data + +The following lists give an overview about the test data in use. When setting up the data, please consider that the +relevant information is the following: +- Material Numbers (Customer, Supplier, Catena-X) +- Partner and Site information (BPNL, BPNS, BPNA) +Note: BPN information depends highly on your environment. + +Items (Material or Product) involved: +- Semiconductor + - Name: Semiconductor + - Material Number Customer: MNR-7307-AU340474.002 + - Material Number Supplier: MNR-8101-ID146955.001 + - Material Number Catena-X: 860fb504-b884-4009-9313-c6fb6cdc776b +- Control Unit + - Name: Central Control Unit + - Material Number Customer: MNR-4177-C + - Material Number Supplier: MNR-4177-S + - Material Number Catena-X: none + +### Customer +Overall the customer has the following information: +- BPNL: BPNL4444444444XX +- Name: Control Unit Creator Inc. +- Site + - BPNS: BPNS4444444444XX + - Site Name: Control Unit Creator Production Site + - Site Address: + - BPNA: BPNA4444444444AA + - Street and Number: 13th Street 47 + - Zip Code, City: 10011 New York + - Country: USA +- Materials available: Semiconductor +- Products available: Control Unit + - Material Stock 1: + - Partner: Semiconductor Supplier (BPNL1234567890ZZ) + - Material: Semiconductor + - Quantity: 500 pieces + - Blocked: true + - Order Position Reference: + - Customer Order Number: CNbr-1 + - Customer Order Position Number: C-Pos-1 + - Supplier Order Number: SNbr-1 + - Reported Material Stock 1: + - Partner: Semiconductor Supplier (BPNL1234567890ZZ) + - Material: Semiconductor + - Quantity: 100 pieces + - Blocked: true + - Order Position Reference: empty + +### Supplier +Overall the supplier has the following information: +- BPNL: BPNL1234567890ZZ +- Name: Semiconductor Supplier Inc. +- Site 1 + - BPNS: BPNS1234567890ZZ + - Site Name: Semiconductor Supplier Inc. Production Site + - Site Address: + - BPNA: BPNA1234567890AA + - Street and Number: Wall Street 101 + - Zip Code, City: 10001 New York + - Country: USA +- Site 2 + - BPNS: BPNS2222222222SS + - Site Name: Semiconductor Supplier Inc. Secondary Site + - Site Address: + - BPNA: BPNA2222222222AA + - Street and Number: Sunset Blvd. 345 + - Zip Code, City: 90001 Los Angeles + - Country: USA +- Materials available: none +- Products available: Semiconductor +- Stocks + - Product Stock 1: + - Partner: Control Unit Creator Inc. (BPNL4444444444XX) + - Material: Semiconductor + - Quantity: 100 pieces + - Blocked: true + - Order Position Reference: + - Customer Order Number: CNbr-2 + - Customer Order Position Number: C-Pos-2 + - Supplier Order Number: SNbr-2 + - Product Stock 2: + - Partner: Control Unit Creator Inc. (BPNL4444444444XX) + - Material: Semiconductor + - Quantity: 400 pieces + - Blocked: false + - Order Position Reference: + - Customer Order Number: CNbr-2 + - Customer Order Position Number: C-Pos-2 + - Supplier Order Number: SNbr-2 + - Reported Product Stock 1: + - Partner: Control Unit Creator Inc. (BPNL4444444444XX) + - Material: Semiconductor + - Quantity: 500 pieces + - Blocked: true + - Order Position Reference: + - Customer Order Number: CNbr-1 + - Customer Order Position Number: C-Pos-1 + - Supplier Order Number: SNbr-1 + ## Preparations + To run integration tests import the collection and the environment file to postman. -Follow the description on collection level to identify the secrets (API KEYS) you need to set in the environment -variables. The keys are defined on folder level. +The environment files has empty fields for the respective key information. The keys are set via environment variables +on folder level. One can use the local deployment to run the integration test locally. Follow the instructions in the [INSTALL.md](../INSTALL.md) until the keys are generated. diff --git a/local/postman/puris-integration-test.postman_collection.json b/local/postman/puris-integration-test.postman_collection.json index 864c5f1d..bf49f419 100644 --- a/local/postman/puris-integration-test.postman_collection.json +++ b/local/postman/puris-integration-test.postman_collection.json @@ -1,8 +1,8 @@ { "info": { - "_postman_id": "1b4626c9-01e5-42c1-a1de-d386572888df", + "_postman_id": "08da5aef-cb4d-46ea-a2e1-a1d47e73c97a", "name": "puris-integration-test", - "description": "The collection assumes the following roles:\n\n- Customer PURIS (upper tier) = Provider\n- Supplier PURIS (lower tier) = Consumer\n \n\nIt creates the opposite partner and the respective view on the semiconductor material or product.\n\nTo run the tests correctly, take the environment and fill the respective secrets:\n\n- PROVIDER_EDC_API_KEY\n \n- PROVIDER_PURIS_BACKEND_API_KEY\n \n- CONSUMER_EDC_API_KEY\n \n- CONSUMER_PURIS_BACKEND_API_KEY\n \n\nWhen using the another environment, update / create a new environment.", + "description": "The collection assumes the following roles:\n\n- Customer PURIS (upper tier)\n \n- Supplier PURIS (lower tier)\n \n\nIt creates the opposite partner and the respective view on the semiconductor material or product.\n\nTo run the tests correctly, take the environment and fill the respective secrets:\n\n- CUSTOMER_EDC_API_KEY\n- CUSTOMER_PURIS_BACKEND_API_KEY\n- SUPPLIER_EDC_API_KEY\n- SUPPLIER_PURIS_BACKEND_API_KEY\n \n\nWhen using the another environment, update / create a new environment.", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", "_exporter_id": "26605468" }, @@ -42,9 +42,9 @@ "raw": "{\n \"materialFlag\": true,\n \"productFlag\": false,\n \"ownMaterialNumber\": \"{{MATERIAL_NUMBER_CUSTOMER}}\",\n \"materialNumberCx\": \"{{MATERIAL_NUMBER_CX}}\",\n \"name\": \"Semiconductor\"\n}" }, "url": { - "raw": "{{PROVIDER_PURIS_BACKEND}}/catena/materials", + "raw": "{{CUSTOMER_PURIS_BACKEND}}/catena/materials", "host": [ - "{{PROVIDER_PURIS_BACKEND}}" + "{{CUSTOMER_PURIS_BACKEND}}" ], "path": [ "catena", @@ -80,12 +80,12 @@ ], "body": { "mode": "raw", - "raw": "{\n \"materialFlag\": false,\n \"productFlag\": true,\n \"ownMaterialNumber\": \"MNR-4177-S\",\n \"materialNumberCx\": null,\n \"name\": \"central control unit\"\n}" + "raw": "{\n \"materialFlag\": false,\n \"productFlag\": true,\n \"ownMaterialNumber\": \"MNR-4177-S\",\n \"materialNumberCx\": null,\n \"name\": \"Central Control Unit\"\n}" }, "url": { - "raw": "{{PROVIDER_PURIS_BACKEND}}/catena/materials", + "raw": "{{CUSTOMER_PURIS_BACKEND}}/catena/materials", "host": [ - "{{PROVIDER_PURIS_BACKEND}}" + "{{CUSTOMER_PURIS_BACKEND}}" ], "path": [ "catena", @@ -134,9 +134,9 @@ "method": "GET", "header": [], "url": { - "raw": "{{PROVIDER_PURIS_BACKEND}}/catena/materials/all", + "raw": "{{CUSTOMER_PURIS_BACKEND}}/catena/materials/all", "host": [ - "{{PROVIDER_PURIS_BACKEND}}" + "{{CUSTOMER_PURIS_BACKEND}}" ], "path": [ "catena", @@ -173,12 +173,12 @@ ], "body": { "mode": "raw", - "raw": "{\n \"name\": \"NewPartner Inc.\",\n \"edcUrl\": \"{{PROVIDER_EDC_EXT_HOSTNAME}}/{{PROTOCOL_PATH}}\",\n \"bpnl\": \"{{CONSUMER_BPN}}\",\n \"addresses\": [],\n \"sites\": [\n {\n \"bpns\": \"{{CONSUMER_BPNS}}\",\n \"name\": \"New Partner Global Headquarter\",\n \"addresses\": [\n {\n \"bpna\": \"{{CONSUMER_BPNA}}\",\n \"streetAndNumber\": \"Wall Street 101\",\n \"zipCodeAndCity\": \"10001 New York\",\n \"country\": \"USA\"\n }\n ]\n }\n ]\n}" + "raw": "{\n \"name\": \"Semiconductor Supplier Inc.\",\n \"edcUrl\": \"{{SUPPLIER_EDC_EXT_HOSTNAME}}/{{PROTOCOL_PATH}}\",\n \"bpnl\": \"{{SUPPLIER_BPNL}}\",\n \"addresses\": [],\n \"sites\": [\n {\n \"bpns\": \"{{SUPPLIER_BPNS}}\",\n \"name\": \"Semiconductor Supplier Inc. Headquarter\",\n \"addresses\": [\n {\n \"bpna\": \"{{SUPPLIER_BPNA}}\",\n \"streetAndNumber\": \"Wall Street 101\",\n \"zipCodeAndCity\": \"10001 New York\",\n \"country\": \"USA\"\n }\n ]\n }\n ]\n}" }, "url": { - "raw": "{{PROVIDER_PURIS_BACKEND}}/catena/partners", + "raw": "{{CUSTOMER_PURIS_BACKEND}}/catena/partners", "host": [ - "{{PROVIDER_PURIS_BACKEND}}" + "{{CUSTOMER_PURIS_BACKEND}}" ], "path": [ "catena", @@ -203,17 +203,17 @@ " var responseJson = pm.response.json();", "", " pm.expect(responseJson).to.have.property(\"bpnl\");", - " pm.expect(responseJson.bpnl).to.equal(pm.environment.get(\"CONSUMER_BPN\"));", + " pm.expect(responseJson.bpnl).to.equal(pm.environment.get(\"SUPPLIER_BPNL\"));", "", " pm.expect(responseJson.sites).to.be.an(\"array\").with.lengthOf(1);", "", " var site = responseJson.sites[0];", - " pm.expect(site).to.have.property(\"bpns\", pm.environment.get(\"CONSUMER_BPNS\"));", + " pm.expect(site).to.have.property(\"bpns\", pm.environment.get(\"SUPPLIER_BPNS\"));", "", " pm.expect(site.addresses).to.be.an(\"array\").with.lengthOf(1);", "", " var address = site.addresses[0];", - " pm.expect(address).to.have.property(\"bpna\", pm.environment.get(\"CONSUMER_BPNA\"));", + " pm.expect(address).to.have.property(\"bpna\", pm.environment.get(\"SUPPLIER_BPNA\"));", "});" ], "type": "text/javascript" @@ -224,9 +224,9 @@ "method": "GET", "header": [], "url": { - "raw": "{{PROVIDER_PURIS_BACKEND}}/catena/partners?partnerBpnl={{CONSUMER_BPN}}", + "raw": "{{CUSTOMER_PURIS_BACKEND}}/catena/partners?partnerBpnl={{SUPPLIER_BPNL}}", "host": [ - "{{PROVIDER_PURIS_BACKEND}}" + "{{CUSTOMER_PURIS_BACKEND}}" ], "path": [ "catena", @@ -235,7 +235,7 @@ "query": [ { "key": "partnerBpnl", - "value": "{{CONSUMER_BPN}}" + "value": "{{SUPPLIER_BPNL}}" } ] } @@ -269,12 +269,12 @@ ], "body": { "mode": "raw", - "raw": "{\n\"bpns\": \"{{CONSUMER_BPNS2}}\",\n\"name\": \"NewPartner Inc. Secondary Site\",\n\"addresses\": [\n {\n \"bpna\": \"{{CONSUMER_BPNA2}}\",\n \"streetAndNumber\": \"Sunset Blvd. 345\",\n \"zipCodeAndCity\": \"90001 Los Angeles\",\n \"country\": \"USA\"\n }\n]\n}" + "raw": "{\n\"bpns\": \"{{SUPPLIER_BPNS2}}\",\n\"name\": \"Semiconductor Supplier Inc. Secondary Site\",\n\"addresses\": [\n {\n \"bpna\": \"{{SUPPLIER_BPNA2}}\",\n \"streetAndNumber\": \"Sunset Blvd. 345\",\n \"zipCodeAndCity\": \"90001 Los Angeles\",\n \"country\": \"USA\"\n }\n]\n}" }, "url": { - "raw": "{{PROVIDER_PURIS_BACKEND}}/catena/partners/putSite?partnerBpnl={{CONSUMER_BPN}}", + "raw": "{{CUSTOMER_PURIS_BACKEND}}/catena/partners/putSite?partnerBpnl={{SUPPLIER_BPNL}}", "host": [ - "{{PROVIDER_PURIS_BACKEND}}" + "{{CUSTOMER_PURIS_BACKEND}}" ], "path": [ "catena", @@ -284,7 +284,7 @@ "query": [ { "key": "partnerBpnl", - "value": "{{CONSUMER_BPN}}" + "value": "{{SUPPLIER_BPNL}}" } ] } @@ -310,26 +310,26 @@ " const responseJson = pm.response.json();", "", " var supplierPartners = responseJson.filter(function (partner) {", - " return partner.bpnl === pm.environment.get(\"CONSUMER_BPN\");", + " return partner.bpnl === pm.environment.get(\"SUPPLIER_BPNL\");", " });", "", " const supplierPartner = supplierPartners[0];", " pm.expect(supplierPartner).to.have.property(\"bpnl\");", "", - " pm.expect(supplierPartner.bpnl).to.equal(pm.environment.get(\"CONSUMER_BPN\"));", + " pm.expect(supplierPartner.bpnl).to.equal(pm.environment.get(\"SUPPLIER_BPNL\"));", "", " pm.expect(supplierPartner.sites).to.be.an(\"array\").with.lengthOf(2);", "", " // check only the newly added site as the other one has been checked earlier", " var sites = supplierPartner.sites.filter(function (site) {", - " return site.bpns === pm.environment.get(\"CONSUMER_BPNS2\");", + " return site.bpns === pm.environment.get(\"SUPPLIER_BPNS2\");", " });", "", " const site = sites[0];", " pm.expect(site.addresses).to.be.an(\"array\").with.lengthOf(1);", "", " var address = site.addresses[0];", - " pm.expect(address).to.have.property(\"bpna\", pm.environment.get(\"CONSUMER_BPNA2\"));", + " pm.expect(address).to.have.property(\"bpna\", pm.environment.get(\"SUPPLIER_BPNA2\"));", "});" ], "type": "text/javascript" @@ -340,9 +340,9 @@ "method": "GET", "header": [], "url": { - "raw": "{{PROVIDER_PURIS_BACKEND}}/catena/partners/all", + "raw": "{{CUSTOMER_PURIS_BACKEND}}/catena/partners/all", "host": [ - "{{PROVIDER_PURIS_BACKEND}}" + "{{CUSTOMER_PURIS_BACKEND}}" ], "path": [ "catena", @@ -372,9 +372,9 @@ "method": "POST", "header": [], "url": { - "raw": "{{PROVIDER_PURIS_BACKEND}}/catena/materialpartnerrelations?partnerBpnl={{CONSUMER_BPN}}&ownMaterialNumber={{MATERIAL_NUMBER_CUSTOMER}}&partnerMaterialNumber={{MATERIAL_NUMBER_SUPPLIER}}&partnerSupplies=true&partnerBuys=false", + "raw": "{{CUSTOMER_PURIS_BACKEND}}/catena/materialpartnerrelations?partnerBpnl={{SUPPLIER_BPNL}}&ownMaterialNumber={{MATERIAL_NUMBER_CUSTOMER}}&partnerMaterialNumber={{MATERIAL_NUMBER_SUPPLIER}}&partnerSupplies=true&partnerBuys=false", "host": [ - "{{PROVIDER_PURIS_BACKEND}}" + "{{CUSTOMER_PURIS_BACKEND}}" ], "path": [ "catena", @@ -383,7 +383,7 @@ "query": [ { "key": "partnerBpnl", - "value": "{{CONSUMER_BPN}}" + "value": "{{SUPPLIER_BPNL}}" }, { "key": "ownMaterialNumber", @@ -418,8 +418,8 @@ "})", "", "pm.test(\"Verify material partner mapping\", function () {", - " pm.response.to.have.jsonBody(pm.environment.get(\"CONSUMER_BPN\"), pm.collectionVariables.get(\"MATERIAL_NUMBER_SUPPLIER\"))", - " .and.have.jsonBody(pm.environment.get(\"PROVIDER_BPN\"), pm.collectionVariables.get(\"MATERIAL_NUMBER_CUSTOMER\"));", + " pm.response.to.have.jsonBody(pm.environment.get(\"SUPPLIER_BPNL\"), pm.collectionVariables.get(\"MATERIAL_NUMBER_SUPPLIER\"))", + " .and.have.jsonBody(pm.environment.get(\"CUSTOMER_BPNL\"), pm.collectionVariables.get(\"MATERIAL_NUMBER_CUSTOMER\"));", "});" ], "type": "text/javascript" @@ -430,9 +430,9 @@ "method": "GET", "header": [], "url": { - "raw": "{{PROVIDER_PURIS_BACKEND}}/catena/stockView/materialnumbers-mapping?ownMaterialNumber={{MATERIAL_NUMBER_CUSTOMER}}", + "raw": "{{CUSTOMER_PURIS_BACKEND}}/catena/stockView/materialnumbers-mapping?ownMaterialNumber={{MATERIAL_NUMBER_CUSTOMER}}", "host": [ - "{{PROVIDER_PURIS_BACKEND}}" + "{{CUSTOMER_PURIS_BACKEND}}" ], "path": [ "catena", @@ -464,14 +464,14 @@ " const responseJson = pm.response.json();", "", " const sites = responseJson.filter(function (site) {", - " return site.bpns === pm.environment.get(\"PROVIDER_BPNS\");", + " return site.bpns === pm.environment.get(\"CUSTOMER_BPNS\");", " });", "", " const site = sites[0];", " pm.expect(site.addresses).to.be.an(\"array\").with.lengthOf(1);", "", " const address = site.addresses[0];", - " pm.expect(address).to.have.property(\"bpna\", pm.environment.get(\"PROVIDER_BPNA\"));", + " pm.expect(address).to.have.property(\"bpna\", pm.environment.get(\"CUSTOMER_BPNA\"));", "});" ], "type": "text/javascript" @@ -482,9 +482,9 @@ "method": "GET", "header": [], "url": { - "raw": "{{PROVIDER_PURIS_BACKEND}}/catena/partners/ownSites", + "raw": "{{CUSTOMER_PURIS_BACKEND}}/catena/partners/ownSites", "host": [ - "{{PROVIDER_PURIS_BACKEND}}" + "{{CUSTOMER_PURIS_BACKEND}}" ], "path": [ "catena", @@ -514,14 +514,14 @@ " pm.expect(responseJson.material.materialNumberCustomer).to.equal(pm.collectionVariables.get(\"MATERIAL_NUMBER_CUSTOMER\"));", "", " pm.expect(responseJson).to.have.property(\"stockLocationBpns\");", - " pm.expect(responseJson.stockLocationBpns).to.equal(pm.environment.get(\"PROVIDER_BPNS\"));", + " pm.expect(responseJson.stockLocationBpns).to.equal(pm.environment.get(\"CUSTOMER_BPNS\"));", "", " pm.expect(responseJson).to.have.property(\"stockLocationBpna\");", - " pm.expect(responseJson.stockLocationBpna).to.equal(pm.environment.get(\"PROVIDER_BPNA\"));", + " pm.expect(responseJson.stockLocationBpna).to.equal(pm.environment.get(\"CUSTOMER_BPNA\"));", "", " pm.expect(responseJson).to.have.property(\"partner\");", " pm.expect(responseJson.partner).to.have.property(\"bpnl\");", - " pm.expect(responseJson.partner.bpnl).to.equal(pm.environment.get(\"CONSUMER_BPN\"));", + " pm.expect(responseJson.partner.bpnl).to.equal(pm.environment.get(\"SUPPLIER_BPNL\"));", "});" ], "type": "text/javascript" @@ -533,7 +533,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\n \"material\": {\n \"materialFlag\": true,\n \"productFlag\": false,\n \"materialNumberCustomer\": \"{{MATERIAL_NUMBER_CUSTOMER}}\",\n \"materialNumberCx\": \"{{MATERIAL_NUMBER_CX}}\",\n \"name\": \"Semiconductor\"\n },\n \"quantity\": 5.0,\n \"measurementUnit\": \"unit:piece\",\n \"stockLocationBpns\": \"{{PROVIDER_BPNS}}\",\n \"stockLocationBpna\": \"{{PROVIDER_BPNA}}\",\n \"type\": \"MATERIAL\",\n \"lastUpdatedOn\": \"2023-12-18T13:12:48.466+00:00\",\n \"isBlocked\": true,\n \"customerOrderNumber\": \"\",\n \"customerOrderPositionNumber\": \"\",\n \"supplierOrderNumber\": \"\",\n \"partner\":{\n \"bpnl\": \"{{CONSUMER_BPN}}\"\n }\n}", + "raw": "{\n \"material\": {\n \"materialFlag\": true,\n \"productFlag\": false,\n \"materialNumberCustomer\": \"{{MATERIAL_NUMBER_CUSTOMER}}\",\n \"materialNumberCx\": \"{{MATERIAL_NUMBER_CX}}\",\n \"name\": \"Semiconductor\"\n },\n \"quantity\": 50.0,\n \"measurementUnit\": \"unit:piece\",\n \"stockLocationBpns\": \"{{CUSTOMER_BPNS}}\",\n \"stockLocationBpna\": \"{{CUSTOMER_BPNA}}\",\n \"type\": \"MATERIAL\",\n \"lastUpdatedOn\": \"2023-12-18T13:12:48.466+00:00\",\n \"isBlocked\": true,\n \"customerOrderNumber\": \"\",\n \"customerOrderPositionNumber\": \"\",\n \"supplierOrderNumber\": \"\",\n \"partner\":{\n \"bpnl\": \"{{SUPPLIER_BPNL}}\"\n }\n}", "options": { "raw": { "language": "json" @@ -541,9 +541,9 @@ } }, "url": { - "raw": "{{PROVIDER_PURIS_BACKEND}}/catena/stockView/material-stocks", + "raw": "{{CUSTOMER_PURIS_BACKEND}}/catena/stockView/material-stocks", "host": [ - "{{PROVIDER_PURIS_BACKEND}}" + "{{CUSTOMER_PURIS_BACKEND}}" ], "path": [ "catena", @@ -581,7 +581,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\n \"material\": {\n \"materialFlag\": true,\n \"productFlag\": false,\n \"materialNumberCustomer\": \"{{MATERIAL_NUMBER_CUSTOMER}}\",\n \"materialNumberCx\": \"{{MATERIAL_NUMBER_CX}}\",\n \"name\": \"Semiconductor\"\n },\n \"quantity\": 5.0,\n \"measurementUnit\": \"unit:piece\",\n \"stockLocationBpns\": \"{{PROVIDER_BPNS}}\",\n \"stockLocationBpna\": \"{{PROVIDER_BPNA}}\",\n \"type\": \"MATERIAL\",\n \"lastUpdatedOn\": \"2023-12-18T13:12:48.466+00:00\",\n \"isBlocked\": true,\n \"customerOrderNumber\": \"\",\n \"customerOrderPositionNumber\": \"\",\n \"supplierOrderNumber\": \"\",\n \"partner\":{\n \"bpnl\": \"{{CONSUMER_BPN}}\"\n }\n}", + "raw": "{\n \"material\": {\n \"materialFlag\": true,\n \"productFlag\": false,\n \"materialNumberCustomer\": \"{{MATERIAL_NUMBER_CUSTOMER}}\",\n \"materialNumberCx\": \"{{MATERIAL_NUMBER_CX}}\",\n \"name\": \"Semiconductor\"\n },\n \"quantity\": 5.0,\n \"measurementUnit\": \"unit:piece\",\n \"stockLocationBpns\": \"{{CUSTOMER_BPNS}}\",\n \"stockLocationBpna\": \"{{CUSTOMER_BPNA}}\",\n \"type\": \"MATERIAL\",\n \"lastUpdatedOn\": \"2023-12-18T13:12:48.466+00:00\",\n \"isBlocked\": true,\n \"customerOrderNumber\": \"\",\n \"customerOrderPositionNumber\": \"\",\n \"supplierOrderNumber\": \"\",\n \"partner\":{\n \"bpnl\": \"{{SUPPLIER_BPNL}}\"\n }\n}", "options": { "raw": { "language": "json" @@ -589,9 +589,9 @@ } }, "url": { - "raw": "{{PROVIDER_PURIS_BACKEND}}/catena/stockView/material-stocks", + "raw": "{{CUSTOMER_PURIS_BACKEND}}/catena/stockView/material-stocks", "host": [ - "{{PROVIDER_PURIS_BACKEND}}" + "{{CUSTOMER_PURIS_BACKEND}}" ], "path": [ "catena", @@ -608,7 +608,7 @@ "apikey": [ { "key": "value", - "value": "{{PROVIDER_PURIS_API_KEY}}", + "value": "{{CUSTOMER_PURIS_BACKEND_API_KEY}}", "type": "string" }, { @@ -671,9 +671,9 @@ "raw": "{\n \"materialFlag\": false,\n \"productFlag\": true,\n \"ownMaterialNumber\": \"{{MATERIAL_NUMBER_SUPPLIER}}\",\n \"materialNumberCx\": \"{{MATERIAL_NUMBER_CX}}\",\n \"name\": \"Semiconductor\"\n}" }, "url": { - "raw": "{{CONSUMER_PURIS_BACKEND}}/catena/materials", + "raw": "{{SUPPLIER_PURIS_BACKEND}}/catena/materials", "host": [ - "{{CONSUMER_PURIS_BACKEND}}" + "{{SUPPLIER_PURIS_BACKEND}}" ], "path": [ "catena", @@ -714,9 +714,9 @@ "method": "GET", "header": [], "url": { - "raw": "{{CONSUMER_PURIS_BACKEND}}/catena/materials/all", + "raw": "{{SUPPLIER_PURIS_BACKEND}}/catena/materials/all", "host": [ - "{{CONSUMER_PURIS_BACKEND}}" + "{{SUPPLIER_PURIS_BACKEND}}" ], "path": [ "catena", @@ -753,12 +753,12 @@ ], "body": { "mode": "raw", - "raw": "{\n \"name\": \"Control Unit Creator Inc.\",\n \"edcUrl\": \"{{PROVIDER_EDC_EXT_HOSTNAME}}/{{PROTOCOL_PATH}}\",\n \"bpnl\": \"{{PROVIDER_BPN}}\",\n \"addresses\": [],\n \"sites\": [\n {\n \"bpns\": \"{{PROVIDER_BPNS}}\",\n \"name\": \"Control Unit Creator Headquarter\",\n \"addresses\": [\n {\n \"bpna\": \"{{PROVIDER_BPNA}}\",\n \"streetAndNumber\": \"13th Street 47\",\n \"zipCodeAndCity\": \"10011 New York\",\n \"country\": \"USA\"\n }\n ]\n }\n ]\n}" + "raw": "{\n \"name\": \"Control Unit Creator Inc.\",\n \"edcUrl\": \"{{CUSTOMER_EDC_EXT_HOSTNAME}}/{{PROTOCOL_PATH}}\",\n \"bpnl\": \"{{CUSTOMER_BPNL}}\",\n \"addresses\": [],\n \"sites\": [\n {\n \"bpns\": \"{{CUSTOMER_BPNS}}\",\n \"name\": \"Control Unit Creator Headquarter\",\n \"addresses\": [\n {\n \"bpna\": \"{{CUSTOMER_BPNA}}\",\n \"streetAndNumber\": \"13th Street 47\",\n \"zipCodeAndCity\": \"10011 New York\",\n \"country\": \"USA\"\n }\n ]\n }\n ]\n}" }, "url": { - "raw": "{{CONSUMER_PURIS_BACKEND}}/catena/partners", + "raw": "{{SUPPLIER_PURIS_BACKEND}}/catena/partners", "host": [ - "{{CONSUMER_PURIS_BACKEND}}" + "{{SUPPLIER_PURIS_BACKEND}}" ], "path": [ "catena", @@ -783,17 +783,17 @@ " var responseJson = pm.response.json();", "", " pm.expect(responseJson).to.have.property(\"bpnl\");", - " pm.expect(responseJson.bpnl).to.equal(pm.environment.get(\"PROVIDER_BPN\"));", + " pm.expect(responseJson.bpnl).to.equal(pm.environment.get(\"CUSTOMER_BPNL\"));", "", " pm.expect(responseJson.sites).to.be.an(\"array\").with.lengthOf(1);", "", " var site = responseJson.sites[0];", - " pm.expect(site).to.have.property(\"bpns\", pm.environment.get(\"PROVIDER_BPNS\"));", + " pm.expect(site).to.have.property(\"bpns\", pm.environment.get(\"CUSTOMER_BPNS\"));", "", " pm.expect(site.addresses).to.be.an(\"array\").with.lengthOf(1);", "", " var address = site.addresses[0];", - " pm.expect(address).to.have.property(\"bpna\", pm.environment.get(\"PROVIDER_BPNA\"));", + " pm.expect(address).to.have.property(\"bpna\", pm.environment.get(\"CUSTOMER_BPNA\"));", "});" ], "type": "text/javascript" @@ -804,9 +804,9 @@ "method": "GET", "header": [], "url": { - "raw": "{{CONSUMER_PURIS_BACKEND}}/catena/partners?partnerBpnl={{PROVIDER_BPN}}", + "raw": "{{SUPPLIER_PURIS_BACKEND}}/catena/partners?partnerBpnl={{CUSTOMER_BPNL}}", "host": [ - "{{CONSUMER_PURIS_BACKEND}}" + "{{SUPPLIER_PURIS_BACKEND}}" ], "path": [ "catena", @@ -815,7 +815,7 @@ "query": [ { "key": "partnerBpnl", - "value": "{{PROVIDER_BPN}}" + "value": "{{CUSTOMER_BPNL}}" } ] } @@ -841,9 +841,9 @@ "method": "POST", "header": [], "url": { - "raw": "{{CONSUMER_PURIS_BACKEND}}/catena/materialpartnerrelations?partnerBpnl={{PROVIDER_BPN}}&ownMaterialNumber={{MATERIAL_NUMBER_SUPPLIER}}&partnerMaterialNumber={{MATERIAL_NUMBER_CUSTOMER}}&partnerSupplies=false&partnerBuys=true", + "raw": "{{SUPPLIER_PURIS_BACKEND}}/catena/materialpartnerrelations?partnerBpnl={{CUSTOMER_BPNL}}&ownMaterialNumber={{MATERIAL_NUMBER_SUPPLIER}}&partnerMaterialNumber={{MATERIAL_NUMBER_CUSTOMER}}&partnerSupplies=false&partnerBuys=true", "host": [ - "{{CONSUMER_PURIS_BACKEND}}" + "{{SUPPLIER_PURIS_BACKEND}}" ], "path": [ "catena", @@ -852,7 +852,7 @@ "query": [ { "key": "partnerBpnl", - "value": "{{PROVIDER_BPN}}" + "value": "{{CUSTOMER_BPNL}}" }, { "key": "ownMaterialNumber", @@ -887,8 +887,8 @@ "})", "", "pm.test(\"Verify material partner mapping\", function () {", - " pm.response.to.have.jsonBody(pm.environment.get(\"CONSUMER_BPN\"), pm.collectionVariables.get(\"MATERIAL_NUMBER_SUPPLIER\"))", - " .and.have.jsonBody(pm.environment.get(\"PROVIDER_BPN\"), pm.collectionVariables.get(\"MATERIAL_NUMBER_CUSTOMER\"));", + " pm.response.to.have.jsonBody(pm.environment.get(\"SUPPLIER_BPNL\"), pm.collectionVariables.get(\"MATERIAL_NUMBER_SUPPLIER\"))", + " .and.have.jsonBody(pm.environment.get(\"CUSTOMER_BPNL\"), pm.collectionVariables.get(\"MATERIAL_NUMBER_CUSTOMER\"));", "});" ], "type": "text/javascript" @@ -899,9 +899,9 @@ "method": "GET", "header": [], "url": { - "raw": "{{CONSUMER_PURIS_BACKEND}}/catena/stockView/materialnumbers-mapping?ownMaterialNumber={{MATERIAL_NUMBER_SUPPLIER}}", + "raw": "{{SUPPLIER_PURIS_BACKEND}}/catena/stockView/materialnumbers-mapping?ownMaterialNumber={{MATERIAL_NUMBER_SUPPLIER}}", "host": [ - "{{CONSUMER_PURIS_BACKEND}}" + "{{SUPPLIER_PURIS_BACKEND}}" ], "path": [ "catena", @@ -933,14 +933,14 @@ " const responseJson = pm.response.json();", "", " const sites = responseJson.filter(function (site) {", - " return site.bpns === pm.environment.get(\"PROVIDER_BPNS\");", + " return site.bpns === pm.environment.get(\"SUPPLIER_BPNS\");", " });", "", " const site = sites[0];", " pm.expect(site.addresses).to.be.an(\"array\").with.lengthOf(1);", "", " const address = site.addresses[0];", - " pm.expect(address).to.have.property(\"bpna\", pm.environment.get(\"PROVIDER_BPNA\"));", + " pm.expect(address).to.have.property(\"bpna\", pm.environment.get(\"SUPPLIER_BPNA\"));", "});" ], "type": "text/javascript" @@ -951,9 +951,9 @@ "method": "GET", "header": [], "url": { - "raw": "{{PROVIDER_PURIS_BACKEND}}/catena/partners/ownSites", + "raw": "{{SUPPLIER_PURIS_BACKEND}}/catena/partners/ownSites", "host": [ - "{{PROVIDER_PURIS_BACKEND}}" + "{{SUPPLIER_PURIS_BACKEND}}" ], "path": [ "catena", @@ -984,7 +984,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\n \"material\": {\n \"materialFlag\": false,\n \"productFlag\": true,\n \"materialNumberCustomer\": \"{{MATERIAL_NUMBER_CUSTOMER}}\",\n \"materialNumberSupplier\": \"{{MATERIAL_NUMBER_SUPPLIER}}\",\n \"materialNumberCx\": \"{{MATERIAL_NUMBER_CX}}\",\n \"name\": \"Semiconductor\"\n },\n \"quantity\": 5.0,\n \"measurementUnit\": \"unit:piece\",\n \"stockLocationBpns\": \"{{CONSUMER_BPNS}}\",\n \"stockLocationBpna\": \"{{CONSUMER_BPNA}}\",\n \"type\": \"PRODUCT\",\n \"lastUpdatedOn\": \"2023-12-18T14:12:48.466+00:00\",\n \"isBlocked\": false,\n \"customerOrderNumber\": \"\",\n \"customerOrderPositionNumber\": \"\",\n \"supplierOrderNumber\": \"\",\n \"partner\":{\n \"bpnl\": \"{{PROVIDER_BPN}}\"\n }\n}", + "raw": "{\n \"material\": {\n \"materialFlag\": false,\n \"productFlag\": true,\n \"materialNumberCustomer\": \"{{MATERIAL_NUMBER_CUSTOMER}}\",\n \"materialNumberSupplier\": \"{{MATERIAL_NUMBER_SUPPLIER}}\",\n \"materialNumberCx\": \"{{MATERIAL_NUMBER_CX}}\",\n \"name\": \"Semiconductor\"\n },\n \"quantity\": 5.0,\n \"measurementUnit\": \"unit:piece\",\n \"stockLocationBpns\": \"{{SUPPLIER_BPNS}}\",\n \"stockLocationBpna\": \"{{SUPPLIER_BPNA}}\",\n \"type\": \"PRODUCT\",\n \"lastUpdatedOn\": \"2023-12-18T14:12:48.466+00:00\",\n \"isBlocked\": false,\n \"customerOrderNumber\": \"\",\n \"customerOrderPositionNumber\": \"\",\n \"supplierOrderNumber\": \"\",\n \"partner\":{\n \"bpnl\": \"{{CUSTOMER_BPNL}}\"\n }\n}", "options": { "raw": { "language": "json" @@ -992,9 +992,9 @@ } }, "url": { - "raw": "{{CONSUMER_PURIS_BACKEND}}/catena/stockView/product-stocks", + "raw": "{{SUPPLIER_PURIS_BACKEND}}/catena/stockView/product-stocks", "host": [ - "{{CONSUMER_PURIS_BACKEND}}" + "{{SUPPLIER_PURIS_BACKEND}}" ], "path": [ "catena", @@ -1028,14 +1028,14 @@ " pm.expect(stock.material.materialNumberSupplier).to.equal(pm.collectionVariables.get(\"MATERIAL_NUMBER_SUPPLIER\"));", "", " pm.expect(stock).to.have.property(\"stockLocationBpns\");", - " pm.expect(stock.stockLocationBpns).to.equal(pm.environment.get(\"CONSUMER_BPNS\"));", + " pm.expect(stock.stockLocationBpns).to.equal(pm.environment.get(\"SUPPLIER_BPNS\"));", "", " pm.expect(stock).to.have.property(\"stockLocationBpna\");", - " pm.expect(stock.stockLocationBpna).to.equal(pm.environment.get(\"CONSUMER_BPNA\"));", + " pm.expect(stock.stockLocationBpna).to.equal(pm.environment.get(\"SUPPLIER_BPNA\"));", "", " pm.expect(stock).to.have.property(\"partner\");", " pm.expect(stock.partner).to.have.property(\"bpnl\");", - " pm.expect(stock.partner.bpnl).to.equal(pm.environment.get(\"PROVIDER_BPN\"));", + " pm.expect(stock.partner.bpnl).to.equal(pm.environment.get(\"CUSTOMER_BPNL\"));", "});" ], "type": "text/javascript" @@ -1052,9 +1052,9 @@ } ], "url": { - "raw": "{{CONSUMER_PURIS_BACKEND}}/catena/stockView/product-stocks", + "raw": "{{SUPPLIER_PURIS_BACKEND}}/catena/stockView/product-stocks", "host": [ - "{{CONSUMER_PURIS_BACKEND}}" + "{{SUPPLIER_PURIS_BACKEND}}" ], "path": [ "catena", @@ -1071,7 +1071,7 @@ "apikey": [ { "key": "value", - "value": "{{CONSUMER_PURIS_API_KEY}}", + "value": "{{SUPPLIER_PURIS_BACKEND_API_KEY}}", "type": "string" }, { @@ -1142,7 +1142,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\r\n \"@context\": {},\r\n \"@type\": \"CatalogRequest\",\r\n \"protocol\": \"dataspace-protocol-http\",\r\n \"counterPartyAddress\": \"{{PROVIDER_EDC_EXT_HOSTNAME}}/{{PROTOCOL_PATH}}\",\r\n \"querySpec\": {\r\n \"offset\": 0,\r\n \"limit\": 100,\r\n \"filter\": \"\",\r\n \"range\": {\r\n \"from\": 0,\r\n \"to\": 100\r\n },\r\n \"filterExpression\": [\r\n {\r\n \"@type\" : \"CriterionDto\",\r\n \"operandLeft\": \"asset:prop:type\",\r\n \"operator\": \"=\",\r\n \"operandRight\": \"data.res.itemStockRequestApi\"\r\n },\r\n {\r\n \"@type\" : \"CriterionDto\",\r\n \"operandLeft\": \"https://w3id.org/catenax/ontology/common#version\",\r\n \"operator\": \"=\",\r\n \"operandRight\": \"1.0\"\r\n }\r\n ]\r\n }\r\n}\r\n", + "raw": "{\r\n \"@context\": {},\r\n \"@type\": \"CatalogRequest\",\r\n \"protocol\": \"dataspace-protocol-http\",\r\n \"counterPartyAddress\": \"{{CUSTOMER_EDC_EXT_HOSTNAME}}/{{PROTOCOL_PATH}}\",\r\n \"querySpec\": {\r\n \"offset\": 0,\r\n \"limit\": 100,\r\n \"filter\": \"\",\r\n \"range\": {\r\n \"from\": 0,\r\n \"to\": 100\r\n },\r\n \"filterExpression\": [\r\n {\r\n \"@type\" : \"CriterionDto\",\r\n \"operandLeft\": \"asset:prop:type\",\r\n \"operator\": \"=\",\r\n \"operandRight\": \"data.res.itemStockRequestApi\"\r\n },\r\n {\r\n \"@type\" : \"CriterionDto\",\r\n \"operandLeft\": \"https://w3id.org/catenax/ontology/common#version\",\r\n \"operator\": \"=\",\r\n \"operandRight\": \"1.0\"\r\n }\r\n ]\r\n }\r\n}\r\n", "options": { "raw": { "language": "json" @@ -1150,9 +1150,9 @@ } }, "url": { - "raw": "{{CONSUMER_EDC}}/{{MANAGEMENT_PATH}}/v2/catalog/request", + "raw": "{{SUPPLIER_EDC}}/{{MANAGEMENT_PATH}}/v2/catalog/request", "host": [ - "{{CONSUMER_EDC}}" + "{{SUPPLIER_EDC}}" ], "path": [ "{{MANAGEMENT_PATH}}", @@ -1199,7 +1199,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\r\n \"@context\": {},\r\n \"@type\": \"CatalogRequest\",\r\n \"protocol\": \"dataspace-protocol-http\",\r\n \"counterPartyAddress\": \"{{PROVIDER_EDC_EXT_HOSTNAME}}/{{PROTOCOL_PATH}}\",\r\n \"querySpec\": {\r\n \"offset\": 0,\r\n \"limit\": 100,\r\n \"filter\": \"\",\r\n \"range\": {\r\n \"from\": 0,\r\n \"to\": 100\r\n },\r\n \"filterExpression\": [\r\n {\r\n \"@type\" : \"CriterionDto\",\r\n \"operandLeft\": \"asset:prop:type\",\r\n \"operator\": \"=\",\r\n \"operandRight\": \"data.res.itemStockResponseApi\"\r\n },\r\n {\r\n \"@type\" : \"CriterionDto\",\r\n \"operandLeft\": \"https://w3id.org/catenax/ontology/common#version\",\r\n \"operator\": \"=\",\r\n \"operandRight\": \"1.0\" \r\n }\r\n ]\r\n }\r\n}\r\n", + "raw": "{\r\n \"@context\": {},\r\n \"@type\": \"CatalogRequest\",\r\n \"protocol\": \"dataspace-protocol-http\",\r\n \"counterPartyAddress\": \"{{CUSTOMER_EDC_EXT_HOSTNAME}}/{{PROTOCOL_PATH}}\",\r\n \"querySpec\": {\r\n \"offset\": 0,\r\n \"limit\": 100,\r\n \"filter\": \"\",\r\n \"range\": {\r\n \"from\": 0,\r\n \"to\": 100\r\n },\r\n \"filterExpression\": [\r\n {\r\n \"@type\" : \"CriterionDto\",\r\n \"operandLeft\": \"asset:prop:type\",\r\n \"operator\": \"=\",\r\n \"operandRight\": \"data.res.itemStockResponseApi\"\r\n },\r\n {\r\n \"@type\" : \"CriterionDto\",\r\n \"operandLeft\": \"https://w3id.org/catenax/ontology/common#version\",\r\n \"operator\": \"=\",\r\n \"operandRight\": \"1.0\" \r\n }\r\n ]\r\n }\r\n}\r\n", "options": { "raw": { "language": "json" @@ -1207,9 +1207,9 @@ } }, "url": { - "raw": "{{CONSUMER_EDC}}/{{MANAGEMENT_PATH}}/v2/catalog/request", + "raw": "{{SUPPLIER_EDC}}/{{MANAGEMENT_PATH}}/v2/catalog/request", "host": [ - "{{CONSUMER_EDC}}" + "{{SUPPLIER_EDC}}" ], "path": [ "{{MANAGEMENT_PATH}}", @@ -1227,7 +1227,7 @@ "apikey": [ { "key": "value", - "value": "{{CONSUMER_EDC_API_KEY}}", + "value": "{{SUPPLIER_EDC_API_KEY}}", "type": "string" }, { From 77512bfe4db3919b2149240729d7006843e717d4 Mon Sep 17 00:00:00 2001 From: --show-origin Date: Fri, 12 Jan 2024 10:34:40 -0800 Subject: [PATCH 05/10] refactor: updated application properties according to definitions in local/postman/README.md --- backend/src/main/resources/application.properties | 10 +++++----- backend/src/test/resources/application.properties | 14 +++++++------- .../config/customer/puris-backend.properties | 12 +++++------- .../config/supplier/puris-backend.properties | 10 +++++----- 4 files changed, 22 insertions(+), 24 deletions(-) diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties index ef0ed5fd..5af88bc9 100755 --- a/backend/src/main/resources/application.properties +++ b/backend/src/main/resources/application.properties @@ -37,19 +37,19 @@ spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true own.bpnl=${OWN_BPNL:BPNL4444444444XX} # Own name (self-description) -own.name=${OWN_NAME:Scenario Customer} +own.name=${OWN_NAME:Control Unit Creator Inc.} # Own BPNS (optional: if this is set, then set own.site.name as well) own.bpns=${OWN_BPNS:BPNS4444444444XX} # Name of Site (see above) -own.site.name=${OWN_SITE:Hauptwerk Musterhausen} +own.site.name=${OWN_SITE:Control Unit Creator Production Site} # If a BPNS is set, then this BPNA will be attached to it. # Otherwise, it will be attached immediately to the BPNL (see above) own.bpna=${OWN_BPNA:BPNA4444444444AA} -own.streetandnumber=${OWN_STREETANDNUMBER:Musterstrasse 35b} -own.zipcodeandcity=${OWN_ZIPCODEANDCITY:77777 Musterhausen} -own.country=${OWN_COUNTRY:Germany} +own.streetandnumber=${OWN_STREETANDNUMBER:Wall Street 101} +own.zipcodeandcity=${OWN_ZIPCODEANDCITY:10001 New York} +own.country=${OWN_COUNTRY:USA} server.ssl.enabled=false #server.port=8443 diff --git a/backend/src/test/resources/application.properties b/backend/src/test/resources/application.properties index ccf9c6c8..d11d9c37 100755 --- a/backend/src/test/resources/application.properties +++ b/backend/src/test/resources/application.properties @@ -36,19 +36,19 @@ spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true own.bpnl=${OWN_BPNL:BPNL4444444444XX} # Own name (self-description) -own.name=${OWN_NAME:Scenario Customer} +own.name=${OWN_NAME:Control Unit Creator Inc.} # Own BPNS (optional: if this is set, then set own.site.name as well) -own.bpns=${OWN_BPNS:BPNS4444444444XY} +own.bpns=${OWN_BPNS:BPNS4444444444XX} # Name of Site (see above) -own.site.name=${OWN_SITE:Hauptwerk Musterhausen} +own.site.name=${OWN_SITE:Control Unit Creator Production Site} # If a BPNS is set, then this BPNA will be attached to it. # Otherwise, it will be attached immediately to the BPNL (see above) -own.bpna=${OWN_BPNA:BPNA4444444444ZZ} -own.streetandnumber=${OWN_STREETANDNUMBER:Musterstrasse 35b} -own.zipcodeandcity=${OWN_ZIPCODEANDCITY:77777 Musterhausen} -own.country=${OWN_COUNTRY:Germany} +own.bpna=${OWN_BPNA:BPNA4444444444AA} +own.streetandnumber=${OWN_STREETANDNUMBER:Wall Street 101} +own.zipcodeandcity=${OWN_ZIPCODEANDCITY:10001 New York} +own.country=${OWN_COUNTRY:USA} # run with: # ./mvnw spring-boot:run -Dspring-boot.run.arguments=--spring.config.location="./src/main/resources/application.properties" diff --git a/local/tractus-x-edc/config/customer/puris-backend.properties b/local/tractus-x-edc/config/customer/puris-backend.properties index 6e80cf96..5c306c15 100644 --- a/local/tractus-x-edc/config/customer/puris-backend.properties +++ b/local/tractus-x-edc/config/customer/puris-backend.properties @@ -14,12 +14,10 @@ edc.controlplane.management.url=http://customer-control-plane:8181/management edc.controlplane.protocol.url=http://customer-control-plane:8184/api/v1/dsp own.bpnl=BPNL4444444444XX -own.name=Scenario Customer +own.name=Control Unit Creator Inc. own.bpns=BPNS4444444444XX -own.site.name=Hauptwerk Musterhausen +own.site.name=Control Unit Creator Production Site own.bpna=BPNA4444444444AA -own.streetandnumber=Musterstrasse 35b -own.zipcodeandcity=77777 Musterhausen -own.country=Germany - - +own.streetandnumber=13th Street 47 +own.zipcodeandcity=10011 New York +own.country=USA diff --git a/local/tractus-x-edc/config/supplier/puris-backend.properties b/local/tractus-x-edc/config/supplier/puris-backend.properties index 1b4c8390..fb2ad073 100644 --- a/local/tractus-x-edc/config/supplier/puris-backend.properties +++ b/local/tractus-x-edc/config/supplier/puris-backend.properties @@ -14,12 +14,12 @@ edc.controlplane.management.url=http://supplier-control-plane:9181/management edc.controlplane.protocol.url=http://supplier-control-plane:9184/api/v1/dsp own.bpnl=BPNL1234567890ZZ -own.name=Scenario Supplier +own.name=Semiconductor Supplier Inc. own.bpns=BPNS1234567890ZZ -own.site.name=Konzernzentrale Dudelsdorf +own.site.name=Semiconductor Supplier Inc. Production Site own.bpna=BPNA1234567890AA -own.streetandnumber=Heinrich-Supplier-Strasse 1 -own.zipcodeandcity=77785 Dudelsdorf -own.country=Germany +own.streetandnumber=Wall Street 101 +own.zipcodeandcity=10001 New York +own.country=USA From 46e59da0cc310e56f13d30c651f936844e2a0028 Mon Sep 17 00:00:00 2001 From: --show-origin Date: Fri, 12 Jan 2024 10:39:31 -0800 Subject: [PATCH 06/10] chore: updated dependencies + removed reported stocks from testdata --- DEPENDENCIES_BACKEND | 2 +- backend/DEPENDENCIES | 2 +- local/postman/README.md | 15 --------------- 3 files changed, 2 insertions(+), 17 deletions(-) diff --git a/DEPENDENCIES_BACKEND b/DEPENDENCIES_BACKEND index de675373..24a4989c 100644 --- a/DEPENDENCIES_BACKEND +++ b/DEPENDENCIES_BACKEND @@ -50,7 +50,7 @@ maven/mavencentral/org.hamcrest/hamcrest/2.2, BSD-3-Clause, approved, clearlydef maven/mavencentral/org.hibernate.common/hibernate-commons-annotations/6.0.6.Final, LGPL-2.1-only, approved, #6962 maven/mavencentral/org.hibernate.orm/hibernate-core/6.2.9.Final, LGPL-2.1-only AND Apache-2.0 AND MIT AND CC-PDDC AND (EPL-2.0 OR BSD-3-Clause), approved, #9121 maven/mavencentral/org.hibernate.validator/hibernate-validator/8.0.0.Final, Apache-2.0, approved, clearlydefined -maven/mavencentral/org.hsqldb/hsqldb/2.7.1, BSD-3-Clause, approved, clearlydefined +maven/mavencentral/org.hsqldb/hsqldb/2.7.1, BSD-3-Clause, approved, #12699 maven/mavencentral/org.jboss.logging/jboss-logging/3.5.3.Final, Apache-2.0, approved, #9471 maven/mavencentral/org.junit.jupiter/junit-jupiter-api/5.9.3, EPL-2.0, approved, #3133 maven/mavencentral/org.junit.jupiter/junit-jupiter-engine/5.9.3, EPL-2.0, approved, #3125 diff --git a/backend/DEPENDENCIES b/backend/DEPENDENCIES index de675373..24a4989c 100644 --- a/backend/DEPENDENCIES +++ b/backend/DEPENDENCIES @@ -50,7 +50,7 @@ maven/mavencentral/org.hamcrest/hamcrest/2.2, BSD-3-Clause, approved, clearlydef maven/mavencentral/org.hibernate.common/hibernate-commons-annotations/6.0.6.Final, LGPL-2.1-only, approved, #6962 maven/mavencentral/org.hibernate.orm/hibernate-core/6.2.9.Final, LGPL-2.1-only AND Apache-2.0 AND MIT AND CC-PDDC AND (EPL-2.0 OR BSD-3-Clause), approved, #9121 maven/mavencentral/org.hibernate.validator/hibernate-validator/8.0.0.Final, Apache-2.0, approved, clearlydefined -maven/mavencentral/org.hsqldb/hsqldb/2.7.1, BSD-3-Clause, approved, clearlydefined +maven/mavencentral/org.hsqldb/hsqldb/2.7.1, BSD-3-Clause, approved, #12699 maven/mavencentral/org.jboss.logging/jboss-logging/3.5.3.Final, Apache-2.0, approved, #9471 maven/mavencentral/org.junit.jupiter/junit-jupiter-api/5.9.3, EPL-2.0, approved, #3133 maven/mavencentral/org.junit.jupiter/junit-jupiter-engine/5.9.3, EPL-2.0, approved, #3125 diff --git a/local/postman/README.md b/local/postman/README.md index fd96d824..3c3e18dc 100644 --- a/local/postman/README.md +++ b/local/postman/README.md @@ -53,12 +53,6 @@ Overall the customer has the following information: - Customer Order Number: CNbr-1 - Customer Order Position Number: C-Pos-1 - Supplier Order Number: SNbr-1 - - Reported Material Stock 1: - - Partner: Semiconductor Supplier (BPNL1234567890ZZ) - - Material: Semiconductor - - Quantity: 100 pieces - - Blocked: true - - Order Position Reference: empty ### Supplier Overall the supplier has the following information: @@ -101,15 +95,6 @@ Overall the supplier has the following information: - Customer Order Number: CNbr-2 - Customer Order Position Number: C-Pos-2 - Supplier Order Number: SNbr-2 - - Reported Product Stock 1: - - Partner: Control Unit Creator Inc. (BPNL4444444444XX) - - Material: Semiconductor - - Quantity: 500 pieces - - Blocked: true - - Order Position Reference: - - Customer Order Number: CNbr-1 - - Customer Order Position Number: C-Pos-1 - - Supplier Order Number: SNbr-1 ## Preparations From 18eac72927c6d2a8df574c05a1bcd578d53b10d6 Mon Sep 17 00:00:00 2001 From: --show-origin Date: Thu, 18 Jan 2024 08:39:34 -0800 Subject: [PATCH 07/10] feat(postman): incorporated review on naming conventions, added edc status request check --- .../Local Dev.postman_environment.json | 256 +- ...s-integration-test.postman_collection.json | 2653 +++++++++-------- 2 files changed, 1483 insertions(+), 1426 deletions(-) diff --git a/local/postman/Local Dev.postman_environment.json b/local/postman/Local Dev.postman_environment.json index bc58b64f..70958d07 100644 --- a/local/postman/Local Dev.postman_environment.json +++ b/local/postman/Local Dev.postman_environment.json @@ -1,129 +1,129 @@ { - "id": "c99bfe48-fce6-47f2-8f4b-98a64f9dbecc", - "name": "Local Dev", - "values": [ - { - "key": "CUSTOMER_PURIS_BACKEND_API_KEY", - "value": "", - "type": "default", - "enabled": true - }, - { - "key": "SUPPLIER_EDC_API_KEY", - "value": "", - "type": "default", - "enabled": true - }, - { - "key": "SUPPLIER_PURIS_BACKEND_API_KEY", - "value": "", - "type": "default", - "enabled": true - }, - { - "key": "SUPPLIER_PURIS_API_KEY", - "value": "", - "type": "default", - "enabled": true - }, - { - "key": "CUSTOMER_EDC", - "value": "http://localhost:8181", - "type": "default", - "enabled": true - }, - { - "key": "PROTOCOL_PATH", - "value": "api/v1/dsp", - "type": "default", - "enabled": true - }, - { - "key": "MANAGEMENT_PATH", - "value": "management", - "type": "default", - "enabled": true - }, - { - "key": "SUPPLIER_EDC", - "value": "http://localhost:9181", - "type": "default", - "enabled": true - }, - { - "key": "SUPPLIER_BPNL", - "value": "BPNL1234567890ZZ", - "type": "default", - "enabled": true - }, - { - "key": "CUSTOMER_BPNL", - "value": "BPNL4444444444XX", - "type": "default", - "enabled": true - }, - { - "key": "CUSTOMER_EDC_EXT_HOSTNAME", - "value": "http://customer-control-plane:8184", - "type": "default", - "enabled": true - }, - { - "key": "CUSTOMER_PURIS_BACKEND", - "value": "http://localhost:8081", - "type": "default", - "enabled": true - }, - { - "key": "CUSTOMER_BPNS", - "value": "BPNS4444444444XX", - "type": "default", - "enabled": true - }, - { - "key": "CUSTOMER_BPNA", - "value": "BPNA4444444444AA", - "type": "default", - "enabled": true - }, - { - "key": "SUPPLIER_EDC_EXT_HOSTNAME", - "value": "http://supplier-control-plane:9184", - "type": "default", - "enabled": true - }, - { - "key": "SUPPLIER_PURIS_BACKEND", - "value": "http://localhost:8082", - "type": "default", - "enabled": true - }, - { - "key": "SUPPLIER_BPNS", - "value": "BPNS1234567890ZZ", - "type": "default", - "enabled": true - }, - { - "key": "SUPPLIER_BPNA", - "value": "BPNA1234567890AA", - "type": "default", - "enabled": true - }, - { - "key": "SUPPLIER_BPNS2", - "value": "BPNS2222222222SS", - "type": "default", - "enabled": true - }, - { - "key": "SUPPLIER_BPNA2", - "value": "BPNA2222222222AA", - "type": "default", - "enabled": true - } - ], - "_postman_variable_scope": "environment", - "_postman_exported_at": "2024-01-12T18:25:43.497Z", - "_postman_exported_using": "Postman/10.21.11" -} \ No newline at end of file + "id": "c99bfe48-fce6-47f2-8f4b-98a64f9dbecc", + "name": "Local Dev", + "values": [ + { + "key": "CUSTOMER_PURIS_BACKEND_API_KEY", + "value": "", + "type": "default", + "enabled": true + }, + { + "key": "CUSTOMER_EDC_API_KEY", + "value": "", + "type": "default", + "enabled": true + }, + { + "key": "SUPPLIER_PURIS_BACKEND_API_KEY", + "value": "", + "type": "default", + "enabled": true + }, + { + "key": "SUPPLIER_EDC_API_KEY", + "value": "", + "type": "default", + "enabled": true + }, + { + "key": "CUSTOMER_EDC", + "value": "http://localhost:8181", + "type": "default", + "enabled": true + }, + { + "key": "PROTOCOL_PATH", + "value": "api/v1/dsp", + "type": "default", + "enabled": true + }, + { + "key": "MANAGEMENT_PATH", + "value": "management", + "type": "default", + "enabled": true + }, + { + "key": "SUPPLIER_EDC", + "value": "http://localhost:9181", + "type": "default", + "enabled": true + }, + { + "key": "SUPPLIER_BPNL", + "value": "BPNL1234567890ZZ", + "type": "default", + "enabled": true + }, + { + "key": "CUSTOMER_BPNL", + "value": "BPNL4444444444XX", + "type": "default", + "enabled": true + }, + { + "key": "CUSTOMER_EDC_EXT_HOSTNAME", + "value": "http://customer-control-plane:8184", + "type": "default", + "enabled": true + }, + { + "key": "CUSTOMER_PURIS_BACKEND", + "value": "http://localhost:8081", + "type": "default", + "enabled": true + }, + { + "key": "CUSTOMER_BPNS", + "value": "BPNS4444444444XX", + "type": "default", + "enabled": true + }, + { + "key": "CUSTOMER_BPNA", + "value": "BPNA4444444444AA", + "type": "default", + "enabled": true + }, + { + "key": "SUPPLIER_EDC_EXT_HOSTNAME", + "value": "http://supplier-control-plane:9184", + "type": "default", + "enabled": true + }, + { + "key": "SUPPLIER_PURIS_BACKEND", + "value": "http://localhost:8082", + "type": "default", + "enabled": true + }, + { + "key": "SUPPLIER_BPNS", + "value": "BPNS1234567890ZZ", + "type": "default", + "enabled": true + }, + { + "key": "SUPPLIER_BPNA", + "value": "BPNA1234567890AA", + "type": "default", + "enabled": true + }, + { + "key": "SUPPLIER_BPNS2", + "value": "BPNS2222222222SS", + "type": "default", + "enabled": true + }, + { + "key": "SUPPLIER_BPNA2", + "value": "BPNA2222222222AA", + "type": "default", + "enabled": true + } + ], + "_postman_variable_scope": "environment", + "_postman_exported_at": "2024-01-18T16:38:08.553Z", + "_postman_exported_using": "Postman/10.21.14" +} diff --git a/local/postman/puris-integration-test.postman_collection.json b/local/postman/puris-integration-test.postman_collection.json index bf49f419..d29be8d7 100644 --- a/local/postman/puris-integration-test.postman_collection.json +++ b/local/postman/puris-integration-test.postman_collection.json @@ -1,1299 +1,1356 @@ { - "info": { - "_postman_id": "08da5aef-cb4d-46ea-a2e1-a1d47e73c97a", - "name": "puris-integration-test", - "description": "The collection assumes the following roles:\n\n- Customer PURIS (upper tier)\n \n- Supplier PURIS (lower tier)\n \n\nIt creates the opposite partner and the respective view on the semiconductor material or product.\n\nTo run the tests correctly, take the environment and fill the respective secrets:\n\n- CUSTOMER_EDC_API_KEY\n- CUSTOMER_PURIS_BACKEND_API_KEY\n- SUPPLIER_EDC_API_KEY\n- SUPPLIER_PURIS_BACKEND_API_KEY\n \n\nWhen using the another environment, update / create a new environment.", - "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", - "_exporter_id": "26605468" - }, - "item": [ - { - "name": "Test_01-MAD", - "item": [ - { - "name": "CustomerInit", - "item": [ - { - "name": "Create Semiconductor Material", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"response is ok\", function() {", - " pm.response.to.have.status(200);", - "})" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"materialFlag\": true,\n \"productFlag\": false,\n \"ownMaterialNumber\": \"{{MATERIAL_NUMBER_CUSTOMER}}\",\n \"materialNumberCx\": \"{{MATERIAL_NUMBER_CX}}\",\n \"name\": \"Semiconductor\"\n}" - }, - "url": { - "raw": "{{CUSTOMER_PURIS_BACKEND}}/catena/materials", - "host": [ - "{{CUSTOMER_PURIS_BACKEND}}" - ], - "path": [ - "catena", - "materials" - ] - } - }, - "response": [] - }, - { - "name": "Create Control Unit Product", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"response is ok\", function() {", - " pm.response.to.have.status(200);", - "})" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"materialFlag\": false,\n \"productFlag\": true,\n \"ownMaterialNumber\": \"MNR-4177-S\",\n \"materialNumberCx\": null,\n \"name\": \"Central Control Unit\"\n}" - }, - "url": { - "raw": "{{CUSTOMER_PURIS_BACKEND}}/catena/materials", - "host": [ - "{{CUSTOMER_PURIS_BACKEND}}" - ], - "path": [ - "catena", - "materials" - ] - } - }, - "response": [] - }, - { - "name": "Get All Materials", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"response is ok\", function() {", - " pm.response.to.have.status(200);", - "})", - "", - "pm.test(\"Verify response contains two objects\", function () {", - " pm.expect(pm.response.json()).to.be.an(\"array\").with.lengthOf(2);", - "});", - "", - "pm.test(\"Verify ownMaterialNumber values\", function () {", - " var responseJson = pm.response.json();", - "", - " var foundValues = [];", - " ", - " responseJson.forEach(function (obj) {", - " pm.expect(obj).to.have.property(\"ownMaterialNumber\");", - " pm.expect(obj.ownMaterialNumber).to.be.oneOf([\"MNR-4177-S\", pm.collectionVariables.get(\"MATERIAL_NUMBER_CUSTOMER\")]);", - "", - " // Put found value into foundValues to ensure that each value is only found once", - " pm.expect(foundValues).to.not.include(obj.ownMaterialNumber);", - " foundValues.push(obj.ownMaterialNumber);", - " });", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{CUSTOMER_PURIS_BACKEND}}/catena/materials/all", - "host": [ - "{{CUSTOMER_PURIS_BACKEND}}" - ], - "path": [ - "catena", - "materials", - "all" - ] - } - }, - "response": [] - }, - { - "name": "Register Supplier Partner", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"response is ok\", function() {", - " pm.response.to.have.status(200);", - "})" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"name\": \"Semiconductor Supplier Inc.\",\n \"edcUrl\": \"{{SUPPLIER_EDC_EXT_HOSTNAME}}/{{PROTOCOL_PATH}}\",\n \"bpnl\": \"{{SUPPLIER_BPNL}}\",\n \"addresses\": [],\n \"sites\": [\n {\n \"bpns\": \"{{SUPPLIER_BPNS}}\",\n \"name\": \"Semiconductor Supplier Inc. Headquarter\",\n \"addresses\": [\n {\n \"bpna\": \"{{SUPPLIER_BPNA}}\",\n \"streetAndNumber\": \"Wall Street 101\",\n \"zipCodeAndCity\": \"10001 New York\",\n \"country\": \"USA\"\n }\n ]\n }\n ]\n}" - }, - "url": { - "raw": "{{CUSTOMER_PURIS_BACKEND}}/catena/partners", - "host": [ - "{{CUSTOMER_PURIS_BACKEND}}" - ], - "path": [ - "catena", - "partners" - ] - } - }, - "response": [] - }, - { - "name": "Get Supplier Partner", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"response is ok\", function () {", - " pm.response.to.have.status(200);", - "})", - "", - "pm.test(\"Verify parnter values (BPNL with one BPNS with one BPNA)\", function () {", - " var responseJson = pm.response.json();", - "", - " pm.expect(responseJson).to.have.property(\"bpnl\");", - " pm.expect(responseJson.bpnl).to.equal(pm.environment.get(\"SUPPLIER_BPNL\"));", - "", - " pm.expect(responseJson.sites).to.be.an(\"array\").with.lengthOf(1);", - "", - " var site = responseJson.sites[0];", - " pm.expect(site).to.have.property(\"bpns\", pm.environment.get(\"SUPPLIER_BPNS\"));", - "", - " pm.expect(site.addresses).to.be.an(\"array\").with.lengthOf(1);", - "", - " var address = site.addresses[0];", - " pm.expect(address).to.have.property(\"bpna\", pm.environment.get(\"SUPPLIER_BPNA\"));", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{CUSTOMER_PURIS_BACKEND}}/catena/partners?partnerBpnl={{SUPPLIER_BPNL}}", - "host": [ - "{{CUSTOMER_PURIS_BACKEND}}" - ], - "path": [ - "catena", - "partners" - ], - "query": [ - { - "key": "partnerBpnl", - "value": "{{SUPPLIER_BPNL}}" - } - ] - } - }, - "response": [] - }, - { - "name": "Add New Site to Supplier Partner", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"response is ok\", function() {", - " pm.response.to.have.status(200);", - "})", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "PUT", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n\"bpns\": \"{{SUPPLIER_BPNS2}}\",\n\"name\": \"Semiconductor Supplier Inc. Secondary Site\",\n\"addresses\": [\n {\n \"bpna\": \"{{SUPPLIER_BPNA2}}\",\n \"streetAndNumber\": \"Sunset Blvd. 345\",\n \"zipCodeAndCity\": \"90001 Los Angeles\",\n \"country\": \"USA\"\n }\n]\n}" - }, - "url": { - "raw": "{{CUSTOMER_PURIS_BACKEND}}/catena/partners/putSite?partnerBpnl={{SUPPLIER_BPNL}}", - "host": [ - "{{CUSTOMER_PURIS_BACKEND}}" - ], - "path": [ - "catena", - "partners", - "putSite" - ], - "query": [ - { - "key": "partnerBpnl", - "value": "{{SUPPLIER_BPNL}}" - } - ] - } - }, - "response": [] - }, - { - "name": "Get All Partners", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"response is ok\", function() {", - " pm.response.to.have.status(200);", - "})", - "", - "pm.test(\"Verify response contains two objects (puris owner, supplier partner)\", function () {", - " pm.expect(pm.response.json()).to.be.an(\"array\").with.lengthOf(2);", - "});", - "", - "pm.test(\"Verify supplier partner values (BPNL with one BPNS with one BPNA)\", function () {", - " const responseJson = pm.response.json();", - "", - " var supplierPartners = responseJson.filter(function (partner) {", - " return partner.bpnl === pm.environment.get(\"SUPPLIER_BPNL\");", - " });", - "", - " const supplierPartner = supplierPartners[0];", - " pm.expect(supplierPartner).to.have.property(\"bpnl\");", - "", - " pm.expect(supplierPartner.bpnl).to.equal(pm.environment.get(\"SUPPLIER_BPNL\"));", - "", - " pm.expect(supplierPartner.sites).to.be.an(\"array\").with.lengthOf(2);", - "", - " // check only the newly added site as the other one has been checked earlier", - " var sites = supplierPartner.sites.filter(function (site) {", - " return site.bpns === pm.environment.get(\"SUPPLIER_BPNS2\");", - " });", - "", - " const site = sites[0];", - " pm.expect(site.addresses).to.be.an(\"array\").with.lengthOf(1);", - "", - " var address = site.addresses[0];", - " pm.expect(address).to.have.property(\"bpna\", pm.environment.get(\"SUPPLIER_BPNA2\"));", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{CUSTOMER_PURIS_BACKEND}}/catena/partners/all", - "host": [ - "{{CUSTOMER_PURIS_BACKEND}}" - ], - "path": [ - "catena", - "partners", - "all" - ] - } - }, - "response": [] - }, - { - "name": "Create Material Partner Relation", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"response is ok\", function() {", - " pm.response.to.have.status(200);", - "})" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "url": { - "raw": "{{CUSTOMER_PURIS_BACKEND}}/catena/materialpartnerrelations?partnerBpnl={{SUPPLIER_BPNL}}&ownMaterialNumber={{MATERIAL_NUMBER_CUSTOMER}}&partnerMaterialNumber={{MATERIAL_NUMBER_SUPPLIER}}&partnerSupplies=true&partnerBuys=false", - "host": [ - "{{CUSTOMER_PURIS_BACKEND}}" - ], - "path": [ - "catena", - "materialpartnerrelations" - ], - "query": [ - { - "key": "partnerBpnl", - "value": "{{SUPPLIER_BPNL}}" - }, - { - "key": "ownMaterialNumber", - "value": "{{MATERIAL_NUMBER_CUSTOMER}}" - }, - { - "key": "partnerMaterialNumber", - "value": "{{MATERIAL_NUMBER_SUPPLIER}}" - }, - { - "key": "partnerSupplies", - "value": "true" - }, - { - "key": "partnerBuys", - "value": "false" - } - ] - } - }, - "response": [] - }, - { - "name": "Get Material Partner Mappings", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"response is ok\", function() {", - " pm.response.to.have.status(200);", - "})", - "", - "pm.test(\"Verify material partner mapping\", function () {", - " pm.response.to.have.jsonBody(pm.environment.get(\"SUPPLIER_BPNL\"), pm.collectionVariables.get(\"MATERIAL_NUMBER_SUPPLIER\"))", - " .and.have.jsonBody(pm.environment.get(\"CUSTOMER_BPNL\"), pm.collectionVariables.get(\"MATERIAL_NUMBER_CUSTOMER\"));", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{CUSTOMER_PURIS_BACKEND}}/catena/stockView/materialnumbers-mapping?ownMaterialNumber={{MATERIAL_NUMBER_CUSTOMER}}", - "host": [ - "{{CUSTOMER_PURIS_BACKEND}}" - ], - "path": [ - "catena", - "stockView", - "materialnumbers-mapping" - ], - "query": [ - { - "key": "ownMaterialNumber", - "value": "{{MATERIAL_NUMBER_CUSTOMER}}" - } - ] - } - }, - "response": [] - }, - { - "name": "Get Own Sites", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"response is ok\", function() {", - " pm.response.to.have.status(200);", - "})", - "", - "pm.test(\"Verify own site values (one BPNS with one BPNA)\", function () {", - " const responseJson = pm.response.json();", - "", - " const sites = responseJson.filter(function (site) {", - " return site.bpns === pm.environment.get(\"CUSTOMER_BPNS\");", - " });", - "", - " const site = sites[0];", - " pm.expect(site.addresses).to.be.an(\"array\").with.lengthOf(1);", - "", - " const address = site.addresses[0];", - " pm.expect(address).to.have.property(\"bpna\", pm.environment.get(\"CUSTOMER_BPNA\"));", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{CUSTOMER_PURIS_BACKEND}}/catena/partners/ownSites", - "host": [ - "{{CUSTOMER_PURIS_BACKEND}}" - ], - "path": [ - "catena", - "partners", - "ownSites" - ] - } - }, - "response": [] - }, - { - "name": "Create Semiconductor Material Stock Customer", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"response is ok\", function() {", - " pm.response.to.have.status(200);", - "});", - "", - "pm.test(\"Verify stock composition (material number with BPNS, BPNA and Partner BPNL)\", function () {", - " var responseJson = pm.response.json();", - "", - " pm.expect(responseJson).to.have.property(\"material\");", - " pm.expect(responseJson.material).to.have.property(\"materialNumberCustomer\");", - " pm.expect(responseJson.material.materialNumberCustomer).to.equal(pm.collectionVariables.get(\"MATERIAL_NUMBER_CUSTOMER\"));", - "", - " pm.expect(responseJson).to.have.property(\"stockLocationBpns\");", - " pm.expect(responseJson.stockLocationBpns).to.equal(pm.environment.get(\"CUSTOMER_BPNS\"));", - "", - " pm.expect(responseJson).to.have.property(\"stockLocationBpna\");", - " pm.expect(responseJson.stockLocationBpna).to.equal(pm.environment.get(\"CUSTOMER_BPNA\"));", - "", - " pm.expect(responseJson).to.have.property(\"partner\");", - " pm.expect(responseJson.partner).to.have.property(\"bpnl\");", - " pm.expect(responseJson.partner.bpnl).to.equal(pm.environment.get(\"SUPPLIER_BPNL\"));", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{\n \"material\": {\n \"materialFlag\": true,\n \"productFlag\": false,\n \"materialNumberCustomer\": \"{{MATERIAL_NUMBER_CUSTOMER}}\",\n \"materialNumberCx\": \"{{MATERIAL_NUMBER_CX}}\",\n \"name\": \"Semiconductor\"\n },\n \"quantity\": 50.0,\n \"measurementUnit\": \"unit:piece\",\n \"stockLocationBpns\": \"{{CUSTOMER_BPNS}}\",\n \"stockLocationBpna\": \"{{CUSTOMER_BPNA}}\",\n \"type\": \"MATERIAL\",\n \"lastUpdatedOn\": \"2023-12-18T13:12:48.466+00:00\",\n \"isBlocked\": true,\n \"customerOrderNumber\": \"\",\n \"customerOrderPositionNumber\": \"\",\n \"supplierOrderNumber\": \"\",\n \"partner\":{\n \"bpnl\": \"{{SUPPLIER_BPNL}}\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{CUSTOMER_PURIS_BACKEND}}/catena/stockView/material-stocks", - "host": [ - "{{CUSTOMER_PURIS_BACKEND}}" - ], - "path": [ - "catena", - "stockView", - "material-stocks" - ] - } - }, - "response": [] - }, - { - "name": "Get Semiconductor Material Stock Customer", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"response is ok\", function() {", - " pm.response.to.have.status(200);", - "});", - "", - "pm.test(\"Verify response contains one stock\", function () {", - " pm.expect(pm.response.json()).to.be.an(\"array\").with.lengthOf(1);", - "});" - ], - "type": "text/javascript" - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "method": "GET", - "header": [], - "body": { - "mode": "raw", - "raw": "{\n \"material\": {\n \"materialFlag\": true,\n \"productFlag\": false,\n \"materialNumberCustomer\": \"{{MATERIAL_NUMBER_CUSTOMER}}\",\n \"materialNumberCx\": \"{{MATERIAL_NUMBER_CX}}\",\n \"name\": \"Semiconductor\"\n },\n \"quantity\": 5.0,\n \"measurementUnit\": \"unit:piece\",\n \"stockLocationBpns\": \"{{CUSTOMER_BPNS}}\",\n \"stockLocationBpna\": \"{{CUSTOMER_BPNA}}\",\n \"type\": \"MATERIAL\",\n \"lastUpdatedOn\": \"2023-12-18T13:12:48.466+00:00\",\n \"isBlocked\": true,\n \"customerOrderNumber\": \"\",\n \"customerOrderPositionNumber\": \"\",\n \"supplierOrderNumber\": \"\",\n \"partner\":{\n \"bpnl\": \"{{SUPPLIER_BPNL}}\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{CUSTOMER_PURIS_BACKEND}}/catena/stockView/material-stocks", - "host": [ - "{{CUSTOMER_PURIS_BACKEND}}" - ], - "path": [ - "catena", - "stockView", - "material-stocks" - ] - } - }, - "response": [] - } - ], - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{CUSTOMER_PURIS_BACKEND_API_KEY}}", - "type": "string" - }, - { - "key": "key", - "value": "X-API-KEY", - "type": "string" - } - ] - }, - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - }, - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ] - }, - { - "name": "SupplierInit", - "item": [ - { - "name": "Create Semiconductor Product", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"response is ok\", function() {", - " pm.response.to.have.status(200);", - "})" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"materialFlag\": false,\n \"productFlag\": true,\n \"ownMaterialNumber\": \"{{MATERIAL_NUMBER_SUPPLIER}}\",\n \"materialNumberCx\": \"{{MATERIAL_NUMBER_CX}}\",\n \"name\": \"Semiconductor\"\n}" - }, - "url": { - "raw": "{{SUPPLIER_PURIS_BACKEND}}/catena/materials", - "host": [ - "{{SUPPLIER_PURIS_BACKEND}}" - ], - "path": [ - "catena", - "materials" - ] - } - }, - "response": [] - }, - { - "name": "Get All Materials", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"response is ok\", function() {", - " pm.response.to.have.status(200);", - "})", - "", - "pm.test(\"Verify response contains one material objects\", function () {", - " pm.expect(pm.response.json()).to.be.an(\"array\").with.lengthOf(1);", - "});", - "", - "pm.test(\"Verify ownMaterialNumber values\", function () {", - " const materialStock = pm.response.json()[0];", - "", - " pm.expect(materialStock).to.have.property(\"ownMaterialNumber\");", - " pm.expect(materialStock.ownMaterialNumber).to.equal(pm.collectionVariables.get(\"MATERIAL_NUMBER_SUPPLIER\"));", - "});", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{SUPPLIER_PURIS_BACKEND}}/catena/materials/all", - "host": [ - "{{SUPPLIER_PURIS_BACKEND}}" - ], - "path": [ - "catena", - "materials", - "all" - ] - } - }, - "response": [] - }, - { - "name": "Register Customer Partner", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"response is ok\", function() {", - " pm.response.to.have.status(200);", - "})" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"name\": \"Control Unit Creator Inc.\",\n \"edcUrl\": \"{{CUSTOMER_EDC_EXT_HOSTNAME}}/{{PROTOCOL_PATH}}\",\n \"bpnl\": \"{{CUSTOMER_BPNL}}\",\n \"addresses\": [],\n \"sites\": [\n {\n \"bpns\": \"{{CUSTOMER_BPNS}}\",\n \"name\": \"Control Unit Creator Headquarter\",\n \"addresses\": [\n {\n \"bpna\": \"{{CUSTOMER_BPNA}}\",\n \"streetAndNumber\": \"13th Street 47\",\n \"zipCodeAndCity\": \"10011 New York\",\n \"country\": \"USA\"\n }\n ]\n }\n ]\n}" - }, - "url": { - "raw": "{{SUPPLIER_PURIS_BACKEND}}/catena/partners", - "host": [ - "{{SUPPLIER_PURIS_BACKEND}}" - ], - "path": [ - "catena", - "partners" - ] - } - }, - "response": [] - }, - { - "name": "Get Customer Partner", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"response is ok\", function () {", - " pm.response.to.have.status(200);", - "})", - "", - "pm.test(\"Verify parnter values (BPNL with one BPNS with one BPNA)\", function () {", - " var responseJson = pm.response.json();", - "", - " pm.expect(responseJson).to.have.property(\"bpnl\");", - " pm.expect(responseJson.bpnl).to.equal(pm.environment.get(\"CUSTOMER_BPNL\"));", - "", - " pm.expect(responseJson.sites).to.be.an(\"array\").with.lengthOf(1);", - "", - " var site = responseJson.sites[0];", - " pm.expect(site).to.have.property(\"bpns\", pm.environment.get(\"CUSTOMER_BPNS\"));", - "", - " pm.expect(site.addresses).to.be.an(\"array\").with.lengthOf(1);", - "", - " var address = site.addresses[0];", - " pm.expect(address).to.have.property(\"bpna\", pm.environment.get(\"CUSTOMER_BPNA\"));", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{SUPPLIER_PURIS_BACKEND}}/catena/partners?partnerBpnl={{CUSTOMER_BPNL}}", - "host": [ - "{{SUPPLIER_PURIS_BACKEND}}" - ], - "path": [ - "catena", - "partners" - ], - "query": [ - { - "key": "partnerBpnl", - "value": "{{CUSTOMER_BPNL}}" - } - ] - } - }, - "response": [] - }, - { - "name": "Create Material Partner Relation", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"response is ok\", function() {", - " pm.response.to.have.status(200);", - "})" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "url": { - "raw": "{{SUPPLIER_PURIS_BACKEND}}/catena/materialpartnerrelations?partnerBpnl={{CUSTOMER_BPNL}}&ownMaterialNumber={{MATERIAL_NUMBER_SUPPLIER}}&partnerMaterialNumber={{MATERIAL_NUMBER_CUSTOMER}}&partnerSupplies=false&partnerBuys=true", - "host": [ - "{{SUPPLIER_PURIS_BACKEND}}" - ], - "path": [ - "catena", - "materialpartnerrelations" - ], - "query": [ - { - "key": "partnerBpnl", - "value": "{{CUSTOMER_BPNL}}" - }, - { - "key": "ownMaterialNumber", - "value": "{{MATERIAL_NUMBER_SUPPLIER}}" - }, - { - "key": "partnerMaterialNumber", - "value": "{{MATERIAL_NUMBER_CUSTOMER}}" - }, - { - "key": "partnerSupplies", - "value": "false" - }, - { - "key": "partnerBuys", - "value": "true" - } - ] - } - }, - "response": [] - }, - { - "name": "Get Material Partner Mappings", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"response is ok\", function() {", - " pm.response.to.have.status(200);", - "})", - "", - "pm.test(\"Verify material partner mapping\", function () {", - " pm.response.to.have.jsonBody(pm.environment.get(\"SUPPLIER_BPNL\"), pm.collectionVariables.get(\"MATERIAL_NUMBER_SUPPLIER\"))", - " .and.have.jsonBody(pm.environment.get(\"CUSTOMER_BPNL\"), pm.collectionVariables.get(\"MATERIAL_NUMBER_CUSTOMER\"));", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{SUPPLIER_PURIS_BACKEND}}/catena/stockView/materialnumbers-mapping?ownMaterialNumber={{MATERIAL_NUMBER_SUPPLIER}}", - "host": [ - "{{SUPPLIER_PURIS_BACKEND}}" - ], - "path": [ - "catena", - "stockView", - "materialnumbers-mapping" - ], - "query": [ - { - "key": "ownMaterialNumber", - "value": "{{MATERIAL_NUMBER_SUPPLIER}}" - } - ] - } - }, - "response": [] - }, - { - "name": "Get Own Sites", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"response is ok\", function() {", - " pm.response.to.have.status(200);", - "})", - "", - "pm.test(\"Verify own site values (one BPNS with one BPNA)\", function () {", - " const responseJson = pm.response.json();", - "", - " const sites = responseJson.filter(function (site) {", - " return site.bpns === pm.environment.get(\"SUPPLIER_BPNS\");", - " });", - "", - " const site = sites[0];", - " pm.expect(site.addresses).to.be.an(\"array\").with.lengthOf(1);", - "", - " const address = site.addresses[0];", - " pm.expect(address).to.have.property(\"bpna\", pm.environment.get(\"SUPPLIER_BPNA\"));", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "{{SUPPLIER_PURIS_BACKEND}}/catena/partners/ownSites", - "host": [ - "{{SUPPLIER_PURIS_BACKEND}}" - ], - "path": [ - "catena", - "partners", - "ownSites" - ] - } - }, - "response": [] - }, - { - "name": "Create Semiconductor Product Stock Supplier", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"response is ok\", function() {", - " pm.response.to.have.status(200);", - "})" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{\n \"material\": {\n \"materialFlag\": false,\n \"productFlag\": true,\n \"materialNumberCustomer\": \"{{MATERIAL_NUMBER_CUSTOMER}}\",\n \"materialNumberSupplier\": \"{{MATERIAL_NUMBER_SUPPLIER}}\",\n \"materialNumberCx\": \"{{MATERIAL_NUMBER_CX}}\",\n \"name\": \"Semiconductor\"\n },\n \"quantity\": 5.0,\n \"measurementUnit\": \"unit:piece\",\n \"stockLocationBpns\": \"{{SUPPLIER_BPNS}}\",\n \"stockLocationBpna\": \"{{SUPPLIER_BPNA}}\",\n \"type\": \"PRODUCT\",\n \"lastUpdatedOn\": \"2023-12-18T14:12:48.466+00:00\",\n \"isBlocked\": false,\n \"customerOrderNumber\": \"\",\n \"customerOrderPositionNumber\": \"\",\n \"supplierOrderNumber\": \"\",\n \"partner\":{\n \"bpnl\": \"{{CUSTOMER_BPNL}}\"\n }\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{SUPPLIER_PURIS_BACKEND}}/catena/stockView/product-stocks", - "host": [ - "{{SUPPLIER_PURIS_BACKEND}}" - ], - "path": [ - "catena", - "stockView", - "product-stocks" - ] - } - }, - "response": [] - }, - { - "name": "Get Semiconductor Product Stocks (Supplier)", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"response is ok\", function() {", - " pm.response.to.have.status(200);", - "});", - "", - "pm.test(\"Verify response contains one material objects\", function () {", - " pm.expect(pm.response.json()).to.be.an(\"array\").with.lengthOf(1);", - "});", - "", - "pm.test(\"Verify stock composition (material number with BPNS, BPNA and Partner BPNL)\", function () {", - " const stock = pm.response.json()[0];", - "", - " pm.expect(stock).to.have.property(\"material\");", - " pm.expect(stock.material).to.have.property(\"materialNumberCustomer\");", - " pm.expect(stock.material.materialNumberSupplier).to.equal(pm.collectionVariables.get(\"MATERIAL_NUMBER_SUPPLIER\"));", - "", - " pm.expect(stock).to.have.property(\"stockLocationBpns\");", - " pm.expect(stock.stockLocationBpns).to.equal(pm.environment.get(\"SUPPLIER_BPNS\"));", - "", - " pm.expect(stock).to.have.property(\"stockLocationBpna\");", - " pm.expect(stock.stockLocationBpna).to.equal(pm.environment.get(\"SUPPLIER_BPNA\"));", - "", - " pm.expect(stock).to.have.property(\"partner\");", - " pm.expect(stock.partner).to.have.property(\"bpnl\");", - " pm.expect(stock.partner.bpnl).to.equal(pm.environment.get(\"CUSTOMER_BPNL\"));", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "GET", - "header": [ - { - "key": "", - "value": "", - "type": "text" - } - ], - "url": { - "raw": "{{SUPPLIER_PURIS_BACKEND}}/catena/stockView/product-stocks", - "host": [ - "{{SUPPLIER_PURIS_BACKEND}}" - ], - "path": [ - "catena", - "stockView", - "product-stocks" - ] - } - }, - "response": [] - } - ], - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{SUPPLIER_PURIS_BACKEND_API_KEY}}", - "type": "string" - }, - { - "key": "key", - "value": "X-API-KEY", - "type": "string" - } - ] - }, - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - }, - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ] - } - ] - }, - { - "name": "Test_02-EDC", - "item": [ - { - "name": "Query Catalog for request offer as Customer from Supplier", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"response is ok\", function() {", - " pm.response.to.have.status(200);", - "});", - "", - "pm.test(\"Verify response contains one data offer\", function () {", - " console.info(pm.response.json());", - " console.info(pm.response.json()['dcat:dataset']);", - " pm.expect(pm.response.json()['dcat:dataset']).to.be.an(\"object\");", - "});", - "", - "pm.test(\"Verify that offer matches search criteria (dct:type, cx-common:version)\", function () {", - " const contractOffer = pm.response.json()['dcat:dataset'];", - "", - " pm.expect(contractOffer).to.exist;", - "", - " pm.expect(contractOffer[\"https://w3id.org/catenax/ontology/common#version\"]).to.equal(\"1.0\");", - " pm.expect(contractOffer[\"dct:type\"][\"@id\"]).to.equal(\"https://w3id.org/catenax/taxonomy#ItemStockRequestApi\"); ", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{\r\n \"@context\": {},\r\n \"@type\": \"CatalogRequest\",\r\n \"protocol\": \"dataspace-protocol-http\",\r\n \"counterPartyAddress\": \"{{CUSTOMER_EDC_EXT_HOSTNAME}}/{{PROTOCOL_PATH}}\",\r\n \"querySpec\": {\r\n \"offset\": 0,\r\n \"limit\": 100,\r\n \"filter\": \"\",\r\n \"range\": {\r\n \"from\": 0,\r\n \"to\": 100\r\n },\r\n \"filterExpression\": [\r\n {\r\n \"@type\" : \"CriterionDto\",\r\n \"operandLeft\": \"asset:prop:type\",\r\n \"operator\": \"=\",\r\n \"operandRight\": \"data.res.itemStockRequestApi\"\r\n },\r\n {\r\n \"@type\" : \"CriterionDto\",\r\n \"operandLeft\": \"https://w3id.org/catenax/ontology/common#version\",\r\n \"operator\": \"=\",\r\n \"operandRight\": \"1.0\"\r\n }\r\n ]\r\n }\r\n}\r\n", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{SUPPLIER_EDC}}/{{MANAGEMENT_PATH}}/v2/catalog/request", - "host": [ - "{{SUPPLIER_EDC}}" - ], - "path": [ - "{{MANAGEMENT_PATH}}", - "v2", - "catalog", - "request" - ] - } - }, - "response": [] - }, - { - "name": "Query Catalog for response offer as Customer from Supplier", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"response is ok\", function() {", - " pm.response.to.have.status(200);", - "});", - "", - "pm.test(\"Verify response contains one data offer\", function () {", - " console.info(pm.response.json());", - " console.info(pm.response.json()['dcat:dataset']);", - " pm.expect(pm.response.json()['dcat:dataset']).to.be.an(\"object\");", - "});", - "", - "pm.test(\"Verify that offer matches search criteria (dct:type, cx-common:version)\", function () {", - " const contractOffer = pm.response.json()['dcat:dataset'];", - "", - " pm.expect(contractOffer).to.exist;", - "", - " pm.expect(contractOffer[\"https://w3id.org/catenax/ontology/common#version\"]).to.equal(\"1.0\");", - " pm.expect(contractOffer[\"dct:type\"][\"@id\"]).to.equal(\"https://w3id.org/catenax/taxonomy#ItemStockResponseApi\"); ", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{\r\n \"@context\": {},\r\n \"@type\": \"CatalogRequest\",\r\n \"protocol\": \"dataspace-protocol-http\",\r\n \"counterPartyAddress\": \"{{CUSTOMER_EDC_EXT_HOSTNAME}}/{{PROTOCOL_PATH}}\",\r\n \"querySpec\": {\r\n \"offset\": 0,\r\n \"limit\": 100,\r\n \"filter\": \"\",\r\n \"range\": {\r\n \"from\": 0,\r\n \"to\": 100\r\n },\r\n \"filterExpression\": [\r\n {\r\n \"@type\" : \"CriterionDto\",\r\n \"operandLeft\": \"asset:prop:type\",\r\n \"operator\": \"=\",\r\n \"operandRight\": \"data.res.itemStockResponseApi\"\r\n },\r\n {\r\n \"@type\" : \"CriterionDto\",\r\n \"operandLeft\": \"https://w3id.org/catenax/ontology/common#version\",\r\n \"operator\": \"=\",\r\n \"operandRight\": \"1.0\" \r\n }\r\n ]\r\n }\r\n}\r\n", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{SUPPLIER_EDC}}/{{MANAGEMENT_PATH}}/v2/catalog/request", - "host": [ - "{{SUPPLIER_EDC}}" - ], - "path": [ - "{{MANAGEMENT_PATH}}", - "v2", - "catalog", - "request" - ] - } - }, - "response": [] - } - ], - "auth": { - "type": "apikey", - "apikey": [ - { - "key": "value", - "value": "{{SUPPLIER_EDC_API_KEY}}", - "type": "string" - }, - { - "key": "key", - "value": "X-Api-Key", - "type": "string" - } - ] - }, - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - }, - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ] - } - ], - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - }, - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ], - "variable": [ - { - "key": "MATERIAL_NUMBER_CUSTOMER", - "value": "MNR-7307-AU340474.002", - "type": "string" - }, - { - "key": "MATERIAL_NUMBER_SUPPLIER", - "value": "MNR-8101-ID146955.001", - "type": "string" - }, - { - "key": "MATERIAL_NUMBER_CX", - "value": "860fb504-b884-4009-9313-c6fb6cdc776b", - "type": "string" - } - ] -} \ No newline at end of file + "info": { + "_postman_id": "08da5aef-cb4d-46ea-a2e1-a1d47e73c97a", + "name": "puris-integration-test", + "description": "The collection assumes the following roles:\n\n- Customer PURIS (upper tier)\n \n- Supplier PURIS (lower tier)\n \n\nIt creates the opposite partner and the respective view on the semiconductor material or product.\n\nTo run the tests correctly, take the environment and fill the respective secrets:\n\n- CUSTOMER_EDC_API_KEY\n- CUSTOMER_PURIS_BACKEND_API_KEY\n- SUPPLIER_EDC_API_KEY\n- SUPPLIER_PURIS_BACKEND_API_KEY\n \n\nWhen using the another environment, update / create a new environment.", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "26605468" + }, + "item": [ + { + "name": "Test_01-MAD", + "item": [ + { + "name": "CustomerInit", + "item": [ + { + "name": "Create Semiconductor Material", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "})" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"materialFlag\": true,\n \"productFlag\": false,\n \"ownMaterialNumber\": \"{{MATERIAL_NUMBER_CUSTOMER}}\",\n \"materialNumberCx\": \"{{MATERIAL_NUMBER_CX}}\",\n \"name\": \"Semiconductor\"\n}" + }, + "url": { + "raw": "{{CUSTOMER_PURIS_BACKEND}}/catena/materials", + "host": [ + "{{CUSTOMER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "materials" + ] + } + }, + "response": [] + }, + { + "name": "Create Control Unit Product", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "})" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"materialFlag\": false,\n \"productFlag\": true,\n \"ownMaterialNumber\": \"MNR-4177-S\",\n \"materialNumberCx\": null,\n \"name\": \"Central Control Unit\"\n}" + }, + "url": { + "raw": "{{CUSTOMER_PURIS_BACKEND}}/catena/materials", + "host": [ + "{{CUSTOMER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "materials" + ] + } + }, + "response": [] + }, + { + "name": "Get All Materials", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "})", + "", + "pm.test(\"Verify response contains two objects\", function () {", + " pm.expect(pm.response.json()).to.be.an(\"array\").with.lengthOf(2);", + "});", + "", + "pm.test(\"Verify ownMaterialNumber values\", function () {", + " var responseJson = pm.response.json();", + "", + " var foundValues = [];", + " ", + " responseJson.forEach(function (obj) {", + " pm.expect(obj).to.have.property(\"ownMaterialNumber\");", + " pm.expect(obj.ownMaterialNumber).to.be.oneOf([\"MNR-4177-S\", pm.collectionVariables.get(\"MATERIAL_NUMBER_CUSTOMER\")]);", + "", + " // Put found value into foundValues to ensure that each value is only found once", + " pm.expect(foundValues).to.not.include(obj.ownMaterialNumber);", + " foundValues.push(obj.ownMaterialNumber);", + " });", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{CUSTOMER_PURIS_BACKEND}}/catena/materials/all", + "host": [ + "{{CUSTOMER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "materials", + "all" + ] + } + }, + "response": [] + }, + { + "name": "Register Supplier Partner", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "})" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"Semiconductor Supplier Inc.\",\n \"edcUrl\": \"{{SUPPLIER_EDC_EXT_HOSTNAME}}/{{PROTOCOL_PATH}}\",\n \"bpnl\": \"{{SUPPLIER_BPNL}}\",\n \"addresses\": [],\n \"sites\": [\n {\n \"bpns\": \"{{SUPPLIER_BPNS}}\",\n \"name\": \"Semiconductor Supplier Inc. Headquarter\",\n \"addresses\": [\n {\n \"bpna\": \"{{SUPPLIER_BPNA}}\",\n \"streetAndNumber\": \"Wall Street 101\",\n \"zipCodeAndCity\": \"10001 New York\",\n \"country\": \"USA\"\n }\n ]\n }\n ]\n}" + }, + "url": { + "raw": "{{CUSTOMER_PURIS_BACKEND}}/catena/partners", + "host": [ + "{{CUSTOMER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "partners" + ] + } + }, + "response": [] + }, + { + "name": "Get Supplier Partner", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function () {", + " pm.response.to.have.status(200);", + "})", + "", + "pm.test(\"Verify partner values (BPNL with one BPNS with one BPNA)\", function () {", + " var responseJson = pm.response.json();", + "", + " pm.expect(responseJson).to.have.property(\"bpnl\");", + " pm.expect(responseJson.bpnl).to.equal(pm.environment.get(\"SUPPLIER_BPNL\"));", + "", + " pm.expect(responseJson.sites).to.be.an(\"array\").with.lengthOf(1);", + "", + " var site = responseJson.sites[0];", + " pm.expect(site).to.have.property(\"bpns\", pm.environment.get(\"SUPPLIER_BPNS\"));", + "", + " pm.expect(site.addresses).to.be.an(\"array\").with.lengthOf(1);", + "", + " var address = site.addresses[0];", + " pm.expect(address).to.have.property(\"bpna\", pm.environment.get(\"SUPPLIER_BPNA\"));", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{CUSTOMER_PURIS_BACKEND}}/catena/partners?partnerBpnl={{SUPPLIER_BPNL}}", + "host": [ + "{{CUSTOMER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "partners" + ], + "query": [ + { + "key": "partnerBpnl", + "value": "{{SUPPLIER_BPNL}}" + } + ] + } + }, + "response": [] + }, + { + "name": "Add New Site to Supplier Partner", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "})", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\"bpns\": \"{{SUPPLIER_BPNS2}}\",\n\"name\": \"Semiconductor Supplier Inc. Secondary Site\",\n\"addresses\": [\n {\n \"bpna\": \"{{SUPPLIER_BPNA2}}\",\n \"streetAndNumber\": \"Sunset Blvd. 345\",\n \"zipCodeAndCity\": \"90001 Los Angeles\",\n \"country\": \"USA\"\n }\n]\n}" + }, + "url": { + "raw": "{{CUSTOMER_PURIS_BACKEND}}/catena/partners/putSite?partnerBpnl={{SUPPLIER_BPNL}}", + "host": [ + "{{CUSTOMER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "partners", + "putSite" + ], + "query": [ + { + "key": "partnerBpnl", + "value": "{{SUPPLIER_BPNL}}" + } + ] + } + }, + "response": [] + }, + { + "name": "Get All Partners", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "})", + "", + "pm.test(\"Verify response contains two objects (puris owner, supplier partner)\", function () {", + " pm.expect(pm.response.json()).to.be.an(\"array\").with.lengthOf(2);", + "});", + "", + "pm.test(\"Verify supplier partner values (BPNL with one BPNS with one BPNA)\", function () {", + " const responseJson = pm.response.json();", + "", + " var supplierPartners = responseJson.filter(function (partner) {", + " return partner.bpnl === pm.environment.get(\"SUPPLIER_BPNL\");", + " });", + "", + " const supplierPartner = supplierPartners[0];", + " pm.expect(supplierPartner).to.have.property(\"bpnl\");", + "", + " pm.expect(supplierPartner.bpnl).to.equal(pm.environment.get(\"SUPPLIER_BPNL\"));", + "", + " pm.expect(supplierPartner.sites).to.be.an(\"array\").with.lengthOf(2);", + "", + " // check only the newly added site as the other one has been checked earlier", + " var sites = supplierPartner.sites.filter(function (site) {", + " return site.bpns === pm.environment.get(\"SUPPLIER_BPNS2\");", + " });", + "", + " const site = sites[0];", + " pm.expect(site.addresses).to.be.an(\"array\").with.lengthOf(1);", + "", + " var address = site.addresses[0];", + " pm.expect(address).to.have.property(\"bpna\", pm.environment.get(\"SUPPLIER_BPNA2\"));", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{CUSTOMER_PURIS_BACKEND}}/catena/partners/all", + "host": [ + "{{CUSTOMER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "partners", + "all" + ] + } + }, + "response": [] + }, + { + "name": "Create Material Partner Relation", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "})" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "url": { + "raw": "{{CUSTOMER_PURIS_BACKEND}}/catena/materialpartnerrelations?partnerBpnl={{SUPPLIER_BPNL}}&ownMaterialNumber={{MATERIAL_NUMBER_CUSTOMER}}&partnerMaterialNumber={{MATERIAL_NUMBER_SUPPLIER}}&partnerSupplies=true&partnerBuys=false", + "host": [ + "{{CUSTOMER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "materialpartnerrelations" + ], + "query": [ + { + "key": "partnerBpnl", + "value": "{{SUPPLIER_BPNL}}" + }, + { + "key": "ownMaterialNumber", + "value": "{{MATERIAL_NUMBER_CUSTOMER}}" + }, + { + "key": "partnerMaterialNumber", + "value": "{{MATERIAL_NUMBER_SUPPLIER}}" + }, + { + "key": "partnerSupplies", + "value": "true" + }, + { + "key": "partnerBuys", + "value": "false" + } + ] + } + }, + "response": [] + }, + { + "name": "Get Material Partner Mappings", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "})", + "", + "pm.test(\"Verify material partner mapping\", function () {", + " pm.response.to.have.jsonBody(pm.environment.get(\"SUPPLIER_BPNL\"), pm.collectionVariables.get(\"MATERIAL_NUMBER_SUPPLIER\"))", + " .and.have.jsonBody(pm.environment.get(\"CUSTOMER_BPNL\"), pm.collectionVariables.get(\"MATERIAL_NUMBER_CUSTOMER\"));", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{CUSTOMER_PURIS_BACKEND}}/catena/stockView/materialnumbers-mapping?ownMaterialNumber={{MATERIAL_NUMBER_CUSTOMER}}", + "host": [ + "{{CUSTOMER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "stockView", + "materialnumbers-mapping" + ], + "query": [ + { + "key": "ownMaterialNumber", + "value": "{{MATERIAL_NUMBER_CUSTOMER}}" + } + ] + } + }, + "response": [] + }, + { + "name": "Get Own Sites", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "})", + "", + "pm.test(\"Verify own site values (one BPNS with one BPNA)\", function () {", + " const responseJson = pm.response.json();", + "", + " const sites = responseJson.filter(function (site) {", + " return site.bpns === pm.environment.get(\"CUSTOMER_BPNS\");", + " });", + "", + " const site = sites[0];", + " pm.expect(site.addresses).to.be.an(\"array\").with.lengthOf(1);", + "", + " const address = site.addresses[0];", + " pm.expect(address).to.have.property(\"bpna\", pm.environment.get(\"CUSTOMER_BPNA\"));", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{CUSTOMER_PURIS_BACKEND}}/catena/partners/ownSites", + "host": [ + "{{CUSTOMER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "partners", + "ownSites" + ] + } + }, + "response": [] + }, + { + "name": "Create Semiconductor Material Stock Customer", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Verify stock composition (material number with BPNS, BPNA and Partner BPNL)\", function () {", + " var responseJson = pm.response.json();", + "", + " pm.expect(responseJson).to.have.property(\"material\");", + " pm.expect(responseJson.material).to.have.property(\"materialNumberCustomer\");", + " pm.expect(responseJson.material.materialNumberCustomer).to.equal(pm.collectionVariables.get(\"MATERIAL_NUMBER_CUSTOMER\"));", + "", + " pm.expect(responseJson).to.have.property(\"stockLocationBpns\");", + " pm.expect(responseJson.stockLocationBpns).to.equal(pm.environment.get(\"CUSTOMER_BPNS\"));", + "", + " pm.expect(responseJson).to.have.property(\"stockLocationBpna\");", + " pm.expect(responseJson.stockLocationBpna).to.equal(pm.environment.get(\"CUSTOMER_BPNA\"));", + "", + " pm.expect(responseJson).to.have.property(\"partner\");", + " pm.expect(responseJson.partner).to.have.property(\"bpnl\");", + " pm.expect(responseJson.partner.bpnl).to.equal(pm.environment.get(\"SUPPLIER_BPNL\"));", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"material\": {\n \"materialFlag\": true,\n \"productFlag\": false,\n \"materialNumberCustomer\": \"{{MATERIAL_NUMBER_CUSTOMER}}\",\n \"materialNumberCx\": \"{{MATERIAL_NUMBER_CX}}\",\n \"name\": \"Semiconductor\"\n },\n \"quantity\": 50.0,\n \"measurementUnit\": \"unit:piece\",\n \"stockLocationBpns\": \"{{CUSTOMER_BPNS}}\",\n \"stockLocationBpna\": \"{{CUSTOMER_BPNA}}\",\n \"type\": \"MATERIAL\",\n \"lastUpdatedOn\": \"2023-12-18T13:12:48.466+00:00\",\n \"isBlocked\": true,\n \"customerOrderNumber\": \"\",\n \"customerOrderPositionNumber\": \"\",\n \"supplierOrderNumber\": \"\",\n \"partner\":{\n \"bpnl\": \"{{SUPPLIER_BPNL}}\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{CUSTOMER_PURIS_BACKEND}}/catena/stockView/material-stocks", + "host": [ + "{{CUSTOMER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "stockView", + "material-stocks" + ] + } + }, + "response": [] + }, + { + "name": "Get Semiconductor Material Stock Customer", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Verify response contains one stock\", function () {", + " pm.expect(pm.response.json()).to.be.an(\"array\").with.lengthOf(1);", + "});" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"material\": {\n \"materialFlag\": true,\n \"productFlag\": false,\n \"materialNumberCustomer\": \"{{MATERIAL_NUMBER_CUSTOMER}}\",\n \"materialNumberCx\": \"{{MATERIAL_NUMBER_CX}}\",\n \"name\": \"Semiconductor\"\n },\n \"quantity\": 5.0,\n \"measurementUnit\": \"unit:piece\",\n \"stockLocationBpns\": \"{{CUSTOMER_BPNS}}\",\n \"stockLocationBpna\": \"{{CUSTOMER_BPNA}}\",\n \"type\": \"MATERIAL\",\n \"lastUpdatedOn\": \"2023-12-18T13:12:48.466+00:00\",\n \"isBlocked\": true,\n \"customerOrderNumber\": \"\",\n \"customerOrderPositionNumber\": \"\",\n \"supplierOrderNumber\": \"\",\n \"partner\":{\n \"bpnl\": \"{{SUPPLIER_BPNL}}\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{CUSTOMER_PURIS_BACKEND}}/catena/stockView/material-stocks", + "host": [ + "{{CUSTOMER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "stockView", + "material-stocks" + ] + } + }, + "response": [] + } + ], + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{CUSTOMER_PURIS_BACKEND_API_KEY}}", + "type": "string" + }, + { + "key": "key", + "value": "X-API-KEY", + "type": "string" + } + ] + }, + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "SupplierInit", + "item": [ + { + "name": "Create Semiconductor Product", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "})" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"materialFlag\": false,\n \"productFlag\": true,\n \"ownMaterialNumber\": \"{{MATERIAL_NUMBER_SUPPLIER}}\",\n \"materialNumberCx\": \"{{MATERIAL_NUMBER_CX}}\",\n \"name\": \"Semiconductor\"\n}" + }, + "url": { + "raw": "{{SUPPLIER_PURIS_BACKEND}}/catena/materials", + "host": [ + "{{SUPPLIER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "materials" + ] + } + }, + "response": [] + }, + { + "name": "Get All Materials", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "})", + "", + "pm.test(\"Verify response contains one material objects\", function () {", + " pm.expect(pm.response.json()).to.be.an(\"array\").with.lengthOf(1);", + "});", + "", + "pm.test(\"Verify ownMaterialNumber values\", function () {", + " const material = pm.response.json()[0];", + "", + " pm.expect(material).to.have.property(\"ownMaterialNumber\");", + " pm.expect(material.ownMaterialNumber).to.equal(pm.collectionVariables.get(\"MATERIAL_NUMBER_SUPPLIER\"));", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{SUPPLIER_PURIS_BACKEND}}/catena/materials/all", + "host": [ + "{{SUPPLIER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "materials", + "all" + ] + } + }, + "response": [] + }, + { + "name": "Register Customer Partner", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "})" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"name\": \"Control Unit Creator Inc.\",\n \"edcUrl\": \"{{CUSTOMER_EDC_EXT_HOSTNAME}}/{{PROTOCOL_PATH}}\",\n \"bpnl\": \"{{CUSTOMER_BPNL}}\",\n \"addresses\": [],\n \"sites\": [\n {\n \"bpns\": \"{{CUSTOMER_BPNS}}\",\n \"name\": \"Control Unit Creator Headquarter\",\n \"addresses\": [\n {\n \"bpna\": \"{{CUSTOMER_BPNA}}\",\n \"streetAndNumber\": \"13th Street 47\",\n \"zipCodeAndCity\": \"10011 New York\",\n \"country\": \"USA\"\n }\n ]\n }\n ]\n}" + }, + "url": { + "raw": "{{SUPPLIER_PURIS_BACKEND}}/catena/partners", + "host": [ + "{{SUPPLIER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "partners" + ] + } + }, + "response": [] + }, + { + "name": "Get Customer Partner", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function () {", + " pm.response.to.have.status(200);", + "})", + "", + "pm.test(\"Verify partner values (BPNL with one BPNS with one BPNA)\", function () {", + " var responseJson = pm.response.json();", + "", + " pm.expect(responseJson).to.have.property(\"bpnl\");", + " pm.expect(responseJson.bpnl).to.equal(pm.environment.get(\"CUSTOMER_BPNL\"));", + "", + " pm.expect(responseJson.sites).to.be.an(\"array\").with.lengthOf(1);", + "", + " var site = responseJson.sites[0];", + " pm.expect(site).to.have.property(\"bpns\", pm.environment.get(\"CUSTOMER_BPNS\"));", + "", + " pm.expect(site.addresses).to.be.an(\"array\").with.lengthOf(1);", + "", + " var address = site.addresses[0];", + " pm.expect(address).to.have.property(\"bpna\", pm.environment.get(\"CUSTOMER_BPNA\"));", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{SUPPLIER_PURIS_BACKEND}}/catena/partners?partnerBpnl={{CUSTOMER_BPNL}}", + "host": [ + "{{SUPPLIER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "partners" + ], + "query": [ + { + "key": "partnerBpnl", + "value": "{{CUSTOMER_BPNL}}" + } + ] + } + }, + "response": [] + }, + { + "name": "Create Material Partner Relation", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "})" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "url": { + "raw": "{{SUPPLIER_PURIS_BACKEND}}/catena/materialpartnerrelations?partnerBpnl={{CUSTOMER_BPNL}}&ownMaterialNumber={{MATERIAL_NUMBER_SUPPLIER}}&partnerMaterialNumber={{MATERIAL_NUMBER_CUSTOMER}}&partnerSupplies=false&partnerBuys=true", + "host": [ + "{{SUPPLIER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "materialpartnerrelations" + ], + "query": [ + { + "key": "partnerBpnl", + "value": "{{CUSTOMER_BPNL}}" + }, + { + "key": "ownMaterialNumber", + "value": "{{MATERIAL_NUMBER_SUPPLIER}}" + }, + { + "key": "partnerMaterialNumber", + "value": "{{MATERIAL_NUMBER_CUSTOMER}}" + }, + { + "key": "partnerSupplies", + "value": "false" + }, + { + "key": "partnerBuys", + "value": "true" + } + ] + } + }, + "response": [] + }, + { + "name": "Get Material Partner Mappings", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "})", + "", + "pm.test(\"Verify material partner mapping\", function () {", + " pm.response.to.have.jsonBody(pm.environment.get(\"SUPPLIER_BPNL\"), pm.collectionVariables.get(\"MATERIAL_NUMBER_SUPPLIER\"))", + " .and.have.jsonBody(pm.environment.get(\"CUSTOMER_BPNL\"), pm.collectionVariables.get(\"MATERIAL_NUMBER_CUSTOMER\"));", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{SUPPLIER_PURIS_BACKEND}}/catena/stockView/materialnumbers-mapping?ownMaterialNumber={{MATERIAL_NUMBER_SUPPLIER}}", + "host": [ + "{{SUPPLIER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "stockView", + "materialnumbers-mapping" + ], + "query": [ + { + "key": "ownMaterialNumber", + "value": "{{MATERIAL_NUMBER_SUPPLIER}}" + } + ] + } + }, + "response": [] + }, + { + "name": "Get Own Sites", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "})", + "", + "pm.test(\"Verify own site values (one BPNS with one BPNA)\", function () {", + " const responseJson = pm.response.json();", + "", + " const sites = responseJson.filter(function (site) {", + " return site.bpns === pm.environment.get(\"SUPPLIER_BPNS\");", + " });", + "", + " const site = sites[0];", + " pm.expect(site.addresses).to.be.an(\"array\").with.lengthOf(1);", + "", + " const address = site.addresses[0];", + " pm.expect(address).to.have.property(\"bpna\", pm.environment.get(\"SUPPLIER_BPNA\"));", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{SUPPLIER_PURIS_BACKEND}}/catena/partners/ownSites", + "host": [ + "{{SUPPLIER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "partners", + "ownSites" + ] + } + }, + "response": [] + }, + { + "name": "Create Semiconductor Product Stock Supplier", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "})" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"material\": {\n \"materialFlag\": false,\n \"productFlag\": true,\n \"materialNumberCustomer\": \"{{MATERIAL_NUMBER_CUSTOMER}}\",\n \"materialNumberSupplier\": \"{{MATERIAL_NUMBER_SUPPLIER}}\",\n \"materialNumberCx\": \"{{MATERIAL_NUMBER_CX}}\",\n \"name\": \"Semiconductor\"\n },\n \"quantity\": 5.0,\n \"measurementUnit\": \"unit:piece\",\n \"stockLocationBpns\": \"{{SUPPLIER_BPNS}}\",\n \"stockLocationBpna\": \"{{SUPPLIER_BPNA}}\",\n \"type\": \"PRODUCT\",\n \"lastUpdatedOn\": \"2023-12-18T14:12:48.466+00:00\",\n \"isBlocked\": false,\n \"customerOrderNumber\": \"\",\n \"customerOrderPositionNumber\": \"\",\n \"supplierOrderNumber\": \"\",\n \"partner\":{\n \"bpnl\": \"{{CUSTOMER_BPNL}}\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{SUPPLIER_PURIS_BACKEND}}/catena/stockView/product-stocks", + "host": [ + "{{SUPPLIER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "stockView", + "product-stocks" + ] + } + }, + "response": [] + }, + { + "name": "Get Semiconductor Product Stocks (Supplier)", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Verify response contains one material objects\", function () {", + " pm.expect(pm.response.json()).to.be.an(\"array\").with.lengthOf(1);", + "});", + "", + "pm.test(\"Verify stock composition (material number with BPNS, BPNA and Partner BPNL)\", function () {", + " const stock = pm.response.json()[0];", + "", + " pm.expect(stock).to.have.property(\"material\");", + " pm.expect(stock.material).to.have.property(\"materialNumberCustomer\");", + " pm.expect(stock.material.materialNumberSupplier).to.equal(pm.collectionVariables.get(\"MATERIAL_NUMBER_SUPPLIER\"));", + "", + " pm.expect(stock).to.have.property(\"stockLocationBpns\");", + " pm.expect(stock.stockLocationBpns).to.equal(pm.environment.get(\"SUPPLIER_BPNS\"));", + "", + " pm.expect(stock).to.have.property(\"stockLocationBpna\");", + " pm.expect(stock.stockLocationBpna).to.equal(pm.environment.get(\"SUPPLIER_BPNA\"));", + "", + " pm.expect(stock).to.have.property(\"partner\");", + " pm.expect(stock.partner).to.have.property(\"bpnl\");", + " pm.expect(stock.partner.bpnl).to.equal(pm.environment.get(\"CUSTOMER_BPNL\"));", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "", + "value": "", + "type": "text" + } + ], + "url": { + "raw": "{{SUPPLIER_PURIS_BACKEND}}/catena/stockView/product-stocks", + "host": [ + "{{SUPPLIER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "stockView", + "product-stocks" + ] + } + }, + "response": [] + } + ], + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{SUPPLIER_PURIS_BACKEND_API_KEY}}", + "type": "string" + }, + { + "key": "key", + "value": "X-API-KEY", + "type": "string" + } + ] + }, + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + } + ] + }, + { + "name": "Test_02-EDC", + "item": [ + { + "name": "Query Catalog for request offer as Customer from Supplier", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Verify response contains one data offer\", function () {", + " console.info(pm.response.json());", + " console.info(pm.response.json()['dcat:dataset']);", + " pm.expect(pm.response.json()['dcat:dataset']).to.be.an(\"object\");", + "});", + "", + "pm.test(\"Verify that offer matches search criteria (dct:type, cx-common:version)\", function () {", + " const contractOffer = pm.response.json()['dcat:dataset'];", + "", + " pm.expect(contractOffer).to.exist;", + "", + " pm.expect(contractOffer[\"https://w3id.org/catenax/ontology/common#version\"]).to.equal(\"1.0\");", + " pm.expect(contractOffer[\"dct:type\"][\"@id\"]).to.equal(\"https://w3id.org/catenax/taxonomy#ItemStockRequestApi\"); ", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"@context\": {},\r\n \"@type\": \"CatalogRequest\",\r\n \"protocol\": \"dataspace-protocol-http\",\r\n \"counterPartyAddress\": \"{{CUSTOMER_EDC_EXT_HOSTNAME}}/{{PROTOCOL_PATH}}\",\r\n \"querySpec\": {\r\n \"offset\": 0,\r\n \"limit\": 100,\r\n \"filter\": \"\",\r\n \"range\": {\r\n \"from\": 0,\r\n \"to\": 100\r\n },\r\n \"filterExpression\": [\r\n {\r\n \"@type\" : \"CriterionDto\",\r\n \"operandLeft\": \"asset:prop:type\",\r\n \"operator\": \"=\",\r\n \"operandRight\": \"data.res.itemStockRequestApi\"\r\n },\r\n {\r\n \"@type\" : \"CriterionDto\",\r\n \"operandLeft\": \"https://w3id.org/catenax/ontology/common#version\",\r\n \"operator\": \"=\",\r\n \"operandRight\": \"1.0\"\r\n }\r\n ]\r\n }\r\n}\r\n", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{SUPPLIER_EDC}}/{{MANAGEMENT_PATH}}/v2/catalog/request", + "host": [ + "{{SUPPLIER_EDC}}" + ], + "path": [ + "{{MANAGEMENT_PATH}}", + "v2", + "catalog", + "request" + ] + } + }, + "response": [] + }, + { + "name": "Query Catalog for response offer as Customer from Supplier", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Verify response contains one data offer\", function () {", + " console.info(pm.response.json());", + " console.info(pm.response.json()['dcat:dataset']);", + " pm.expect(pm.response.json()['dcat:dataset']).to.be.an(\"object\");", + "});", + "", + "pm.test(\"Verify that offer matches search criteria (dct:type, cx-common:version)\", function () {", + " const contractOffer = pm.response.json()['dcat:dataset'];", + "", + " pm.expect(contractOffer).to.exist;", + "", + " pm.expect(contractOffer[\"https://w3id.org/catenax/ontology/common#version\"]).to.equal(\"1.0\");", + " pm.expect(contractOffer[\"dct:type\"][\"@id\"]).to.equal(\"https://w3id.org/catenax/taxonomy#ItemStockResponseApi\"); ", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"@context\": {},\r\n \"@type\": \"CatalogRequest\",\r\n \"protocol\": \"dataspace-protocol-http\",\r\n \"counterPartyAddress\": \"{{CUSTOMER_EDC_EXT_HOSTNAME}}/{{PROTOCOL_PATH}}\",\r\n \"querySpec\": {\r\n \"offset\": 0,\r\n \"limit\": 100,\r\n \"filter\": \"\",\r\n \"range\": {\r\n \"from\": 0,\r\n \"to\": 100\r\n },\r\n \"filterExpression\": [\r\n {\r\n \"@type\" : \"CriterionDto\",\r\n \"operandLeft\": \"asset:prop:type\",\r\n \"operator\": \"=\",\r\n \"operandRight\": \"data.res.itemStockResponseApi\"\r\n },\r\n {\r\n \"@type\" : \"CriterionDto\",\r\n \"operandLeft\": \"https://w3id.org/catenax/ontology/common#version\",\r\n \"operator\": \"=\",\r\n \"operandRight\": \"1.0\" \r\n }\r\n ]\r\n }\r\n}\r\n", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{SUPPLIER_EDC}}/{{MANAGEMENT_PATH}}/v2/catalog/request", + "host": [ + "{{SUPPLIER_EDC}}" + ], + "path": [ + "{{MANAGEMENT_PATH}}", + "v2", + "catalog", + "request" + ] + } + }, + "response": [] + }, + { + "name": "Query Catalog for request status offer as Customer from Supplier", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Verify response contains one data offer\", function () {", + " console.info(pm.response.json());", + " console.info(pm.response.json()['dcat:dataset']);", + " pm.expect(pm.response.json()['dcat:dataset']).to.be.an(\"object\");", + "});", + "", + "pm.test(\"Verify that offer matches search criteria (dct:type, cx-common:version)\", function () {", + " const contractOffer = pm.response.json()['dcat:dataset'];", + "", + " pm.expect(contractOffer).to.exist;", + "", + " pm.expect(contractOffer[\"https://w3id.org/catenax/ontology/common#version\"]).to.equal(\"1.0\");", + " pm.expect(contractOffer[\"dct:type\"][\"@id\"]).to.equal(\"https://w3id.org/catenax/taxonomy#ItemStockRequestStatusApi\"); ", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"@context\": {},\r\n \"@type\": \"CatalogRequest\",\r\n \"protocol\": \"dataspace-protocol-http\",\r\n \"counterPartyAddress\": \"{{CUSTOMER_EDC_EXT_HOSTNAME}}/{{PROTOCOL_PATH}}\",\r\n \"querySpec\": {\r\n \"offset\": 0,\r\n \"limit\": 100,\r\n \"filter\": \"\",\r\n \"range\": {\r\n \"from\": 0,\r\n \"to\": 100\r\n },\r\n \"filterExpression\": [\r\n {\r\n \"@type\" : \"CriterionDto\",\r\n \"operandLeft\": \"asset:prop:type\",\r\n \"operator\": \"=\",\r\n \"operandRight\": \"data.res.itemStockRequestStatusApi\"\r\n },\r\n {\r\n \"@type\" : \"CriterionDto\",\r\n \"operandLeft\": \"https://w3id.org/catenax/ontology/common#version\",\r\n \"operator\": \"=\",\r\n \"operandRight\": \"1.0\" \r\n }\r\n ]\r\n }\r\n}\r\n", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{SUPPLIER_EDC}}/{{MANAGEMENT_PATH}}/v2/catalog/request", + "host": [ + "{{SUPPLIER_EDC}}" + ], + "path": [ + "{{MANAGEMENT_PATH}}", + "v2", + "catalog", + "request" + ] + } + }, + "response": [] + } + ], + "auth": { + "type": "apikey", + "apikey": [ + { + "key": "value", + "value": "{{SUPPLIER_EDC_API_KEY}}", + "type": "string" + }, + { + "key": "key", + "value": "X-Api-Key", + "type": "string" + } + ] + }, + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ], + "variable": [ + { + "key": "MATERIAL_NUMBER_CUSTOMER", + "value": "MNR-7307-AU340474.002", + "type": "string" + }, + { + "key": "MATERIAL_NUMBER_SUPPLIER", + "value": "MNR-8101-ID146955.001", + "type": "string" + }, + { + "key": "MATERIAL_NUMBER_CX", + "value": "860fb504-b884-4009-9313-c6fb6cdc776b", + "type": "string" + } + ] +} From 523716ad9b85a5ac07dd071b8c6ec0e1b4be87f3 Mon Sep 17 00:00:00 2001 From: --show-origin Date: Thu, 18 Jan 2024 09:24:01 -0800 Subject: [PATCH 08/10] feat(postman): enhanced testdata and fixed wrong configuration --- local/postman/README.md | 4 + ...s-integration-test.postman_collection.json | 152 ++++++++++++++++-- 2 files changed, 140 insertions(+), 16 deletions(-) diff --git a/local/postman/README.md b/local/postman/README.md index 3c3e18dc..b722b1a7 100644 --- a/local/postman/README.md +++ b/local/postman/README.md @@ -49,6 +49,8 @@ Overall the customer has the following information: - Material: Semiconductor - Quantity: 500 pieces - Blocked: true + - Location BPNS: BPNS4444444444XX + - Location BPNA: BPNA4444444444AA - Order Position Reference: - Customer Order Number: CNbr-1 - Customer Order Position Number: C-Pos-1 @@ -82,6 +84,8 @@ Overall the supplier has the following information: - Material: Semiconductor - Quantity: 100 pieces - Blocked: true + - Location BPNS: BPNS1234567890ZZ + - Location BPNA: BPNA1234567890AA - Order Position Reference: - Customer Order Number: CNbr-2 - Customer Order Position Number: C-Pos-2 diff --git a/local/postman/puris-integration-test.postman_collection.json b/local/postman/puris-integration-test.postman_collection.json index d29be8d7..f43c7541 100644 --- a/local/postman/puris-integration-test.postman_collection.json +++ b/local/postman/puris-integration-test.postman_collection.json @@ -533,7 +533,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\n \"material\": {\n \"materialFlag\": true,\n \"productFlag\": false,\n \"materialNumberCustomer\": \"{{MATERIAL_NUMBER_CUSTOMER}}\",\n \"materialNumberCx\": \"{{MATERIAL_NUMBER_CX}}\",\n \"name\": \"Semiconductor\"\n },\n \"quantity\": 50.0,\n \"measurementUnit\": \"unit:piece\",\n \"stockLocationBpns\": \"{{CUSTOMER_BPNS}}\",\n \"stockLocationBpna\": \"{{CUSTOMER_BPNA}}\",\n \"type\": \"MATERIAL\",\n \"lastUpdatedOn\": \"2023-12-18T13:12:48.466+00:00\",\n \"isBlocked\": true,\n \"customerOrderNumber\": \"\",\n \"customerOrderPositionNumber\": \"\",\n \"supplierOrderNumber\": \"\",\n \"partner\":{\n \"bpnl\": \"{{SUPPLIER_BPNL}}\"\n }\n}", + "raw": "{\n \"material\": {\n \"materialFlag\": true,\n \"productFlag\": false,\n \"materialNumberCustomer\": \"{{MATERIAL_NUMBER_CUSTOMER}}\",\n \"materialNumberCx\": \"{{MATERIAL_NUMBER_CX}}\",\n \"name\": \"Semiconductor\"\n },\n \"quantity\": 500.0,\n \"measurementUnit\": \"unit:piece\",\n \"stockLocationBpns\": \"{{CUSTOMER_BPNS}}\",\n \"stockLocationBpna\": \"{{CUSTOMER_BPNA}}\",\n \"type\": \"MATERIAL\",\n \"lastUpdatedOn\": \"2023-12-18T13:12:48.466+00:00\",\n \"isBlocked\": true,\n \"customerOrderNumber\": \"CNbr-1\",\n \"customerOrderPositionNumber\": \"C-Pos-1\",\n \"supplierOrderNumber\": \"SNbr-1\",\n \"partner\":{\n \"bpnl\": \"{{SUPPLIER_BPNL}}\"\n }\n}", "options": { "raw": { "language": "json" @@ -642,6 +642,55 @@ { "name": "SupplierInit", "item": [ + { + "name": "Add New Site to Supplier Partner (MySelf)", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "})", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\"bpns\": \"{{SUPPLIER_BPNS2}}\",\n\"name\": \"Semiconductor Supplier Inc. Secondary Site\",\n\"addresses\": [\n {\n \"bpna\": \"{{SUPPLIER_BPNA2}}\",\n \"streetAndNumber\": \"Sunset Blvd. 345\",\n \"zipCodeAndCity\": \"90001 Los Angeles\",\n \"country\": \"USA\"\n }\n]\n}" + }, + "url": { + "raw": "{{SUPPLIER_PURIS_BACKEND}}/catena/partners/putSite?partnerBpnl={{SUPPLIER_BPNL}}", + "host": [ + "{{SUPPLIER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "partners", + "putSite" + ], + "query": [ + { + "key": "partnerBpnl", + "value": "{{SUPPLIER_BPNL}}" + } + ] + } + }, + "response": [] + }, { "name": "Create Semiconductor Product", "event": [ @@ -984,7 +1033,48 @@ "header": [], "body": { "mode": "raw", - "raw": "{\n \"material\": {\n \"materialFlag\": false,\n \"productFlag\": true,\n \"materialNumberCustomer\": \"{{MATERIAL_NUMBER_CUSTOMER}}\",\n \"materialNumberSupplier\": \"{{MATERIAL_NUMBER_SUPPLIER}}\",\n \"materialNumberCx\": \"{{MATERIAL_NUMBER_CX}}\",\n \"name\": \"Semiconductor\"\n },\n \"quantity\": 5.0,\n \"measurementUnit\": \"unit:piece\",\n \"stockLocationBpns\": \"{{SUPPLIER_BPNS}}\",\n \"stockLocationBpna\": \"{{SUPPLIER_BPNA}}\",\n \"type\": \"PRODUCT\",\n \"lastUpdatedOn\": \"2023-12-18T14:12:48.466+00:00\",\n \"isBlocked\": false,\n \"customerOrderNumber\": \"\",\n \"customerOrderPositionNumber\": \"\",\n \"supplierOrderNumber\": \"\",\n \"partner\":{\n \"bpnl\": \"{{CUSTOMER_BPNL}}\"\n }\n}", + "raw": "{\n \"material\": {\n \"materialFlag\": false,\n \"productFlag\": true,\n \"materialNumberCustomer\": \"{{MATERIAL_NUMBER_CUSTOMER}}\",\n \"materialNumberSupplier\": \"{{MATERIAL_NUMBER_SUPPLIER}}\",\n \"materialNumberCx\": \"{{MATERIAL_NUMBER_CX}}\",\n \"name\": \"Semiconductor\"\n },\n \"quantity\": 100.0,\n \"measurementUnit\": \"unit:piece\",\n \"stockLocationBpns\": \"{{SUPPLIER_BPNS}}\",\n \"stockLocationBpna\": \"{{SUPPLIER_BPNA}}\",\n \"type\": \"PRODUCT\",\n \"lastUpdatedOn\": \"2023-12-18T14:12:48.466+00:00\",\n \"isBlocked\": true,\n \"customerOrderNumber\": \"CNbr-2\",\n \"customerOrderPositionNumber\": \"C-Pos-2\",\n \"supplierOrderNumber\": \"SNbr-2\",\n \"partner\":{\n \"bpnl\": \"{{CUSTOMER_BPNL}}\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{SUPPLIER_PURIS_BACKEND}}/catena/stockView/product-stocks", + "host": [ + "{{SUPPLIER_PURIS_BACKEND}}" + ], + "path": [ + "catena", + "stockView", + "product-stocks" + ] + } + }, + "response": [] + }, + { + "name": "Create Semiconductor Product Stock 2 Supplier", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"response is ok\", function() {", + " pm.response.to.have.status(200);", + "})" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"material\": {\n \"materialFlag\": false,\n \"productFlag\": true,\n \"materialNumberCustomer\": \"{{MATERIAL_NUMBER_CUSTOMER}}\",\n \"materialNumberSupplier\": \"{{MATERIAL_NUMBER_SUPPLIER}}\",\n \"materialNumberCx\": \"{{MATERIAL_NUMBER_CX}}\",\n \"name\": \"Semiconductor\"\n },\n \"quantity\": 400.0,\n \"measurementUnit\": \"unit:piece\",\n \"stockLocationBpns\": \"{{SUPPLIER_BPNS2}}\",\n \"stockLocationBpna\": \"{{SUPPLIER_BPNA2}}\",\n \"type\": \"PRODUCT\",\n \"lastUpdatedOn\": \"2023-12-18T14:12:48.466+00:00\",\n \"isBlocked\": false,\n \"customerOrderNumber\": \"CNbr-2\",\n \"customerOrderPositionNumber\": \"C-Pos-2\",\n \"supplierOrderNumber\": \"SNbr-2\",\n \"partner\":{\n \"bpnl\": \"{{CUSTOMER_BPNL}}\"\n }\n}", "options": { "raw": { "language": "json" @@ -1016,26 +1106,56 @@ " pm.response.to.have.status(200);", "});", "", - "pm.test(\"Verify response contains one material objects\", function () {", - " pm.expect(pm.response.json()).to.be.an(\"array\").with.lengthOf(1);", + "pm.test(\"Verify response contains two product stock objects\", function () {", + " pm.expect(pm.response.json()).to.be.an(\"array\").with.lengthOf(2);", "});", "", - "pm.test(\"Verify stock composition (material number with BPNS, BPNA and Partner BPNL)\", function () {", - " const stock = pm.response.json()[0];", + "pm.test(\"Verify stock composition NY (material number with BPNS, BPNA and Partner BPNL)\", function () {", + "", + " var responseJson = pm.response.json();", + "", + " const stockNy = responseJson.filter(function (stock) {", + " return stock.stockLocationBpns === pm.environment.get(\"SUPPLIER_BPNS\");", + " })[0];", + "", + " pm.expect(stockNy).to.have.property(\"material\");", + " pm.expect(stockNy.material).to.have.property(\"materialNumberCustomer\");", + " pm.expect(stockNy.material.materialNumberSupplier).to.equal(pm.collectionVariables.get(\"MATERIAL_NUMBER_SUPPLIER\"));", + "", + " pm.expect(stockNy).to.have.property(\"stockLocationBpns\");", + " pm.expect(stockNy.stockLocationBpns).to.equal(pm.environment.get(\"SUPPLIER_BPNS\"));", + "", + " pm.expect(stockNy).to.have.property(\"stockLocationBpna\");", + " pm.expect(stockNy.stockLocationBpna).to.equal(pm.environment.get(\"SUPPLIER_BPNA\"));", + "", + " pm.expect(stockNy).to.have.property(\"partner\");", + " pm.expect(stockNy.partner).to.have.property(\"bpnl\");", + " pm.expect(stockNy.partner.bpnl).to.equal(pm.environment.get(\"CUSTOMER_BPNL\"));", + "});", + "", + "pm.test(\"Verify stock composition LA (material number with BPNS, BPNA and Partner BPNL)\", function () {", + "", + " var responseJson = pm.response.json();", + "", + " const stockLa = responseJson.filter(function (stock) {", + " return stock.stockLocationBpns === pm.environment.get(\"SUPPLIER_BPNS2\");", + " })[0];", + "", + " console.log(stockLa);", "", - " pm.expect(stock).to.have.property(\"material\");", - " pm.expect(stock.material).to.have.property(\"materialNumberCustomer\");", - " pm.expect(stock.material.materialNumberSupplier).to.equal(pm.collectionVariables.get(\"MATERIAL_NUMBER_SUPPLIER\"));", + " pm.expect(stockLa).to.have.property(\"material\");", + " pm.expect(stockLa.material).to.have.property(\"materialNumberCustomer\");", + " pm.expect(stockLa.material.materialNumberSupplier).to.equal(pm.collectionVariables.get(\"MATERIAL_NUMBER_SUPPLIER\"));", "", - " pm.expect(stock).to.have.property(\"stockLocationBpns\");", - " pm.expect(stock.stockLocationBpns).to.equal(pm.environment.get(\"SUPPLIER_BPNS\"));", + " pm.expect(stockLa).to.have.property(\"stockLocationBpns\");", + " pm.expect(stockLa.stockLocationBpns).to.equal(pm.environment.get(\"SUPPLIER_BPNS2\"));", "", - " pm.expect(stock).to.have.property(\"stockLocationBpna\");", - " pm.expect(stock.stockLocationBpna).to.equal(pm.environment.get(\"SUPPLIER_BPNA\"));", + " pm.expect(stockLa).to.have.property(\"stockLocationBpna\");", + " pm.expect(stockLa.stockLocationBpna).to.equal(pm.environment.get(\"SUPPLIER_BPNA2\"));", "", - " pm.expect(stock).to.have.property(\"partner\");", - " pm.expect(stock.partner).to.have.property(\"bpnl\");", - " pm.expect(stock.partner.bpnl).to.equal(pm.environment.get(\"CUSTOMER_BPNL\"));", + " pm.expect(stockLa).to.have.property(\"partner\");", + " pm.expect(stockLa.partner).to.have.property(\"bpnl\");", + " pm.expect(stockLa.partner.bpnl).to.equal(pm.environment.get(\"CUSTOMER_BPNL\"));", "});" ], "type": "text/javascript" From f6f9c121c4d0f4ab42cfe60785c4fc6c553fa499 Mon Sep 17 00:00:00 2001 From: --show-origin Date: Thu, 18 Jan 2024 09:25:43 -0800 Subject: [PATCH 09/10] feat(DataInjectionCommandLineRunner): updated data injection to be same as postman --- .../DataInjectionCommandLineRunner.java | 97 +++++++++++++++---- 1 file changed, 78 insertions(+), 19 deletions(-) diff --git a/backend/src/main/java/org/eclipse/tractusx/puris/backend/DataInjectionCommandLineRunner.java b/backend/src/main/java/org/eclipse/tractusx/puris/backend/DataInjectionCommandLineRunner.java index 2ca41ed4..b4a51d8c 100644 --- a/backend/src/main/java/org/eclipse/tractusx/puris/backend/DataInjectionCommandLineRunner.java +++ b/backend/src/main/java/org/eclipse/tractusx/puris/backend/DataInjectionCommandLineRunner.java @@ -28,6 +28,7 @@ import org.eclipse.tractusx.puris.backend.masterdata.domain.model.Material; import org.eclipse.tractusx.puris.backend.masterdata.domain.model.MaterialPartnerRelation; import org.eclipse.tractusx.puris.backend.masterdata.domain.model.Partner; +import org.eclipse.tractusx.puris.backend.masterdata.domain.model.Site; import org.eclipse.tractusx.puris.backend.masterdata.logic.service.MaterialPartnerRelationService; import org.eclipse.tractusx.puris.backend.masterdata.logic.service.MaterialService; import org.eclipse.tractusx.puris.backend.masterdata.logic.service.PartnerService; @@ -97,6 +98,12 @@ public class DataInjectionCommandLineRunner implements CommandLineRunner { private final String semiconductorMatNbrCustomer = "MNR-7307-AU340474.002"; private final String semiconductorMatNbrSupplier = "MNR-8101-ID146955.001"; + private final String semiconductorMatNbrCatenaX = "860fb504-b884-4009-9313-c6fb6cdc776b"; + + private final String supplierSiteNyBpns = "BPNS1234567890ZZ"; + + private final String supplierSiteLaBpns = "BPNS2222222222SS"; + public DataInjectionCommandLineRunner(ObjectMapper objectMapper) { this.objectMapper = objectMapper; } @@ -251,8 +258,11 @@ private void setupCustomerRole() throws JsonProcessingException { .locationBpna(mySelf.getSites().first().getAddresses().first().getBpna()) .locationBpns(mySelf.getSites().first().getBpns()) .measurementUnit(ItemUnitEnumeration.UNIT_PIECE) - .quantity(20) + .quantity(500) .partner(supplierPartner) + .customerOrderId("CNbr-1") + .customerOrderPositionId("C-Pos-1") + .supplierOrderId("SNbr-1") .build(); var createdMaterialItemStock = materialItemStockService.create(materialItemStock); log.info("Created MaterialItemStock: \n" + createdMaterialItemStock); @@ -278,6 +288,19 @@ private void setupSupplierRole() { Material semiconductorMaterial = getNewSemiconductorMaterialForSupplier(); Partner mySelf = partnerService.getOwnPartnerEntity(); + Site secondSite = new Site( + supplierSiteLaBpns, + "Semiconductor Supplier Inc. Secondary Site", + "BPNA2222222222AA", + "Sunset Blvd. 345", + "90001 Los Angeles", + "USA" + ); + + mySelf.getSites().add(secondSite); + mySelf = partnerService.update(mySelf); + log.info("Added Site to mySelf Partner: %s", mySelf); + semiconductorMaterial = materialService.create(semiconductorMaterial); log.info(String.format("Created product: %s", semiconductorMaterial)); @@ -297,20 +320,40 @@ private void setupSupplierRole() { List customerPartners = mprService.findAllCustomersForOwnMaterialNumber(semiconductorMaterial.getOwnMaterialNumber()); log.info(String.format("Found customer partners for semiconductor: %s", customerPartners)); - + Site siteNy = mySelf.getSites().stream().filter(site -> site.getBpns().equals("BPNS1234567890ZZ")).findFirst().get(); + Site siteLa = mySelf.getSites().stream().filter(site -> site.getBpns().equals("BPNS2222222222SS")).findFirst().get(); var productItemStock = ProductItemStock.builder() - .locationBpna(mySelf.getSites().first().getAddresses().first().getBpna()) - .locationBpns(mySelf.getSites().first().getBpns()) + .locationBpna(siteNy.getAddresses().stream().findFirst().get().getBpna()) + .locationBpns(siteNy.getBpns()) .measurementUnit(ItemUnitEnumeration.UNIT_PIECE) - .quantity(40) + .quantity(100) .partner(customerPartner) + .isBlocked(true) + .customerOrderId("CNbr-2") + .customerOrderPositionId("C-Pos-2") + .supplierOrderId("SNbr-2") .material(semiconductorMaterial) .lastUpdatedOnDateTime(new Date()) .build(); productItemStock = productItemStockService.create(productItemStock); log.info("Created ProductItemStock \n" + productItemStock); + var productItemStock2 = ProductItemStock.builder() + .locationBpna(siteLa.getAddresses().stream().findFirst().get().getBpna()) + .locationBpns(siteLa.getBpns()) + .measurementUnit(ItemUnitEnumeration.UNIT_PIECE) + .quantity(400) + .partner(customerPartner) + .customerOrderId("CNbr-2") + .customerOrderPositionId("C-Pos-2") + .supplierOrderId("SNbr-2") + .material(semiconductorMaterial) + .lastUpdatedOnDateTime(new Date()) + .build(); + productItemStock2 = productItemStockService.create(productItemStock2); + log.info("Created ProductItemStock 2\n" + productItemStock2); + ReportedProductItemStock reportedProductItemStock = ReportedProductItemStock.builder() .material(semiconductorMaterial) .locationBpns(customerPartner.getSites().first().getBpns()) @@ -332,15 +375,15 @@ private void setupSupplierRole() { */ private Partner createAndGetCustomerPartner() { Partner customerPartnerEntity = new Partner( - "Scenario Customer", + "Control Unit Creator Inc.", "http://customer-control-plane:8184/api/v1/dsp", "BPNL4444444444XX", "BPNS4444444444XX", - "Hauptwerk Musterhausen", + "Control Unit Creator Production Site", "BPNA4444444444AA", - "Musterstraße 35b", - "77777 Musterhausen", - "Germany" + "13th Street 47", + "10011 New York", + "USA" ); customerPartnerEntity = partnerService.create(customerPartnerEntity); log.info(String.format("Created customer partner: %s", customerPartnerEntity)); @@ -357,20 +400,34 @@ private Partner createAndGetCustomerPartner() { */ private Partner createAndGetSupplierPartner() { Partner supplierPartnerEntity = new Partner( - "Scenario Supplier", + "Semiconductor Supplier Inc.", "http://supplier-control-plane:9184/api/v1/dsp", "BPNL1234567890ZZ", - "BPNS1234567890ZZ", - "Konzernzentrale Dudelsdorf", + supplierSiteNyBpns, + "Semiconductor Supplier Inc. Production Site", "BPNA1234567890AA", - "Heinrich-Supplier-Straße 1", - "77785 Dudelsdorf", - "Germany" + "Wall Street 101", + "10001 New York", + "USA" ); supplierPartnerEntity = partnerService.create(supplierPartnerEntity); log.info(String.format("Created supplier partner: %s", supplierPartnerEntity)); supplierPartnerEntity = partnerService.findByUuid(supplierPartnerEntity.getUuid()); log.info(String.format("Found supplier partner: %s", supplierPartnerEntity)); + + Site secondSite = new Site( + supplierSiteLaBpns, + "Semiconductor Supplier Inc. Secondary Site", + "BPNA2222222222AA", + "Sunset Blvd. 345", + "90001 Los Angeles", + "USA" + ); + + supplierPartnerEntity.getSites().add(secondSite); + Partner updatedSupplierPartner = partnerService.update(supplierPartnerEntity); + log.info("Added Site to supplier: %s", supplierPartnerEntity); + return supplierPartnerEntity; } @@ -402,16 +459,18 @@ private Partner createAndGetNonScenarioCustomer() { private Material getNewSemiconductorMaterialForSupplier() { Material material = new Material(); material.setOwnMaterialNumber(semiconductorMatNbrSupplier); + material.setMaterialNumberCx(semiconductorMatNbrCatenaX); material.setProductFlag(true); - material.setName("semiconductor"); + material.setName("Semiconductor"); return material; } private Material getNewSemiconductorMaterialForCustomer() { Material material = new Material(); material.setOwnMaterialNumber(semiconductorMatNbrCustomer); + material.setMaterialNumberCx(semiconductorMatNbrCatenaX); material.setMaterialFlag(true); - material.setName("semiconductor"); + material.setName("Semiconductor"); return material; } @@ -425,7 +484,7 @@ private Material getNewCentralControlUnitMaterial() { Material material = new Material(); material.setOwnMaterialNumber("MNR-4177-S"); material.setProductFlag(true); - material.setName("central control unit"); + material.setName("Central Control Unit"); return material; } From d7b8dff32714e7febb66e55f8c9f516405b0f8cb Mon Sep 17 00:00:00 2001 From: --show-origin Date: Fri, 19 Jan 2024 07:06:58 -0800 Subject: [PATCH 10/10] feat(DataInjectionCommandLineRunner): updated logs and application.properties --- .../puris/backend/DataInjectionCommandLineRunner.java | 4 ++-- backend/src/main/resources/application.properties | 4 ++-- backend/src/test/resources/application.properties | 4 ++-- frontend/src/views/StockView.vue | 1 - 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/backend/src/main/java/org/eclipse/tractusx/puris/backend/DataInjectionCommandLineRunner.java b/backend/src/main/java/org/eclipse/tractusx/puris/backend/DataInjectionCommandLineRunner.java index b4a51d8c..52f8907e 100644 --- a/backend/src/main/java/org/eclipse/tractusx/puris/backend/DataInjectionCommandLineRunner.java +++ b/backend/src/main/java/org/eclipse/tractusx/puris/backend/DataInjectionCommandLineRunner.java @@ -299,7 +299,7 @@ private void setupSupplierRole() { mySelf.getSites().add(secondSite); mySelf = partnerService.update(mySelf); - log.info("Added Site to mySelf Partner: %s", mySelf); + log.info(String.format("Added Site to mySelf Partner: %s", mySelf)); semiconductorMaterial = materialService.create(semiconductorMaterial); log.info(String.format("Created product: %s", semiconductorMaterial)); @@ -426,7 +426,7 @@ private Partner createAndGetSupplierPartner() { supplierPartnerEntity.getSites().add(secondSite); Partner updatedSupplierPartner = partnerService.update(supplierPartnerEntity); - log.info("Added Site to supplier: %s", supplierPartnerEntity); + log.info(String.format("Added Site to mySelf Partner: %s", updatedSupplierPartner)); return supplierPartnerEntity; } diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties index d6e7cf3e..08e88eba 100755 --- a/backend/src/main/resources/application.properties +++ b/backend/src/main/resources/application.properties @@ -46,8 +46,8 @@ own.site.name=${OWN_SITE:Control Unit Creator Production Site} # If a BPNS is set, then this BPNA will be attached to it. # Otherwise, it will be attached immediately to the BPNL (see above) own.bpna=${OWN_BPNA:BPNA4444444444AA} -own.streetandnumber=${OWN_STREETANDNUMBER:Wall Street 101} -own.zipcodeandcity=${OWN_ZIPCODEANDCITY:10001 New York} +own.streetandnumber=${OWN_STREETANDNUMBER:13th Street 47} +own.zipcodeandcity=${OWN_ZIPCODEANDCITY:10011 New York} own.country=${OWN_COUNTRY:USA} server.ssl.enabled=false diff --git a/backend/src/test/resources/application.properties b/backend/src/test/resources/application.properties index 50d4d8d4..9d78f438 100755 --- a/backend/src/test/resources/application.properties +++ b/backend/src/test/resources/application.properties @@ -48,8 +48,8 @@ own.site.name=${OWN_SITE:Control Unit Creator Production Site} # If a BPNS is set, then this BPNA will be attached to it. # Otherwise, it will be attached immediately to the BPNL (see above) own.bpna=${OWN_BPNA:BPNA4444444444AA} -own.streetandnumber=${OWN_STREETANDNUMBER:Wall Street 101} -own.zipcodeandcity=${OWN_ZIPCODEANDCITY:10001 New York} +own.streetandnumber=${OWN_STREETANDNUMBER:13th Street 47} +own.zipcodeandcity=${OWN_ZIPCODEANDCITY:10011 New York} own.country=${OWN_COUNTRY:USA} # run with: diff --git a/frontend/src/views/StockView.vue b/frontend/src/views/StockView.vue index 9e44be73..bda6ae92 100644 --- a/frontend/src/views/StockView.vue +++ b/frontend/src/views/StockView.vue @@ -83,7 +83,6 @@ id="allocatedToPartner" v-model="this.changedStock.partnerBpnl" required - :disabled="this.changedStock.materialId === ''" >