Skip to content

Commit

Permalink
updated postman collection
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjovanovic committed Aug 22, 2023
1 parent 239543c commit d1ee7d3
Showing 1 changed file with 147 additions and 4 deletions.
151 changes: 147 additions & 4 deletions TRUE Connector v1.postman_collection.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"info": {
"_postman_id": "d69b4d98-a2fb-44a4-826d-99da07c6cb54",
"_postman_id": "de10144c-f87c-4bd2-84e1-5b8247e5266a",
"name": "TRUE Connector v1",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "2326106"
"_exporter_id": "21815221"
},
"item": [
{
Expand All @@ -12,6 +12,54 @@
{
"name": "ContractOffer",
"item": [
{
"name": "SelfDescription",
"event": [
{
"listen": "test",
"script": {
"exec": [
"var jsonData = pm.response.json();\r",
"pm.response.to.be.ok;\r",
"//store applicants self-description for further tests\r",
"pm.collectionVariables.set(\"APPLICANT_SELF_DESCRIPTION\", jsonData)\r",
"\r",
"pm.test(\"ContractOffer\", function () {\r",
" // catalog\r",
" pm.expect(jsonData[\"ids:resourceCatalog\"][0][\"@id\"]).to.exist;\r",
" pm.collectionVariables.set(\"resourceCatalog\", jsonData[\"ids:resourceCatalog\"][0][\"@id\"]) \r",
" // resource\r",
" pm.expect(jsonData[\"ids:resourceCatalog\"][0][\"ids:offeredResource\"][0][\"@id\"]).to.exist;\r",
" pm.collectionVariables.set(\"offeredResource\", jsonData[\"ids:resourceCatalog\"][0][\"ids:offeredResource\"][0][\"@id\"])\r",
" // contractOffer\r",
" pm.expect(jsonData[\"ids:resourceCatalog\"][0][\"ids:offeredResource\"][0][\"ids:contractOffer\"][0][\"@id\"]).to.exist;\r",
" pm.collectionVariables.set(\"contractOffer\", jsonData[\"ids:resourceCatalog\"][0][\"ids:offeredResource\"][0][\"ids:contractOffer\"][0][\"@id\"])\r",
" // representation\r",
" pm.expect(jsonData[\"ids:resourceCatalog\"][0][\"ids:offeredResource\"][0][\"ids:representation\"][0][\"@id\"]).to.exist;\r",
" pm.collectionVariables.set(\"representation\", jsonData[\"ids:resourceCatalog\"][0][\"ids:offeredResource\"][0][\"ids:representation\"][0][\"@id\"])\r",
" });"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{Self_Description_URL}}/api/selfDescription/",
"host": [
"{{Self_Description_URL}}"
],
"path": [
"api",
"selfDescription",
""
]
}
},
"response": []
},
{
"name": "ContractOffer",
"event": [
Expand All @@ -26,7 +74,6 @@
"//http://w3id.org/engrd/connector/artifact/test\r",
" pm.expect(pm.response.text()).to.include(\"ids:Permission\");\r",
" pm.expect(pm.response.text()).to.include(\"ids:ContractOffer\");\r",
" pm.expect(pm.response.text()).to.include(\"ids:Constraint\");\r",
" pm.expect(pm.response.text()).to.include(\"http://w3id.org/engrd/connector/artifact\");\r",
" });"
],
Expand Down Expand Up @@ -233,6 +280,54 @@
{
"name": "OfferedResource",
"item": [
{
"name": "SelfDescription",
"event": [
{
"listen": "test",
"script": {
"exec": [
"var jsonData = pm.response.json();\r",
"pm.response.to.be.ok;\r",
"//store applicants self-description for further tests\r",
"pm.collectionVariables.set(\"APPLICANT_SELF_DESCRIPTION\", jsonData)\r",
"\r",
"pm.test(\"ContractOffer\", function () {\r",
" // catalog\r",
" pm.expect(jsonData[\"ids:resourceCatalog\"][0][\"@id\"]).to.exist;\r",
" pm.collectionVariables.set(\"resourceCatalog\", jsonData[\"ids:resourceCatalog\"][0][\"@id\"]) \r",
" // resource\r",
" pm.expect(jsonData[\"ids:resourceCatalog\"][0][\"ids:offeredResource\"][0][\"@id\"]).to.exist;\r",
" pm.collectionVariables.set(\"offeredResource\", jsonData[\"ids:resourceCatalog\"][0][\"ids:offeredResource\"][0][\"@id\"])\r",
" // contractOffer\r",
" pm.expect(jsonData[\"ids:resourceCatalog\"][0][\"ids:offeredResource\"][0][\"ids:contractOffer\"][0][\"@id\"]).to.exist;\r",
" pm.collectionVariables.set(\"contractOffer\", jsonData[\"ids:resourceCatalog\"][0][\"ids:offeredResource\"][0][\"ids:contractOffer\"][0][\"@id\"])\r",
" // representation\r",
" pm.expect(jsonData[\"ids:resourceCatalog\"][0][\"ids:offeredResource\"][0][\"ids:representation\"][0][\"@id\"]).to.exist;\r",
" pm.collectionVariables.set(\"representation\", jsonData[\"ids:resourceCatalog\"][0][\"ids:offeredResource\"][0][\"ids:representation\"][0][\"@id\"])\r",
" });"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{Self_Description_URL}}/api/selfDescription/",
"host": [
"{{Self_Description_URL}}"
],
"path": [
"api",
"selfDescription",
""
]
}
},
"response": []
},
{
"name": "OfferedResource",
"event": [
Expand Down Expand Up @@ -293,7 +388,7 @@
"//http://w3id.org/engrd/connector/artifact/postman\r",
" pm.expect(pm.response.text()).to.include(\"http://w3id.org/engrd/connector/artifact/postman\");\r",
" var list = jsonData[\"ids:resourceCatalog\"][0][\"ids:offeredResource\"].length;\r",
" tests[\"Validate total of 3 offered resources\"] = list === 3;\r",
" tests[\"Validate total of 3 offered resources\"] = list > 2;\r",
" });\r",
""
],
Expand Down Expand Up @@ -435,6 +530,54 @@
{
"name": "Representation",
"item": [
{
"name": "SelfDescription",
"event": [
{
"listen": "test",
"script": {
"exec": [
"var jsonData = pm.response.json();\r",
"pm.response.to.be.ok;\r",
"//store applicants self-description for further tests\r",
"pm.collectionVariables.set(\"APPLICANT_SELF_DESCRIPTION\", jsonData)\r",
"\r",
"pm.test(\"ContractOffer\", function () {\r",
" // catalog\r",
" pm.expect(jsonData[\"ids:resourceCatalog\"][0][\"@id\"]).to.exist;\r",
" pm.collectionVariables.set(\"resourceCatalog\", jsonData[\"ids:resourceCatalog\"][0][\"@id\"]) \r",
" // resource\r",
" pm.expect(jsonData[\"ids:resourceCatalog\"][0][\"ids:offeredResource\"][0][\"@id\"]).to.exist;\r",
" pm.collectionVariables.set(\"offeredResource\", jsonData[\"ids:resourceCatalog\"][0][\"ids:offeredResource\"][0][\"@id\"])\r",
" // contractOffer\r",
" pm.expect(jsonData[\"ids:resourceCatalog\"][0][\"ids:offeredResource\"][0][\"ids:contractOffer\"][0][\"@id\"]).to.exist;\r",
" pm.collectionVariables.set(\"contractOffer\", jsonData[\"ids:resourceCatalog\"][0][\"ids:offeredResource\"][0][\"ids:contractOffer\"][0][\"@id\"])\r",
" // representation\r",
" pm.expect(jsonData[\"ids:resourceCatalog\"][0][\"ids:offeredResource\"][0][\"ids:representation\"][0][\"@id\"]).to.exist;\r",
" pm.collectionVariables.set(\"representation\", jsonData[\"ids:resourceCatalog\"][0][\"ids:offeredResource\"][0][\"ids:representation\"][0][\"@id\"])\r",
" });"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{Self_Description_URL}}/api/selfDescription/",
"host": [
"{{Self_Description_URL}}"
],
"path": [
"api",
"selfDescription",
""
]
}
},
"response": []
},
{
"name": "Representation",
"event": [
Expand Down

0 comments on commit d1ee7d3

Please sign in to comment.