From 08166046a2b48789944a6023da4383327f0f66b9 Mon Sep 17 00:00:00 2001 From: Andreas Huber <anh@fjd.de> Date: Mon, 18 May 2020 11:01:10 +0200 Subject: [PATCH] =?UTF-8?q?Postman=20Collection=20&=20Environment=20hinzug?= =?UTF-8?q?ef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FIT-Connect Test.postman_environment.json | 29 + .../FIT-Connect.postman_collection.json | 1081 +++++++++++++++++ 2 files changed, 1110 insertions(+) create mode 100644 assets/postman/FIT-Connect Test.postman_environment.json create mode 100644 assets/postman/FIT-Connect.postman_collection.json diff --git a/assets/postman/FIT-Connect Test.postman_environment.json b/assets/postman/FIT-Connect Test.postman_environment.json new file mode 100644 index 00000000..89140253 --- /dev/null +++ b/assets/postman/FIT-Connect Test.postman_environment.json @@ -0,0 +1,29 @@ +{ + "id": "44204631-99ff-4de7-92e1-76fc41b2b798", + "name": "FIT-Connect Test", + "values": [ + { + "key": "sender_url", + "value": "https://sender.fiep-poc.de/", + "enabled": true + }, + { + "key": "subscriber_url", + "value": "https://subscriber.fiep-poc.de/", + "enabled": true + }, + { + "key": "sender_id", + "value": "sender-nobody", + "enabled": true + }, + { + "key": "subscriber_id", + "value": "subscriber-nobody", + "enabled": true + } + ], + "_postman_variable_scope": "environment", + "_postman_exported_at": "2020-05-18T08:59:33.107Z", + "_postman_exported_using": "Postman/7.24.0" +} \ No newline at end of file diff --git a/assets/postman/FIT-Connect.postman_collection.json b/assets/postman/FIT-Connect.postman_collection.json new file mode 100644 index 00000000..455e99d5 --- /dev/null +++ b/assets/postman/FIT-Connect.postman_collection.json @@ -0,0 +1,1081 @@ +{ + "info": { + "_postman_id": "aabcbd18-6782-49fb-8a37-5f3feb9857c2", + "name": "FIT-Connect", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" + }, + "item": [ + { + "name": "SenderAPI", + "item": [ + { + "name": "Application Transfer", + "item": [ + { + "name": "Create Application", + "event": [ + { + "listen": "prerequest", + "script": { + "id": "8d9e68fe-65d7-49b4-b638-e88d598b726d", + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "id": "f54c8eae-9e73-4ca1-a02a-a061091db619", + "exec": [ + "pm.test(\"response must be 200 and has a body\", function () {", + " // assert that the status code is 200", + " pm.response.to.have.status(200); ", + " // assert that the response has a valid JSON body", + " pm.response.to.be.withBody;", + " pm.response.to.have.jsonBody(\"applicationId\"); ", + "});", + "", + "// extract body", + "var jsonData = JSON.parse(responseBody);", + "// set application-id", + "pm.collectionVariables.set('application_id', jsonData['applicationId']);", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "name": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"additionalReferenceInfo\": {\n \"subject\": \"Anmeldung eines Gewerbes in Musterstadt\",\n \"caseId\": \"DF/8923\"\n },\n \"contentStructure\": {\n \"data\": {\n \"schema\": {\n \"mimeType\": \"json\",\n \"schemaSource\": \"none\"\n }\n },\n \"docs\": [\n {\n \"docId\": \"1\",\n \"purpose\": \"form\",\n \"size\": 13046,\n \"mimeType\": \"application/pdf\",\n \"filename\": \"test.pdf\",\n \"description\": \"Das Antragsformular\",\n \"lang\": {\n \"lang\": \"de\",\n \"region\": \"DE\"\n },\n \"hash\": {\n \"algorithm\": \"SHA-256\",\n \"digest\": \"bf37d894fdf9aeade63975ed648d49c3e8a7a773923597d2418915f54cd7c3b9\"\n }\n }\n ]\n },\n \"publicServiceType\": {\n \"name\": \"Gewerbeanmeldung\",\n \"description\": \"Eine Gewerbeanmeldung ist immer dann notwendig, wenn Sie einen stehenden Gewerbebetrieb beginnen.\",\n \"leikaId\": \"99050012104000\",\n \"otherIdentifiers\": [\n {\n \"id\": \"8664844\",\n \"schemeID\": \"service.niedersachsen.de\",\n \"schemeName\": \"Serviceportal Niedersachsen\"\n },\n {\n \"id\": \"354824\",\n \"schemeID\": \"buerger.thueringen.de\",\n \"schemeName\": \"Zuständigkeitsfinder Thüringen\"\n }\n ]\n },\n \"applicants\": [\n {\n \"authentificationInfo\": {\n \"assuranceLevel\": \"high\",\n \"authentificationMethod\": \"eID\",\n \"timestamp\": \"2020-03-03T12:38:23Z\"\n },\n \"identityInfo\": {\n \"dateOfBirth\": \"1970-09-13\",\n \"gender\": \"m\",\n \"givenName\": \"WERNER\",\n \"familyName\": \"MUSTERMANN\",\n \"placeOfResidence\": {\n \"street\": \"KURZER WEG 7\",\n \"postalCode\": \"12345\",\n \"city\": \"ANKH-MORPORK\"\n }\n },\n \"contactInfo\": {\n \"electronicAdresses\": [\n {\n \"channelType\": \"Service-Account-Mailbox\",\n \"address\": \"3b0c9c8c-0801-45f0-a331-2abfc9db78d0\"\n }\n ],\n \"physicalAdress\": {\n \"street\": \"Kurzer Weg\",\n \"houseNumber\": \"7\",\n \"postalCode\": \"12345\",\n \"city\": \"Ankh-Morpork\"\n },\n \"telephone\": [\n {\n \"number\": \"+49 89 32168-42\",\n \"mobile\": true,\n \"description\": \"work\"\n }\n ]\n }\n }\n ],\n \"paymentInfo\": {\n \"reference\": \"TP/93/GDP\",\n \"usage\": \"Gewerbeanmeldung\",\n \"amount\": 17.3,\n \"timestamp\": \"2020-03-03T12:38:23Z\",\n \"status\": \"success\",\n \"transaction\": \"1f77c5f9b759db9cdce59988b24974d465c7be5e462a6185485559ff6e2dea82\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{sender_url}}{{sender_id}}/{{destination_id}}", + "host": [ + "{{sender_url}}{{sender_id}}" + ], + "path": [ + "{{destination_id}}" + ] + } + }, + "response": [ + { + "name": "Create Application", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "name": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"additional-reference-info\": {\n \"subject\": \"Anmeldung eines Gewerbes in Musterstadt\",\n \"case-id\": \"DF/8923\"\n },\n \"content-structure\": {\n \"data\": {\n \"schema\": {\n \"mime-type\": \"json\",\n \"schema-source\": \"none\"\n },\n \"mime-type\": \"json\"\n },\n \"docs\": [\n {\n \"doc-id\": \"1\",\n \"purpose\": \"form\",\n \"size\": 39273,\n \"mime\": \"application/pdf\",\n \"filename\": \"antrag.pdf\",\n \"description\": \"Das Antragsformular\",\n \"lang\": {\n \"lang\": \"de\",\n \"region\": \"DE\"\n },\n \"hash\": {\n \"algorithm\": \"SHA-256\",\n \"digest\": \"03ba204e50d126e4674c005e04d82e84c21366780af1f43bd54a37816b6ab340\"\n }\n }\n ]\n },\n \"public-service-type\": {\n \"name\": \"Gewerbeanmeldung\",\n \"description\": \"Eine Gewerbeanmeldung ist immer dann notwendig, wenn Sie einen stehenden Gewerbebetrieb beginnen.\",\n \"leika-id\": \"99050012104000\",\n \"other-identifiers\": [\n {\n \"id\": \"8664844\",\n \"schemeURI\": \"service.niedersachsen.de\",\n \"schemeName\": \"Serviceportal Niedersachsen\"\n },\n {\n \"id\": \"354824\",\n \"schemeURI\": \"buerger.thueringen.de\",\n \"schemeName\": \"Zuständigkeitsfinder Thüringen\"\n }\n ]\n },\n \"applicants\": [\n {\n \"authentification-info\": {\n \"assurance-level\": \"high\",\n \"authentification-method\": \"eID\",\n \"timestamp\": \"2020-03-03T12:38:23Z\"\n },\n \"identity-info\": {\n \"date-of-birth\": \"1970-09-13\",\n \"gender\": \"m\",\n \"given-name\": \"WERNER\",\n \"family-name\": \"MUSTERMANN\",\n \"place-of-residence\": {\n \"street\": \"KURZER WEG 7\",\n \"postal-code\": \"12345\",\n \"city\": \"ANKH-MORPORK\"\n }\n },\n \"contact-info\": {\n \"electronic-adresses\": [\n {\n \"channel-type\": \"Service-Account-Mailbox\",\n \"address\": \"3b0c9c8c-0801-45f0-a331-2abfc9db78d0\"\n }\n ],\n \"physical-adress\": {\n \"street\": \"Kurzer Weg\",\n \"house-number\": \"7\",\n \"postal-code\": \"12345\",\n \"city\": \"Ankh-Morpork\"\n },\n \"telephone\": [\n {\n \"number\": \"+49 89 32168-42\",\n \"mobile\": true,\n \"type\": \"work\"\n }\n ]\n }\n }\n ],\n \"payment-info\": {\n \"reference\": \"TP/93/GDP\",\n \"usage\": \"Gewerbeanmeldung\",\n \"amount\": 17.3,\n \"timestamp\": \"2020-03-03T12:38:23Z\",\n \"status\": \"success\",\n \"transaction\": \"1f77c5f9b759db9cdce59988b24974d465c7be5e462a6185485559ff6e2dea82\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{url}}{{port}}/sender/{{source_id}}/{{destination_id}}", + "host": [ + "{{url}}{{port}}" + ], + "path": [ + "sender", + "{{source_id}}", + "{{destination_id}}" + ] + } + }, + "status": "200", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Date", + "value": "Tue, 31 Mar 2020 06:05:59 GMT" + }, + { + "key": "Server", + "value": "Apache/2.4.38 (Debian)" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Keep-Alive", + "value": "timeout=5, max=100" + }, + { + "key": "Connection", + "value": "Keep-Alive" + }, + { + "key": "Transfer-Encoding", + "value": "chunked" + } + ], + "cookie": [], + "body": "{\n \"application-id\": \"45bb5b95-d853-4fc5-b45d-10aa9e15287a\"\n}" + } + ] + }, + { + "name": "Add Applicaiton Data", + "event": [ + { + "listen": "test", + "script": { + "id": "c110688c-44b0-4b0d-a997-8f5f432ba340", + "exec": [ + "pm.test(\"response must be 202 Accepted and without body\", function () {", + " // assert that the status code is 200", + " pm.response.to.have.status(202); ", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "name": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"F99000001\": \"string\",\n \"G99000001\": {\n \"F99000002\": \"string\",\n \"F99000003\": 42\n },\n \"G99000002\": [\n {\n \"F99000004\": true,\n \"G99000001\": {\n \"F99000002\": \"string\",\n \"F99000003\": 17\n }\n },\n {\n \"F99000004\": true,\n \"G99000001\": {\n \"F99000002\": \"string\",\n \"F99000003\": 24\n }\n }\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{sender_url}}{{sender_id}}/{{destination_id}}/{{application_id}}/data", + "host": [ + "{{sender_url}}{{sender_id}}" + ], + "path": [ + "{{destination_id}}", + "{{application_id}}", + "data" + ] + } + }, + "response": [] + }, + { + "name": "Add Application Document", + "event": [ + { + "listen": "test", + "script": { + "id": "726f1b84-acd9-4bc7-a0cc-78e4d788e5ea", + "exec": [ + "pm.test(\"response must be 202 Accepted and without body\", function () {", + " // assert that the status code is 200", + " pm.response.to.have.status(202); ", + "});" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "content-type": true + } + }, + "request": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "name": "Content-Type", + "value": "application/pdf", + "type": "text" + }, + { + "key": "file", + "value": "", + "type": "text", + "disabled": true + } + ], + "body": { + "mode": "file", + "file": { + "src": "test.pdf" + }, + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{sender_url}}{{sender_id}}/{{destination_id}}/{{application_id}}/docs/{{doc_id}}", + "host": [ + "{{sender_url}}{{sender_id}}" + ], + "path": [ + "{{destination_id}}", + "{{application_id}}", + "docs", + "{{doc_id}}" + ] + } + }, + "response": [] + }, + { + "name": "Send Application", + "event": [ + { + "listen": "test", + "script": { + "id": "c839dbc4-8af9-49ff-940d-95f496a40a5a", + "exec": [ + "pm.test(\"response must be 200 and have a body\", function () {", + " // assert that the status code is 200", + " pm.response.to.have.status(200); ", + " // assert that the response has a valid JSON body", + " pm.response.to.be.withBody;", + "});", + "", + "// extract body", + "var jsonData = JSON.parse(responseBody);", + "// set application-id", + "pm.test(\"Application current status should be Queued\", function(){", + " // assert that application current status is \"queued\"", + " pm.expect(jsonData.code).to.equal(\"queued\");", + "})", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "url": { + "raw": "{{sender_url}}{{sender_id}}/{{destination_id}}/{{application_id}}", + "host": [ + "{{sender_url}}{{sender_id}}" + ], + "path": [ + "{{destination_id}}", + "{{application_id}}" + ] + } + }, + "response": [] + } + ], + "protocolProfileBehavior": {}, + "_postman_isSubFolder": true + }, + { + "name": "Transfer Related Information", + "item": [ + { + "name": "Get Application Upload Status", + "event": [ + { + "listen": "test", + "script": { + "id": "c110688c-44b0-4b0d-a997-8f5f432ba340", + "exec": [ + "pm.test(\"response must be 202 Accepted and without body\", function () {", + " // assert that the status code is 200", + " pm.response.to.have.status(202); ", + "});" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"F99000001\": \"string\",\n \"G99000001\": {\n \"F99000002\": \"string\",\n \"F99000003\": 42\n },\n \"G99000002\": [\n {\n \"F99000004\": true,\n \"G99000001\": {\n \"F99000002\": \"string\",\n \"F99000003\": 17\n }\n },\n {\n \"F99000004\": true,\n \"G99000001\": {\n \"F99000002\": \"string\",\n \"F99000003\": 24\n }\n }\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{sender_url}}{{sender_id}}/{{destination_id}}/{{application_id}}/upload-status", + "host": [ + "{{sender_url}}{{sender_id}}" + ], + "path": [ + "{{destination_id}}", + "{{application_id}}", + "upload-status" + ] + } + }, + "response": [] + }, + { + "name": "Get Destination (Sender)", + "event": [ + { + "listen": "test", + "script": { + "id": "c110688c-44b0-4b0d-a997-8f5f432ba340", + "exec": [ + "pm.test(\"response must be 202 Accepted and without body\", function () {", + " // assert that the status code is 200", + " pm.response.to.have.status(202); ", + "});" + ], + "type": "text/javascript" + } + } + ], + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"F99000001\": \"string\",\n \"G99000001\": {\n \"F99000002\": \"string\",\n \"F99000003\": 42\n },\n \"G99000002\": [\n {\n \"F99000004\": true,\n \"G99000001\": {\n \"F99000002\": \"string\",\n \"F99000003\": 17\n }\n },\n {\n \"F99000004\": true,\n \"G99000001\": {\n \"F99000002\": \"string\",\n \"F99000003\": 24\n }\n }\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{sender_url}}{{sender_id}}/{{destination_id}}", + "host": [ + "{{sender_url}}{{sender_id}}" + ], + "path": [ + "{{destination_id}}" + ] + } + }, + "response": [] + } + ], + "protocolProfileBehavior": {}, + "_postman_isSubFolder": true + }, + { + "name": "Status", + "item": [ + { + "name": "Get Status", + "event": [ + { + "listen": "test", + "script": { + "id": "c839dbc4-8af9-49ff-940d-95f496a40a5a", + "exec": [ + "pm.test(\"response must be 200 and have a body\", function () {", + " // assert that the status code is 200", + " pm.response.to.have.status(200); ", + " // assert that the response has a valid JSON body", + " pm.response.to.be.withBody;", + "});", + "", + "// extract body", + "var jsonData = JSON.parse(responseBody);", + "// set application-id", + "pm.test(\"Application current status should be Queued\", function(){", + " // assert that application current status is \"queued\"", + " pm.expect(jsonData.code).to.equal(\"queued\");", + "})", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{sender_url}}{{sender_id}}/{{application_id}}/status", + "host": [ + "{{sender_url}}{{sender_id}}" + ], + "path": [ + "{{application_id}}", + "status" + ] + } + }, + "response": [] + } + ], + "protocolProfileBehavior": {}, + "_postman_isSubFolder": true + } + ], + "protocolProfileBehavior": {} + }, + { + "name": "SubscriberAPI", + "item": [ + { + "name": "Destination Management", + "item": [ + { + "name": "Create Destination", + "event": [ + { + "listen": "test", + "script": { + "id": "5b7682e2-fdec-491d-ac53-915809a7062a", + "exec": [ + "pm.test(\"response must be 200 and have a body\", function () {", + " // assert that the status code is 200", + " pm.response.to.have.status(200); ", + " // assert that the response has a valid JSON body", + " pm.response.to.be.withBody;", + " pm.response.to.have.jsonBody(\"destinationId\"); ", + "});", + "", + "// extract body", + "var jsonData = JSON.parse(responseBody);", + "// set application-id", + "pm.collectionVariables.set('destination_id', jsonData['destinationId']);", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"publicOrganization\": {\n \"organizationName\": \"Gewerbeamt Musterstadt\",\n \"address\": {\n \"street\": \"Kurzer Weg\",\n \"houseNumber\": \"7\",\n \"postalCode\": \"12345\",\n \"city\": \"Ankh-Morpork\"\n },\n \"contact\": {\n \"telephone\": [\n \t{\n \t\"number\": \"+49 89 32168-0\",\n \t\"mobile\": false,\n \t\"description\": \"work\"\n \t}\n ],\n \"email\": \"behoerde@example.com\"\n }\n },\n \"technicalContact\": [\n \t{\n\t \"formOfAddress\": \"Herr\",\n\t \"academicTitle\": \"Dr.\",\n\t \"firstName\": \"Kunibert\",\n\t \"lastName\": \"Vonundzu\",\n\t \"contact\": {\n\t \"telephone\": [\n\t {\n\t \"number\": \"+49 89 32168-42\",\n\t \"mobile\": false,\n\t \"description\": \"work\"\n\t },\n\t {\n\t \"number\": \"+49 123 456789\",\n\t \"mobile\": true,\n\t \"description\": \"work\"\n\t }\n\t ],\n\t \"email\": \"kunibert.vonundzu@example.com\"\n\t }\n \t}\n ],\n \"schemas\": [\n {\n \"mimeType\": \"json\",\n \"schemaSource\": \"none\"\n }\n ],\n \"callback\": {\n \"callbackURI\": \"http://127.0.0.1:4010/voluptas\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{subscriber_url}}{{subscriber_id}}/destinations", + "host": [ + "{{subscriber_url}}{{subscriber_id}}" + ], + "path": [ + "destinations" + ] + } + }, + "response": [ + { + "name": "Create destination", + "originalRequest": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"public-organization\": {\n \"organization-name\": \"Gewerbeamt Musterstadt\",\n \"address\": {\n \"street\": \"Kurzer Weg\",\n \"houseNr\": \"7\",\n \"postalCode\": \"12345\",\n \"city\": \"Ankh-Morpork\"\n },\n \"contact\": {\n \"telephone\": {\n \"number\": \"+49 89 32168-0\",\n \"mobile\": false,\n \"type\": \"work\"\n },\n \"email\": \"behoerde@example.com\"\n }\n },\n \"technical-contact\": {\n \"formOfAddress\": \"Herr\",\n \"academicTitle\": \"Dr.\",\n \"firstName\": \"Kunibert\",\n \"lastName\": \"Vonundzu\",\n \"contact\": {\n \"telephone\": [\n {\n \"number\": \"+49 89 32168-42\",\n \"mobile\": false,\n \"type\": \"work\"\n },\n {\n \"number\": \"+49 123 456789\",\n \"mobile\": true,\n \"type\": \"work\"\n }\n ],\n \"email\": \"kunibert.vonundzu@example.com\"\n }\n },\n \"schemas\": [\n {\n \"mime-type\": \"json\",\n \"schema-source\": \"none\"\n }\n ],\n \"callback\": {\n \"callback-url\": \"https://www.example.com/callback\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{url}}{{port}}/subscriber/{{subscriber_id}}/destinations", + "host": [ + "{{url}}{{port}}" + ], + "path": [ + "subscriber", + "{{subscriber_id}}", + "destinations" + ] + } + }, + "status": "200", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Date", + "value": "Tue, 31 Mar 2020 05:36:26 GMT" + }, + { + "key": "Server", + "value": "Apache/2.4.38 (Debian)" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Keep-Alive", + "value": "timeout=5, max=100" + }, + { + "key": "Connection", + "value": "Keep-Alive" + }, + { + "key": "Transfer-Encoding", + "value": "chunked" + } + ], + "cookie": [], + "body": "{\n \"destination-id\": \"e15fc92e-c286-424b-9802-39c6b6bc441d\"\n}" + } + ] + }, + { + "name": "Get Destination", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{subscriber_url}}{{subscriber_id}}/destinations/{{destination_id}}", + "host": [ + "{{subscriber_url}}{{subscriber_id}}" + ], + "path": [ + "destinations", + "{{destination_id}}" + ] + } + }, + "response": [] + }, + { + "name": "Update Destination", + "event": [ + { + "listen": "test", + "script": { + "id": "5b7682e2-fdec-491d-ac53-915809a7062a", + "exec": [ + "pm.test(\"response must be 200 and have a body\", function () {", + " // assert that the status code is 200", + " pm.response.to.have.status(200); ", + " // assert that the response has a valid JSON body", + " pm.response.to.be.withBody;", + " pm.response.to.have.jsonBody(\"destination-id\"); ", + "});", + "", + "// extract body", + "var jsonData = JSON.parse(responseBody);", + "// set application-id", + "//pm.collectionVariables.set('destination_id', jsonData['destination-id']);", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"destinationId\": \"{{destination_id}}\",\n \"publicOrganization\": {\n \"organizationName\": \"Gewerbeamt Ankh-Morpork\",\n \"address\": {\n \"street\": \"Kurzer Weg\",\n \"houseNumber\": \"7\",\n \"postalCode\": \"12345\",\n \"city\": \"Ankh-Morpork\"\n },\n \"contact\": {\n \"telephone\": [\n \t{\n\t \"number\": \"+49 89 32168-0\",\n\t \"mobile\": false,\n\t \"description\": \"work\"\n\t }\n\t ],\n \"email\": \"behoerde@example.com\"\n }\n },\n \"technicalContact\": [\n \t{\n\t \"formOfAddress\": \"Herr\",\n\t \"academicTitle\": \"Dr.\",\n\t \"firstName\": \"Kunibert\",\n\t \"lastName\": \"Vonundzu\",\n\t \"contact\": {\n\t \"telephone\": [\n\t {\n\t \"number\": \"+49 89 32168-42\",\n\t \"mobile\": false,\n\t \"description\": \"work\"\n\t },\n\t {\n\t \"number\": \"+49 123 456789\",\n\t \"mobile\": true,\n\t \"description\": \"work\"\n\t }\n\t ],\n\t \"email\": \"kunibert.vonundzu@example.com\"\n\t }\n \t}\n ],\n \"schemas\": [\n {\n \"mimeType\": \"json\",\n \"schemaSource\": \"none\"\n }\n ],\n \"callback\": {\n \"callbackURI\": \"http://127.0.0.1:4010/voluptas\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{subscriber_url}}{{subscriber_id}}/destinations/{{destination_id}}", + "host": [ + "{{subscriber_url}}{{subscriber_id}}" + ], + "path": [ + "destinations", + "{{destination_id}}" + ] + } + }, + "response": [ + { + "name": "Create destination", + "originalRequest": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"public-organization\": {\n \"organization-name\": \"Gewerbeamt Musterstadt\",\n \"address\": {\n \"street\": \"Kurzer Weg\",\n \"houseNr\": \"7\",\n \"postalCode\": \"12345\",\n \"city\": \"Ankh-Morpork\"\n },\n \"contact\": {\n \"telephone\": {\n \"number\": \"+49 89 32168-0\",\n \"mobile\": false,\n \"type\": \"work\"\n },\n \"email\": \"behoerde@example.com\"\n }\n },\n \"technical-contact\": {\n \"formOfAddress\": \"Herr\",\n \"academicTitle\": \"Dr.\",\n \"firstName\": \"Kunibert\",\n \"lastName\": \"Vonundzu\",\n \"contact\": {\n \"telephone\": [\n {\n \"number\": \"+49 89 32168-42\",\n \"mobile\": false,\n \"type\": \"work\"\n },\n {\n \"number\": \"+49 123 456789\",\n \"mobile\": true,\n \"type\": \"work\"\n }\n ],\n \"email\": \"kunibert.vonundzu@example.com\"\n }\n },\n \"schemas\": [\n {\n \"mime-type\": \"json\",\n \"schema-source\": \"none\"\n }\n ],\n \"callback\": {\n \"callback-url\": \"https://www.example.com/callback\"\n }\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{url}}{{port}}/subscriber/{{subscriber_id}}/destinations", + "host": [ + "{{url}}{{port}}" + ], + "path": [ + "subscriber", + "{{subscriber_id}}", + "destinations" + ] + } + }, + "status": "200", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Date", + "value": "Tue, 31 Mar 2020 05:36:26 GMT" + }, + { + "key": "Server", + "value": "Apache/2.4.38 (Debian)" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Keep-Alive", + "value": "timeout=5, max=100" + }, + { + "key": "Connection", + "value": "Keep-Alive" + }, + { + "key": "Transfer-Encoding", + "value": "chunked" + } + ], + "cookie": [], + "body": "{\n \"destination-id\": \"e15fc92e-c286-424b-9802-39c6b6bc441d\"\n}" + } + ] + }, + { + "name": "Delete Destination", + "request": { + "method": "DELETE", + "header": [], + "url": { + "raw": "{{subscriber_url}}{{subscriber_id}}/destinations/{{destination_id}}", + "host": [ + "{{subscriber_url}}{{subscriber_id}}" + ], + "path": [ + "destinations", + "{{destination_id}}" + ] + } + }, + "response": [] + }, + { + "name": "List Destinations", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{subscriber_url}}{{subscriber_id}}/destinations", + "host": [ + "{{subscriber_url}}{{subscriber_id}}" + ], + "path": [ + "destinations" + ] + } + }, + "response": [] + } + ], + "protocolProfileBehavior": {}, + "_postman_isSubFolder": true + }, + { + "name": "Application Retrieval", + "item": [ + { + "name": "List Applications", + "event": [ + { + "listen": "test", + "script": { + "id": "0d082c8d-1593-4789-babc-b8c04e277f8d", + "exec": [ + "pm.test(\"response must be 200 Ok and has a body\", function () {", + " // assert that the status code is 200", + " pm.response.to.have.status(200); ", + " // assert that the response has a valid JSON body", + " pm.response.to.be.withBody;", + "});", + "", + "var jsonData = pm.response.json();", + "", + "pm.test(\"Content-Type header is present\", function () {", + " pm.expect(jsonData[0], pm.collectionVariables.get(\"application_id\"));", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{subscriber_url}}{{subscriber_id}}/destinations/{{destination_id}}/applications", + "host": [ + "{{subscriber_url}}{{subscriber_id}}" + ], + "path": [ + "destinations", + "{{destination_id}}", + "applications" + ] + } + }, + "response": [] + }, + { + "name": "Get Application Metadata", + "event": [ + { + "listen": "prerequest", + "script": { + "id": "79511f73-464f-40a7-90c6-2b5176473cce", + "exec": [ + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "id": "bafba620-d3a3-45c3-b3b9-1afabc26885d", + "exec": [ + "pm.test(\"response must be 200 Ok and has a body\", function () {", + " // assert that the status code is 200", + " pm.response.to.have.status(200); ", + " // assert that the response has a valid JSON body", + " pm.response.to.be.withBody;", + "});", + "", + "// extract body", + "var jsonData = pm.response.json();", + "", + "// todo extend tests." + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{subscriber_url}}{{subscriber_id}}/destinations/{{destination_id}}/applications/{{application_id}}", + "host": [ + "{{subscriber_url}}{{subscriber_id}}" + ], + "path": [ + "destinations", + "{{destination_id}}", + "applications", + "{{application_id}}" + ] + } + }, + "response": [] + }, + { + "name": "Get Application Data", + "event": [ + { + "listen": "test", + "script": { + "id": "ba8692bc-106f-41f6-b484-5a36f655d691", + "exec": [ + "pm.test(\"response must be 200 Ok and has a body\", function () {", + " // assert that the status code is 200", + " pm.response.to.have.status(200); ", + " // assert that the response has a valid JSON body", + " pm.response.to.be.withBody;", + "});", + "", + "// extract body", + "var jsonData = pm.response.json();", + "", + "pm.test(\"correct application-id\", function () {", + " // assert that application-id is correct", + " pm.expect(jsonData['application-id']).to.eql(pm.collectionVariables.get(\"application_id\"));", + "});", + "", + "// todo extend tests." + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{subscriber_url}}{{subscriber_id}}/destinations/{{destination_id}}/applications/{{application_id}}/data", + "host": [ + "{{subscriber_url}}{{subscriber_id}}" + ], + "path": [ + "destinations", + "{{destination_id}}", + "applications", + "{{application_id}}", + "data" + ] + } + }, + "response": [] + }, + { + "name": "Get Application Document", + "event": [ + { + "listen": "test", + "script": { + "id": "eb502bfa-b763-4f16-b76f-c0c8ef5e0228", + "exec": [ + "pm.test(\"response must be 200 Ok and has a body\", function () {", + " // assert that the status code is 200", + " pm.response.to.have.status(200); ", + " // assert that the response has a valid JSON body", + " pm.response.to.be.withBody;", + "});", + "", + "pm.test(\"Content-Type header is present\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + "});", + "", + "pm.test(\"Content-Type header is application/octet-stream\", function () {", + " pm.response.to.have.header(\"Content-Type\");", + " pm.response.to.be.header(\"Content-Type\",\"application/octet-stream\");", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{subscriber_url}}{{subscriber_id}}/destinations/{{destination_id}}/applications/{{application_id}}/docs/{{doc_id}}", + "host": [ + "{{subscriber_url}}{{subscriber_id}}" + ], + "path": [ + "destinations", + "{{destination_id}}", + "applications", + "{{application_id}}", + "docs", + "{{doc_id}}" + ] + } + }, + "response": [] + }, + { + "name": "Acknowledge Application", + "event": [ + { + "listen": "test", + "script": { + "id": "13f5e55a-6984-4505-bbae-61a229d5d571", + "exec": [ + "pm.test(\"response must be 200 Ok and has a body\", function () {", + " // assert that the status code is 200", + " pm.response.to.have.status(200); ", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"finalDelivery\": false\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{subscriber_url}}{{subscriber_id}}/destinations/{{destination_id}}/applications/{{application_id}}", + "host": [ + "{{subscriber_url}}{{subscriber_id}}" + ], + "path": [ + "destinations", + "{{destination_id}}", + "applications", + "{{application_id}}" + ] + } + }, + "response": [] + } + ], + "protocolProfileBehavior": {}, + "_postman_isSubFolder": true + } + ], + "protocolProfileBehavior": {} + } + ], + "auth": { + "type": "oauth2", + "oauth2": [ + { + "key": "accessToken", + "value": "", + "type": "string" + }, + { + "key": "tokenType", + "value": "Bearer", + "type": "string" + }, + { + "key": "addTokenTo", + "value": "header", + "type": "string" + } + ] + }, + "event": [ + { + "listen": "prerequest", + "script": { + "id": "0e99dc85-2204-4578-8167-86b21566527a", + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "id": "462d5817-f944-4c28-85a8-170e20d9f7b7", + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ], + "variable": [ + { + "id": "b4789184-d9f2-40e2-97aa-a61859b4004f", + "key": "source_id", + "value": "source-id", + "type": "string" + }, + { + "id": "c529614f-c3a5-41dd-904f-1d7543ff07db", + "key": "destination_id", + "value": "destination-id", + "type": "string" + }, + { + "id": "a9fd8e0c-8a83-49b5-9eb7-cdd411b51705", + "key": "application_id", + "value": "", + "type": "string" + }, + { + "id": "6d917e40-6b8a-4731-a6bf-63ea6ba2ccdf", + "key": "doc_id", + "value": "1", + "type": "string" + }, + { + "id": "f486faaa-522c-4ca2-80d7-2083f22925fa", + "key": "subscriber_id", + "value": "subscriber-id", + "type": "string" + } + ], + "protocolProfileBehavior": {} +} \ No newline at end of file -- GitLab