From 185e985abd75c153fb07ba0e78de5e0fb770c944 Mon Sep 17 00:00:00 2001 From: Casper-NS Date: Fri, 17 Nov 2023 10:48:22 +0100 Subject: [PATCH 01/19] added postman ci workflow --- .github/workflows/postman.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/postman.yml diff --git a/.github/workflows/postman.yml b/.github/workflows/postman.yml new file mode 100644 index 0000000..3376ea9 --- /dev/null +++ b/.github/workflows/postman.yml @@ -0,0 +1,28 @@ +name: Automated API tests using Postman CLI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + start-api: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4.1.1 + - name: Run API + run: dotnet run --project CentralHub.Api/CentralHub.Api.csproj + + automated-api-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4.1.1 + - name: Install Postman CLI + run: | + curl -o- "https://dl-cli.pstmn.io/install/linux64.sh" | sh + - name: Login to Postman CLI + run: postman login --with-api-key ${{ secrets.POSTMAN_API_KEY }} + - name: Run API tests + run: | + postman collection run "31208196-ebe740bc-2741-48ef-bdb6-e9ad85e8d39a" \ No newline at end of file From 02a74a39318bc4a9222e0d20b0d9b8bd968f84c3 Mon Sep 17 00:00:00 2001 From: Casper-NS <37834568+Casper-NS@users.noreply.github.com> Date: Fri, 17 Nov 2023 13:09:07 +0100 Subject: [PATCH 02/19] added postman api integration --- .github/workflows/postman.yml | 9 +- .postman/api | 4 + .../api_73c72b7f-85af-473f-ac2e-bbcd0e3bd2c2 | 20 +++ index.json | 119 ++++++++++++++++++ 4 files changed, 144 insertions(+), 8 deletions(-) create mode 100644 .postman/api create mode 100644 .postman/api_73c72b7f-85af-473f-ac2e-bbcd0e3bd2c2 create mode 100644 index.json diff --git a/.github/workflows/postman.yml b/.github/workflows/postman.yml index 3376ea9..571e7fd 100644 --- a/.github/workflows/postman.yml +++ b/.github/workflows/postman.yml @@ -7,13 +7,6 @@ on: branches: [ master ] jobs: - start-api: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4.1.1 - - name: Run API - run: dotnet run --project CentralHub.Api/CentralHub.Api.csproj - automated-api-tests: runs-on: ubuntu-latest steps: @@ -25,4 +18,4 @@ jobs: run: postman login --with-api-key ${{ secrets.POSTMAN_API_KEY }} - name: Run API tests run: | - postman collection run "31208196-ebe740bc-2741-48ef-bdb6-e9ad85e8d39a" \ No newline at end of file + postman collection run "31208196-ebe740bc-2741-48ef-bdb6-e9ad85e8d39a" --reporters cli,junit --global-var api_url=http://localhost:8081 \ No newline at end of file diff --git a/.postman/api b/.postman/api new file mode 100644 index 0000000..a1d7485 --- /dev/null +++ b/.postman/api @@ -0,0 +1,4 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY +apis[] = {"apiId":"73c72b7f-85af-473f-ac2e-bbcd0e3bd2c2"} +configVersion = 1.0.0 +type = api diff --git a/.postman/api_73c72b7f-85af-473f-ac2e-bbcd0e3bd2c2 b/.postman/api_73c72b7f-85af-473f-ac2e-bbcd0e3bd2c2 new file mode 100644 index 0000000..2a62c81 --- /dev/null +++ b/.postman/api_73c72b7f-85af-473f-ac2e-bbcd0e3bd2c2 @@ -0,0 +1,20 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY +configVersion = 1.1.0 +type = apiEntityData + +[config] +id = 73c72b7f-85af-473f-ac2e-bbcd0e3bd2c2 + +[config.relations] + +[config.relations.collections] +rootDirectory = postman/collections + +[config.relations.collections.metaData] + +[config.relations.apiDefinition] +files[] = {"path":"index.json","metaData":{}} + +[config.relations.apiDefinition.metaData] +type = openapi:3 +rootFiles[] = index.json diff --git a/index.json b/index.json new file mode 100644 index 0000000..771180c --- /dev/null +++ b/index.json @@ -0,0 +1,119 @@ +{ + "openapi": "3.0.0", + "info": { + "version": "1.0.0", + "title": "Sample API", + "description": "Buy or rent spacecrafts" + }, + "paths": { + "/spacecrafts/{spacecraftId}": { + "parameters": [ + { + "name": "spacecraftId", + "description": "The unique identifier of the spacecraft", + "in": "path", + "required": true, + "schema": { + "$ref": "#/components/schemas/SpacecraftId" + } + } + ], + "get": { + "summary": "Read a spacecraft", + "responses": { + "200": { + "description": "The spacecraft corresponding to the provided `spacecraftId`", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Spacecraft" + } + } + } + }, + "404": { + "description": "No spacecraft found for the provided `spacecraftId`", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "500": { + "description": "Unexpected error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "SpacecraftId": { + "description": "The unique identifier of a spacecraft", + "type": "string" + }, + "Spacecraft": { + "type": "object", + "required": [ + "id", + "name", + "type" + ], + "properties": { + "id": { + "$ref": "#/components/schemas/SpacecraftId" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "capsule", + "probe", + "satellite", + "spaceplane", + "station" + ] + }, + "description": { + "type": "string" + } + } + }, + "Error": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "description": "A human readable error message", + "type": "string" + } + } + } + }, + "securitySchemes": { + "ApiKey": { + "type": "apiKey", + "in": "header", + "name": "X-Api-Key" + } + } + }, + "security": [ + { + "ApiKey": [] + } + ] +} \ No newline at end of file From 6a81338338d412f8a8280987039b0818df2922a4 Mon Sep 17 00:00:00 2001 From: Casper-NS <37834568+Casper-NS@users.noreply.github.com> Date: Mon, 27 Nov 2023 10:49:48 +0100 Subject: [PATCH 03/19] =?UTF-8?q?Casper=20Nyvang=20S=C3=B8rensen=20created?= =?UTF-8?q?=20SW7-API-Tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Postman Collections/SW7-API-Tests.json | 57 ++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 Postman Collections/SW7-API-Tests.json diff --git a/Postman Collections/SW7-API-Tests.json b/Postman Collections/SW7-API-Tests.json new file mode 100644 index 0000000..ca4117a --- /dev/null +++ b/Postman Collections/SW7-API-Tests.json @@ -0,0 +1,57 @@ +{ + "info": { + "_postman_id": "ebe740bc-2741-48ef-bdb6-e9ad85e8d39a", + "name": "SW7-API-Tests", + "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json" + }, + "item": [ + { + "name": "Add Room", + "event": [ + { + "listen": "test", + "script": { + "id": "2e729a33-8d83-4858-8712-26fb7ce08576", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "id": "c2e1a61f-d755-43cc-8201-7fb289ef1c48", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"RoomId\": -1,\n \"Name\": \"Test room\",\n \"Description\": \"Postman Test Room\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": "http://localhost:8081/room/add" + }, + "response": [] + }, + { + "name": "New Request", + "id": "b6bc2627-eba2-409d-b32e-c7d573581300", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "method": "GET", + "header": [] + }, + "response": [] + } + ] +} \ No newline at end of file From 207d2ea1ec72343950594ef333af1c26984bf485 Mon Sep 17 00:00:00 2001 From: Casper-NS <37834568+Casper-NS@users.noreply.github.com> Date: Mon, 27 Nov 2023 10:49:59 +0100 Subject: [PATCH 04/19] =?UTF-8?q?Casper=20Nyvang=20S=C3=B8rensen=20updated?= =?UTF-8?q?=20SW7-API-Tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Postman Collections/SW7-API-Tests.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Postman Collections/SW7-API-Tests.json b/Postman Collections/SW7-API-Tests.json index ca4117a..f4b4360 100644 --- a/Postman Collections/SW7-API-Tests.json +++ b/Postman Collections/SW7-API-Tests.json @@ -42,7 +42,7 @@ "response": [] }, { - "name": "New Request", + "name": "AddMeasurements", "id": "b6bc2627-eba2-409d-b32e-c7d573581300", "protocolProfileBehavior": { "disableBodyPruning": true From 99f64e76e75ba469e66d640ac9e6e3ccc9971748 Mon Sep 17 00:00:00 2001 From: Casper-NS <37834568+Casper-NS@users.noreply.github.com> Date: Mon, 27 Nov 2023 10:50:05 +0100 Subject: [PATCH 05/19] =?UTF-8?q?Casper=20Nyvang=20S=C3=B8rensen=20updated?= =?UTF-8?q?=20SW7-API-Tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Postman Collections/SW7-API-Tests.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Postman Collections/SW7-API-Tests.json b/Postman Collections/SW7-API-Tests.json index f4b4360..6fc9dda 100644 --- a/Postman Collections/SW7-API-Tests.json +++ b/Postman Collections/SW7-API-Tests.json @@ -42,7 +42,7 @@ "response": [] }, { - "name": "AddMeasurements", + "name": "Add Measurements", "id": "b6bc2627-eba2-409d-b32e-c7d573581300", "protocolProfileBehavior": { "disableBodyPruning": true From 5708d8d35b4b380b6ee196209dd122f7623a07e8 Mon Sep 17 00:00:00 2001 From: Casper-NS <37834568+Casper-NS@users.noreply.github.com> Date: Mon, 27 Nov 2023 10:50:46 +0100 Subject: [PATCH 06/19] =?UTF-8?q?Casper=20Nyvang=20S=C3=B8rensen=20updated?= =?UTF-8?q?=20SW7-API-Tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Postman Collections/SW7-API-Tests.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Postman Collections/SW7-API-Tests.json b/Postman Collections/SW7-API-Tests.json index 6fc9dda..b20a2bf 100644 --- a/Postman Collections/SW7-API-Tests.json +++ b/Postman Collections/SW7-API-Tests.json @@ -48,8 +48,9 @@ "disableBodyPruning": true }, "request": { - "method": "GET", - "header": [] + "method": "POST", + "header": [], + "url": "http://localhost:8081/measurements/add" }, "response": [] } From 7688d1aaf0c0997fa1cdc2691d81ba47216bd4fe Mon Sep 17 00:00:00 2001 From: Casper-NS <37834568+Casper-NS@users.noreply.github.com> Date: Mon, 27 Nov 2023 10:54:18 +0100 Subject: [PATCH 07/19] =?UTF-8?q?Casper=20Nyvang=20S=C3=B8rensen=20updated?= =?UTF-8?q?=20SW7-API-Tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Postman Collections/SW7-API-Tests.json | 29 +++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/Postman Collections/SW7-API-Tests.json b/Postman Collections/SW7-API-Tests.json index b20a2bf..b3159cb 100644 --- a/Postman Collections/SW7-API-Tests.json +++ b/Postman Collections/SW7-API-Tests.json @@ -50,7 +50,34 @@ "request": { "method": "POST", "header": [], - "url": "http://localhost:8081/measurements/add" + "body": { + "mode": "raw", + "raw": "{\n \"measurements\":[\n {\n \"type\": \"0\",\n \"macaddress\": \"11:22:33:44:55:66\",\n \"measurement\": -30\n },\n {\n \"type\": \"0\",\n \"macaddress\": \"11:22:33:44:55:77\",\n \"measurement\": -40\n },\n {\n \"type\": \"1\",\n \"macaddress\": \"11:22:33:44:55:66\",\n \"measurement\": -20\n },\n {\n \"type\": \"1\",\n \"macaddress\": \"11:22:33:44:55:77\",\n \"measurement\": -30\n }\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://localhost:8081/measurements/add?roomId=1", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "8081", + "path": [ + "measurements", + "add" + ], + "query": [ + { + "key": "roomId", + "value": "1", + "type": "text" + } + ] + } }, "response": [] } From 6f721c1beeb7d63d575a796110d897fe885b2d4f Mon Sep 17 00:00:00 2001 From: Casper-NS <37834568+Casper-NS@users.noreply.github.com> Date: Mon, 27 Nov 2023 11:02:13 +0100 Subject: [PATCH 08/19] =?UTF-8?q?Casper=20Nyvang=20S=C3=B8rensen=20updated?= =?UTF-8?q?=20SW7-API-Tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Postman Collections/SW7-API-Tests.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Postman Collections/SW7-API-Tests.json b/Postman Collections/SW7-API-Tests.json index b3159cb..5501b4b 100644 --- a/Postman Collections/SW7-API-Tests.json +++ b/Postman Collections/SW7-API-Tests.json @@ -52,7 +52,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\n \"measurements\":[\n {\n \"type\": \"0\",\n \"macaddress\": \"11:22:33:44:55:66\",\n \"measurement\": -30\n },\n {\n \"type\": \"0\",\n \"macaddress\": \"11:22:33:44:55:77\",\n \"measurement\": -40\n },\n {\n \"type\": \"1\",\n \"macaddress\": \"11:22:33:44:55:66\",\n \"measurement\": -20\n },\n {\n \"type\": \"1\",\n \"macaddress\": \"11:22:33:44:55:77\",\n \"measurement\": -30\n }\n ]\n}", + "raw": "{\n {\n \"roomId\": 0,\n \"measurements\":[\n {\n \"type\": \"0\",\n \"macaddress\": \"11:22:33:44:55:66\",\n \"measurement\": -30\n },\n {\n \"type\": \"0\",\n \"macaddress\": \"11:22:33:44:55:77\",\n \"measurement\": -40\n },\n {\n \"type\": \"1\",\n \"macaddress\": \"11:22:33:44:55:66\",\n \"measurement\": -20\n },\n {\n \"type\": \"1\",\n \"macaddress\": \"11:22:33:44:55:77\",\n \"measurement\": -30\n }\n ]\n}", "options": { "raw": { "language": "json" @@ -60,7 +60,7 @@ } }, "url": { - "raw": "http://localhost:8081/measurements/add?roomId=1", + "raw": "http://localhost:8081/measurements/add", "protocol": "http", "host": [ "localhost" @@ -74,7 +74,7 @@ { "key": "roomId", "value": "1", - "type": "text" + "disabled": true } ] } From cdefd710b991c8ac6751368e1bdf31dff523df35 Mon Sep 17 00:00:00 2001 From: Casper-NS <37834568+Casper-NS@users.noreply.github.com> Date: Mon, 27 Nov 2023 11:02:22 +0100 Subject: [PATCH 09/19] =?UTF-8?q?Casper=20Nyvang=20S=C3=B8rensen=20updated?= =?UTF-8?q?=20SW7-API-Tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Postman Collections/SW7-API-Tests.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Postman Collections/SW7-API-Tests.json b/Postman Collections/SW7-API-Tests.json index 5501b4b..17d4e42 100644 --- a/Postman Collections/SW7-API-Tests.json +++ b/Postman Collections/SW7-API-Tests.json @@ -52,7 +52,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\n {\n \"roomId\": 0,\n \"measurements\":[\n {\n \"type\": \"0\",\n \"macaddress\": \"11:22:33:44:55:66\",\n \"measurement\": -30\n },\n {\n \"type\": \"0\",\n \"macaddress\": \"11:22:33:44:55:77\",\n \"measurement\": -40\n },\n {\n \"type\": \"1\",\n \"macaddress\": \"11:22:33:44:55:66\",\n \"measurement\": -20\n },\n {\n \"type\": \"1\",\n \"macaddress\": \"11:22:33:44:55:77\",\n \"measurement\": -30\n }\n ]\n}", + "raw": "{\n \"roomId\": 0,\n \"measurements\":[\n {\n \"type\": \"0\",\n \"macaddress\": \"11:22:33:44:55:66\",\n \"measurement\": -30\n },\n {\n \"type\": \"0\",\n \"macaddress\": \"11:22:33:44:55:77\",\n \"measurement\": -40\n },\n {\n \"type\": \"1\",\n \"macaddress\": \"11:22:33:44:55:66\",\n \"measurement\": -20\n },\n {\n \"type\": \"1\",\n \"macaddress\": \"11:22:33:44:55:77\",\n \"measurement\": -30\n }\n ]\n}", "options": { "raw": { "language": "json" From b8031c112137ecd0ead6e39858926e6056dfd3dc Mon Sep 17 00:00:00 2001 From: Casper-NS <37834568+Casper-NS@users.noreply.github.com> Date: Mon, 27 Nov 2023 11:03:25 +0100 Subject: [PATCH 10/19] =?UTF-8?q?Casper=20Nyvang=20S=C3=B8rensen=20updated?= =?UTF-8?q?=20SW7-API-Tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Postman Collections/SW7-API-Tests.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Postman Collections/SW7-API-Tests.json b/Postman Collections/SW7-API-Tests.json index 17d4e42..816bda9 100644 --- a/Postman Collections/SW7-API-Tests.json +++ b/Postman Collections/SW7-API-Tests.json @@ -52,7 +52,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\n \"roomId\": 0,\n \"measurements\":[\n {\n \"type\": \"0\",\n \"macaddress\": \"11:22:33:44:55:66\",\n \"measurement\": -30\n },\n {\n \"type\": \"0\",\n \"macaddress\": \"11:22:33:44:55:77\",\n \"measurement\": -40\n },\n {\n \"type\": \"1\",\n \"macaddress\": \"11:22:33:44:55:66\",\n \"measurement\": -20\n },\n {\n \"type\": \"1\",\n \"macaddress\": \"11:22:33:44:55:77\",\n \"measurement\": -30\n }\n ]\n}", + "raw": "{\n \"roomId\": 1,\n \"measurements\":[\n {\n \"type\": \"0\",\n \"macaddress\": \"11:22:33:44:55:66\",\n \"rssi\": -30\n },\n {\n \"type\": \"0\",\n \"macaddress\": \"11:22:33:44:55:77\",\n \"rssi\": -40\n },\n {\n \"type\": \"1\",\n \"macaddress\": \"11:22:33:44:55:66\",\n \"rssi\": -20\n },\n {\n \"type\": \"1\",\n \"macaddress\": \"11:22:33:44:55:77\",\n \"rssi\": -30\n }\n ]\n}", "options": { "raw": { "language": "json" From aa729edcccde34b0d867443ebba1f8657b030170 Mon Sep 17 00:00:00 2001 From: Casper-NS <37834568+Casper-NS@users.noreply.github.com> Date: Mon, 27 Nov 2023 11:06:29 +0100 Subject: [PATCH 11/19] =?UTF-8?q?Casper=20Nyvang=20S=C3=B8rensen=20updated?= =?UTF-8?q?=20SW7-API-Tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Postman Collections/SW7-API-Tests.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Postman Collections/SW7-API-Tests.json b/Postman Collections/SW7-API-Tests.json index 816bda9..b9230c6 100644 --- a/Postman Collections/SW7-API-Tests.json +++ b/Postman Collections/SW7-API-Tests.json @@ -52,7 +52,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\n \"roomId\": 1,\n \"measurements\":[\n {\n \"type\": \"0\",\n \"macaddress\": \"11:22:33:44:55:66\",\n \"rssi\": -30\n },\n {\n \"type\": \"0\",\n \"macaddress\": \"11:22:33:44:55:77\",\n \"rssi\": -40\n },\n {\n \"type\": \"1\",\n \"macaddress\": \"11:22:33:44:55:66\",\n \"rssi\": -20\n },\n {\n \"type\": \"1\",\n \"macaddress\": \"11:22:33:44:55:77\",\n \"rssi\": -30\n }\n ]\n}", + "raw": "{\n \"roomId\": 1,\n \"measurements\":[\n {\n \"macaddress\": \"11:22:33:44:55:66\",\n \"type\": 0,\n \"rssi\": -30\n },\n {\n \"macaddress\": \"11:22:33:44:55:77\",\n \"type\": 0,\n \"rssi\": -40\n },\n {\n \"macaddress\": \"11:22:33:44:55:66\",\n \"type\": 1,\n \"rssi\": -20\n },\n {\n \"macaddress\": \"11:22:33:44:55:77\",\n \"type\": 1,\n \"rssi\": -30\n }\n ]\n}", "options": { "raw": { "language": "json" From bfeec0f0a6cead4353c115fb5bc276ff47237c52 Mon Sep 17 00:00:00 2001 From: Casper-NS <37834568+Casper-NS@users.noreply.github.com> Date: Tue, 28 Nov 2023 11:31:35 +0100 Subject: [PATCH 12/19] =?UTF-8?q?Casper=20Nyvang=20S=C3=B8rensen=20updated?= =?UTF-8?q?=20SW7-API-Tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Postman Collections/SW7-API-Tests.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Postman Collections/SW7-API-Tests.json b/Postman Collections/SW7-API-Tests.json index b9230c6..4ebc838 100644 --- a/Postman Collections/SW7-API-Tests.json +++ b/Postman Collections/SW7-API-Tests.json @@ -52,7 +52,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\n \"roomId\": 1,\n \"measurements\":[\n {\n \"macaddress\": \"11:22:33:44:55:66\",\n \"type\": 0,\n \"rssi\": -30\n },\n {\n \"macaddress\": \"11:22:33:44:55:77\",\n \"type\": 0,\n \"rssi\": -40\n },\n {\n \"macaddress\": \"11:22:33:44:55:66\",\n \"type\": 1,\n \"rssi\": -20\n },\n {\n \"macaddress\": \"11:22:33:44:55:77\",\n \"type\": 1,\n \"rssi\": -30\n }\n ]\n}", + "raw": "{\n \"roomId\": 1,\n \"measurements\":[\n {\n \"macAddress\": \"11:22:33:44:55:66\",\n \"type\": 0,\n \"rssi\": -30\n },\n {\n \"macAddress\": \"11:22:33:44:55:77\",\n \"type\": 0,\n \"rssi\": -40\n },\n {\n \"macAddress\": \"11:22:33:44:55:66\",\n \"type\": 1,\n \"rssi\": -20\n },\n {\n \"macAddress\": \"11:22:33:44:55:77\",\n \"type\": 1,\n \"rssi\": -30\n }\n ]\n}", "options": { "raw": { "language": "json" From a6590a1ffec65f06320b5cb8baeca2b7ba4471cf Mon Sep 17 00:00:00 2001 From: Casper-NS <37834568+Casper-NS@users.noreply.github.com> Date: Wed, 29 Nov 2023 11:30:35 +0100 Subject: [PATCH 13/19] =?UTF-8?q?Casper=20Nyvang=20S=C3=B8rensen=20updated?= =?UTF-8?q?=20SW7-API-Tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Postman Collections/SW7-API-Tests.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Postman Collections/SW7-API-Tests.json b/Postman Collections/SW7-API-Tests.json index 4ebc838..7cecd72 100644 --- a/Postman Collections/SW7-API-Tests.json +++ b/Postman Collections/SW7-API-Tests.json @@ -52,7 +52,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\n \"roomId\": 1,\n \"measurements\":[\n {\n \"macAddress\": \"11:22:33:44:55:66\",\n \"type\": 0,\n \"rssi\": -30\n },\n {\n \"macAddress\": \"11:22:33:44:55:77\",\n \"type\": 0,\n \"rssi\": -40\n },\n {\n \"macAddress\": \"11:22:33:44:55:66\",\n \"type\": 1,\n \"rssi\": -20\n },\n {\n \"macAddress\": \"11:22:33:44:55:77\",\n \"type\": 1,\n \"rssi\": -30\n }\n ]\n}", + "raw": "{\n \"trackerId\": 1,\n \"measurements\":[\n {\n \"macAddress\": \"11:22:33:44:55:66\",\n \"type\": 0,\n \"rssi\": -30\n },\n {\n \"macAddress\": \"11:22:33:44:55:77\",\n \"type\": 0,\n \"rssi\": -40\n },\n {\n \"macAddress\": \"11:22:33:44:55:66\",\n \"type\": 1,\n \"rssi\": -20\n },\n {\n \"macAddress\": \"11:22:33:44:55:77\",\n \"type\": 1,\n \"rssi\": -30\n }\n ]\n}", "options": { "raw": { "language": "json" From 3355a4bbfcd97ad6c3a5e5cc8e081c0db8d026f8 Mon Sep 17 00:00:00 2001 From: Casper-NS <37834568+Casper-NS@users.noreply.github.com> Date: Fri, 8 Dec 2023 12:52:34 +0100 Subject: [PATCH 14/19] =?UTF-8?q?Casper=20Nyvang=20S=C3=B8rensen=20updated?= =?UTF-8?q?=20SW7-API-Tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Postman Collections/SW7-API-Tests.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Postman Collections/SW7-API-Tests.json b/Postman Collections/SW7-API-Tests.json index 7cecd72..34e7452 100644 --- a/Postman Collections/SW7-API-Tests.json +++ b/Postman Collections/SW7-API-Tests.json @@ -52,7 +52,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\n \"trackerId\": 1,\n \"measurements\":[\n {\n \"macAddress\": \"11:22:33:44:55:66\",\n \"type\": 0,\n \"rssi\": -30\n },\n {\n \"macAddress\": \"11:22:33:44:55:77\",\n \"type\": 0,\n \"rssi\": -40\n },\n {\n \"macAddress\": \"11:22:33:44:55:66\",\n \"type\": 1,\n \"rssi\": -20\n },\n {\n \"macAddress\": \"11:22:33:44:55:77\",\n \"type\": 1,\n \"rssi\": -30\n }\n ]\n}", + "raw": "{\n \"trackerId\": 1,\n \"measurements\":[\n {\n \"macAddress\": \"11:22:33:44:55:66\",\n \"type\": 0,\n \"rssi\": -30\n },\n {\n \"macAddress\": \"11:22:33:44:55:77\",\n \"type\": 0,\n \"rssi\": -40\n },\n {\n \"macAddress\": \"11:22:33:44:55:66\",\n \"type\": 1,\n \"rssi\": -20\n },\n {\n \"macAddress\": \"11:22:33:44:55:77\",\n \"type\": 1,\n \"rssi\": -30\n },\n {\n \"macAddress\": \"11:22:33:44:55:68\",\n \"type\": 0,\n \"rssi\": -30\n },\n {\n \"macAddress\": \"11:22:33:44:55:78\",\n \"type\": 0,\n \"rssi\": -40\n },\n {\n \"macAddress\": \"11:22:33:44:55:68\",\n \"type\": 1,\n \"rssi\": -20\n },\n {\n \"macAddress\": \"11:22:33:44:55:78\",\n \"type\": 1,\n \"rssi\": -30\n },\n {\n \"macAddress\": \"11:22:33:44:55:79\",\n \"type\": 0,\n \"rssi\": -40\n },\n {\n \"macAddress\": \"11:22:33:44:55:69\",\n \"type\": 1,\n \"rssi\": -20\n },\n ]\n}", "options": { "raw": { "language": "json" From b7de509934c2da385191cd3425de63142a53814d Mon Sep 17 00:00:00 2001 From: Casper-NS <37834568+Casper-NS@users.noreply.github.com> Date: Fri, 8 Dec 2023 12:57:50 +0100 Subject: [PATCH 15/19] =?UTF-8?q?Casper=20Nyvang=20S=C3=B8rensen=20updated?= =?UTF-8?q?=20SW7-API-Tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Postman Collections/SW7-API-Tests.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Postman Collections/SW7-API-Tests.json b/Postman Collections/SW7-API-Tests.json index 34e7452..5ee2406 100644 --- a/Postman Collections/SW7-API-Tests.json +++ b/Postman Collections/SW7-API-Tests.json @@ -43,6 +43,18 @@ }, { "name": "Add Measurements", + "event": [ + { + "listen": "test", + "script": { + "id": "d804bb6e-1e0a-495f-becf-958cfcef20b1", + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], "id": "b6bc2627-eba2-409d-b32e-c7d573581300", "protocolProfileBehavior": { "disableBodyPruning": true From 2ba4414b86c3157187bd5957e027a592d3d640c8 Mon Sep 17 00:00:00 2001 From: Casper-NS <37834568+Casper-NS@users.noreply.github.com> Date: Mon, 18 Dec 2023 13:20:17 +0100 Subject: [PATCH 16/19] =?UTF-8?q?Casper=20Nyvang=20S=C3=B8rensen=20updated?= =?UTF-8?q?=20SW7-API-Tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Postman Collections/SW7-API-Tests.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Postman Collections/SW7-API-Tests.json b/Postman Collections/SW7-API-Tests.json index 5ee2406..93bd345 100644 --- a/Postman Collections/SW7-API-Tests.json +++ b/Postman Collections/SW7-API-Tests.json @@ -64,7 +64,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\n \"trackerId\": 1,\n \"measurements\":[\n {\n \"macAddress\": \"11:22:33:44:55:66\",\n \"type\": 0,\n \"rssi\": -30\n },\n {\n \"macAddress\": \"11:22:33:44:55:77\",\n \"type\": 0,\n \"rssi\": -40\n },\n {\n \"macAddress\": \"11:22:33:44:55:66\",\n \"type\": 1,\n \"rssi\": -20\n },\n {\n \"macAddress\": \"11:22:33:44:55:77\",\n \"type\": 1,\n \"rssi\": -30\n },\n {\n \"macAddress\": \"11:22:33:44:55:68\",\n \"type\": 0,\n \"rssi\": -30\n },\n {\n \"macAddress\": \"11:22:33:44:55:78\",\n \"type\": 0,\n \"rssi\": -40\n },\n {\n \"macAddress\": \"11:22:33:44:55:68\",\n \"type\": 1,\n \"rssi\": -20\n },\n {\n \"macAddress\": \"11:22:33:44:55:78\",\n \"type\": 1,\n \"rssi\": -30\n },\n {\n \"macAddress\": \"11:22:33:44:55:79\",\n \"type\": 0,\n \"rssi\": -40\n },\n {\n \"macAddress\": \"11:22:33:44:55:69\",\n \"type\": 1,\n \"rssi\": -20\n },\n ]\n}", + "raw": "{\n \"trackerId\": 1,\n \"measurements\":[\n {\n \"macAddress\": \"11:22:33:44:55:66\",\n \"type\": 0,\n \"rssi\": -30\n },\n {\n \"macAddress\": \"11:22:33:44:55:77\",\n \"type\": 0,\n \"rssi\": -40\n },\n {\n \"macAddress\": \"11:22:33:44:55:66\",\n \"type\": 1,\n \"rssi\": -20\n },\n {\n \"macAddress\": \"11:22:33:44:55:77\",\n \"type\": 1,\n \"rssi\": -30\n },\n {\n \"macAddress\": \"11:22:33:44:55:68\",\n \"type\": 0,\n \"rssi\": -30\n },\n {\n \"macAddress\": \"11:22:33:44:55:78\",\n \"type\": 0,\n \"rssi\": -40\n },\n {\n \"macAddress\": \"11:22:33:44:55:68\",\n \"type\": 1,\n \"rssi\": -20\n },\n {\n \"macAddress\": \"11:22:33:44:55:78\",\n \"type\": 1,\n \"rssi\": -30\n },\n {\n \"macAddress\": \"11:22:33:44:55:79\",\n \"type\": 0,\n \"rssi\": -40\n },\n {\n \"macAddress\": \"11:22:33:44:55:69\",\n \"type\": 1,\n \"rssi\": -20\n }\n ]\n}", "options": { "raw": { "language": "json" From e29c8f8773ae5acccd835808f344e8323c0b5f3e Mon Sep 17 00:00:00 2001 From: Casper-NS <37834568+Casper-NS@users.noreply.github.com> Date: Mon, 18 Dec 2023 13:53:24 +0100 Subject: [PATCH 17/19] =?UTF-8?q?Casper=20Nyvang=20S=C3=B8rensen=20updated?= =?UTF-8?q?=20SW7-API-Tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Postman Collections/SW7-API-Tests.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Postman Collections/SW7-API-Tests.json b/Postman Collections/SW7-API-Tests.json index 93bd345..a122754 100644 --- a/Postman Collections/SW7-API-Tests.json +++ b/Postman Collections/SW7-API-Tests.json @@ -64,7 +64,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\n \"trackerId\": 1,\n \"measurements\":[\n {\n \"macAddress\": \"11:22:33:44:55:66\",\n \"type\": 0,\n \"rssi\": -30\n },\n {\n \"macAddress\": \"11:22:33:44:55:77\",\n \"type\": 0,\n \"rssi\": -40\n },\n {\n \"macAddress\": \"11:22:33:44:55:66\",\n \"type\": 1,\n \"rssi\": -20\n },\n {\n \"macAddress\": \"11:22:33:44:55:77\",\n \"type\": 1,\n \"rssi\": -30\n },\n {\n \"macAddress\": \"11:22:33:44:55:68\",\n \"type\": 0,\n \"rssi\": -30\n },\n {\n \"macAddress\": \"11:22:33:44:55:78\",\n \"type\": 0,\n \"rssi\": -40\n },\n {\n \"macAddress\": \"11:22:33:44:55:68\",\n \"type\": 1,\n \"rssi\": -20\n },\n {\n \"macAddress\": \"11:22:33:44:55:78\",\n \"type\": 1,\n \"rssi\": -30\n },\n {\n \"macAddress\": \"11:22:33:44:55:79\",\n \"type\": 0,\n \"rssi\": -40\n },\n {\n \"macAddress\": \"11:22:33:44:55:69\",\n \"type\": 1,\n \"rssi\": -20\n }\n ]\n}", + "raw": "{\n \"trackerId\": 1,\n \"measurements\":[\n {\n \"macAddress\": \"41:51:69\",\n \"type\": 0,\n \"rssi\": -9\n },\n {\n \"macAddress\": \"58:84:81\",\n \"type\": 1,\n \"rssi\": -28\n },\n {\n \"macAddress\": \"28:64:26\",\n \"type\": 1,\n \"rssi\": -95\n },\n {\n \"macAddress\": \"45:53:84\",\n \"type\": 1,\n \"rssi\": -58\n },\n {\n \"macAddress\": \"95:8:3\",\n \"type\": 1,\n \"rssi\": 4\n },\n {\n \"macAddress\": \"64:51:18\",\n \"type\": 0,\n \"rssi\": -81\n },\n {\n \"macAddress\": \"59:36:73\",\n \"type\": 0,\n \"rssi\": -93\n },\n {\n \"macAddress\": \"22:17:41\",\n \"type\": 1,\n \"rssi\": -39\n },\n {\n \"macAddress\": \"18:5:64\",\n \"type\": 0,\n \"rssi\": -74\n },\n {\n \"macAddress\": \"71:61:28\",\n \"type\": 0,\n \"rssi\": -32\n },\n {\n \"macAddress\": \"92:56:19\",\n \"type\": 1,\n \"rssi\": -67\n },\n {\n \"macAddress\": \"35:73:4\",\n \"type\": 1,\n \"rssi\": -65\n },\n {\n \"macAddress\": \"8:70:97\",\n \"type\": 0,\n \"rssi\": -21\n },\n {\n \"macAddress\": \"76:11:36\",\n \"type\": 0,\n \"rssi\": -78\n },\n {\n \"macAddress\": \"2:49:72\",\n \"type\": 1,\n \"rssi\": -3\n },\n {\n \"macAddress\": \"29:66:73\",\n \"type\": 0,\n \"rssi\": -22\n },\n {\n \"macAddress\": \"17:87:86\",\n \"type\": 1,\n \"rssi\": -10\n },\n {\n \"macAddress\": \"59:81:90\",\n \"type\": 0,\n \"rssi\": -66\n },\n {\n \"macAddress\": \"60:33:20\",\n \"type\": 1,\n \"rssi\": -52\n },\n {\n \"macAddress\": \"78:12:53\",\n \"type\": 0,\n \"rssi\": -77\n },\n {\n \"macAddress\": \"23:14:50\",\n \"type\": 0,\n \"rssi\": -1\n },\n {\n \"macAddress\": \"36:45:70\",\n \"type\": 1,\n \"rssi\": -96\n },\n {\n \"macAddress\": \"42:15:65\",\n \"type\": 1,\n \"rssi\": -70\n },\n {\n \"macAddress\": \"87:49:14\",\n \"type\": 1,\n \"rssi\": -91\n },\n {\n \"macAddress\": \"23:4:11\",\n \"type\": 1,\n \"rssi\": -12\n },\n {\n \"macAddress\": \"41:40:82\",\n \"type\": 1,\n \"rssi\": -75\n },\n {\n \"macAddress\": \"50:36:85\",\n \"type\": 0,\n \"rssi\": -23\n },\n {\n \"macAddress\": \"13:95:97\",\n \"type\": 1,\n \"rssi\": -30\n },\n {\n \"macAddress\": \"13:53:69\",\n \"type\": 0,\n \"rssi\": -82\n },\n {\n \"macAddress\": \"94:38:38\",\n \"type\": 1,\n \"rssi\": -99\n },\n {\n \"macAddress\": \"0:53:78\",\n \"type\": 0,\n \"rssi\": -90\n },\n {\n \"macAddress\": \"99:4:27\",\n \"type\": 1,\n \"rssi\": -66\n },\n {\n \"macAddress\": \"25:11:55\",\n \"type\": 0,\n \"rssi\": -82\n },\n {\n \"macAddress\": \"95:46:84\",\n \"type\": 1,\n \"rssi\": -9\n },\n {\n \"macAddress\": \"93:13:16\",\n \"type\": 1,\n \"rssi\": -27\n },\n {\n \"macAddress\": \"73:97:54\",\n \"type\": 1,\n \"rssi\": -54\n },\n {\n \"macAddress\": \"82:86:10\",\n \"type\": 1,\n \"rssi\": -22\n },\n {\n \"macAddress\": \"21:26:67\",\n \"type\": 0,\n \"rssi\": -56\n },\n {\n \"macAddress\": \"14:85:10\",\n \"type\": 1,\n \"rssi\": -14\n },\n {\n \"macAddress\": \"40:33:90\",\n \"type\": 0,\n \"rssi\": -86\n },\n {\n \"macAddress\": \"50:82:63\",\n \"type\": 1,\n \"rssi\": -5\n },\n {\n \"macAddress\": \"72:89:8\",\n \"type\": 0,\n \"rssi\": -66\n },\n {\n \"macAddress\": \"3:31:10\",\n \"type\": 1,\n \"rssi\": -10\n },\n {\n \"macAddress\": \"48:90:60\",\n \"type\": 0,\n \"rssi\": 0\n },\n {\n \"macAddress\": \"60:25:93\",\n \"type\": 0,\n \"rssi\": -61\n },\n {\n \"macAddress\": \"19:27:90\",\n \"type\": 0,\n \"rssi\": 9\n },\n {\n \"macAddress\": \"85:75:76\",\n \"type\": 1,\n \"rssi\": 0\n },\n {\n \"macAddress\": \"37:32:87\",\n \"type\": 1,\n \"rssi\": -63\n },\n {\n \"macAddress\": \"54:0:35\",\n \"type\": 1,\n \"rssi\": -50\n },\n {\n \"macAddress\": \"72:94:19\",\n \"type\": 1,\n \"rssi\": -60\n },\n {\n \"macAddress\": \"58:40:54\",\n \"type\": 0,\n \"rssi\": -27\n },\n {\n \"macAddress\": \"93:63:8\",\n \"type\": 0,\n \"rssi\": -64\n },\n {\n \"macAddress\": \"39:49:44\",\n \"type\": 0,\n \"rssi\": -85\n },\n {\n \"macAddress\": \"79:95:76\",\n \"type\": 0,\n \"rssi\": -13\n },\n {\n \"macAddress\": \"41:93:78\",\n \"type\": 0,\n \"rssi\": -75\n },\n {\n \"macAddress\": \"16:50:70\",\n \"type\": 1,\n \"rssi\": -95\n },\n {\n \"macAddress\": \"20:99:50\",\n \"type\": 1,\n \"rssi\": -77\n },\n {\n \"macAddress\": \"20:88:6\",\n \"type\": 0,\n \"rssi\": -48\n },\n {\n \"macAddress\": \"80:74:81\",\n \"type\": 1,\n \"rssi\": -91\n },\n {\n \"macAddress\": \"5:91:80\",\n \"type\": 1,\n \"rssi\": -70\n },\n {\n \"macAddress\": \"52:17:21\",\n \"type\": 0,\n \"rssi\": -33\n },\n {\n \"macAddress\": \"0:5:49\",\n \"type\": 1,\n \"rssi\": -65\n },\n {\n \"macAddress\": \"87:59:44\",\n \"type\": 1,\n \"rssi\": -91\n },\n {\n \"macAddress\": \"27:43:21\",\n \"type\": 0,\n \"rssi\": -15\n },\n {\n \"macAddress\": \"10:47:51\",\n \"type\": 0,\n \"rssi\": -96\n },\n {\n \"macAddress\": \"93:74:35\",\n \"type\": 1,\n \"rssi\": -78\n },\n {\n \"macAddress\": \"27:66:45\",\n \"type\": 1,\n \"rssi\": -42\n },\n {\n \"macAddress\": \"96:74:16\",\n \"type\": 0,\n \"rssi\": 9\n },\n {\n \"macAddress\": \"17:85:19\",\n \"type\": 0,\n \"rssi\": -13\n },\n {\n \"macAddress\": \"29:16:51\",\n \"type\": 1,\n \"rssi\": -36\n },\n {\n \"macAddress\": \"31:29:3\",\n \"type\": 0,\n \"rssi\": -79\n },\n {\n \"macAddress\": \"18:75:99\",\n \"type\": 0,\n \"rssi\": -7\n },\n {\n \"macAddress\": \"11:34:91\",\n \"type\": 1,\n \"rssi\": -65\n },\n {\n \"macAddress\": \"80:89:65\",\n \"type\": 1,\n \"rssi\": -86\n },\n {\n \"macAddress\": \"23:29:20\",\n \"type\": 0,\n \"rssi\": -90\n },\n {\n \"macAddress\": \"44:60:0\",\n \"type\": 1,\n \"rssi\": -59\n },\n {\n \"macAddress\": \"63:15:95\",\n \"type\": 0,\n \"rssi\": -63\n },\n {\n \"macAddress\": \"90:85:53\",\n \"type\": 0,\n \"rssi\": -60\n },\n {\n \"macAddress\": \"14:91:50\",\n \"type\": 0,\n \"rssi\": 5\n },\n {\n \"macAddress\": \"50:3:46\",\n \"type\": 0,\n \"rssi\": -70\n },\n {\n \"macAddress\": \"59:46:45\",\n \"type\": 0,\n \"rssi\": -14\n },\n {\n \"macAddress\": \"10:10:52\",\n \"type\": 1,\n \"rssi\": -37\n },\n {\n \"macAddress\": \"94:95:26\",\n \"type\": 1,\n \"rssi\": -39\n },\n {\n \"macAddress\": \"60:84:98\",\n \"type\": 1,\n \"rssi\": -17\n },\n {\n \"macAddress\": \"84:60:83\",\n \"type\": 1,\n \"rssi\": -34\n },\n {\n \"macAddress\": \"69:39:14\",\n \"type\": 0,\n \"rssi\": -66\n },\n {\n \"macAddress\": \"90:63:71\",\n \"type\": 1,\n \"rssi\": -38\n },\n {\n \"macAddress\": \"63:85:37\",\n \"type\": 1,\n \"rssi\": -96\n },\n {\n \"macAddress\": \"15:38:11\",\n \"type\": 1,\n \"rssi\": -87\n },\n {\n \"macAddress\": \"17:77:56\",\n \"type\": 0,\n \"rssi\": -91\n },\n {\n \"macAddress\": \"94:47:44\",\n \"type\": 0,\n \"rssi\": -80\n },\n {\n \"macAddress\": \"38:33:67\",\n \"type\": 1,\n \"rssi\": 8\n },\n {\n \"macAddress\": \"50:4:58\",\n \"type\": 1,\n \"rssi\": -84\n },\n {\n \"macAddress\": \"62:12:66\",\n \"type\": 1,\n \"rssi\": -5\n },\n {\n \"macAddress\": \"89:22:81\",\n \"type\": 1,\n \"rssi\": -41\n },\n {\n \"macAddress\": \"2:26:50\",\n \"type\": 0,\n \"rssi\": -4\n },\n {\n \"macAddress\": \"80:52:33\",\n \"type\": 1,\n \"rssi\": -34\n },\n {\n \"macAddress\": \"51:33:17\",\n \"type\": 1,\n \"rssi\": -14\n },\n {\n \"macAddress\": \"0:69:75\",\n \"type\": 1,\n \"rssi\": -40\n },\n {\n \"macAddress\": \"3:77:87\",\n \"type\": 1,\n \"rssi\": -55\n }\n ]\n}", "options": { "raw": { "language": "json" From 2d35221073ce1c6f1ddaf17d153c852eed5e11fd Mon Sep 17 00:00:00 2001 From: Casper-NS <37834568+Casper-NS@users.noreply.github.com> Date: Mon, 18 Dec 2023 13:58:50 +0100 Subject: [PATCH 18/19] =?UTF-8?q?Casper=20Nyvang=20S=C3=B8rensen=20updated?= =?UTF-8?q?=20SW7-API-Tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Postman Collections/SW7-API-Tests.json | 52 -------------------------- 1 file changed, 52 deletions(-) diff --git a/Postman Collections/SW7-API-Tests.json b/Postman Collections/SW7-API-Tests.json index a122754..1d1f27c 100644 --- a/Postman Collections/SW7-API-Tests.json +++ b/Postman Collections/SW7-API-Tests.json @@ -40,58 +40,6 @@ "url": "http://localhost:8081/room/add" }, "response": [] - }, - { - "name": "Add Measurements", - "event": [ - { - "listen": "test", - "script": { - "id": "d804bb6e-1e0a-495f-becf-958cfcef20b1", - "exec": [ - "" - ], - "type": "text/javascript" - } - } - ], - "id": "b6bc2627-eba2-409d-b32e-c7d573581300", - "protocolProfileBehavior": { - "disableBodyPruning": true - }, - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{\n \"trackerId\": 1,\n \"measurements\":[\n {\n \"macAddress\": \"41:51:69\",\n \"type\": 0,\n \"rssi\": -9\n },\n {\n \"macAddress\": \"58:84:81\",\n \"type\": 1,\n \"rssi\": -28\n },\n {\n \"macAddress\": \"28:64:26\",\n \"type\": 1,\n \"rssi\": -95\n },\n {\n \"macAddress\": \"45:53:84\",\n \"type\": 1,\n \"rssi\": -58\n },\n {\n \"macAddress\": \"95:8:3\",\n \"type\": 1,\n \"rssi\": 4\n },\n {\n \"macAddress\": \"64:51:18\",\n \"type\": 0,\n \"rssi\": -81\n },\n {\n \"macAddress\": \"59:36:73\",\n \"type\": 0,\n \"rssi\": -93\n },\n {\n \"macAddress\": \"22:17:41\",\n \"type\": 1,\n \"rssi\": -39\n },\n {\n \"macAddress\": \"18:5:64\",\n \"type\": 0,\n \"rssi\": -74\n },\n {\n \"macAddress\": \"71:61:28\",\n \"type\": 0,\n \"rssi\": -32\n },\n {\n \"macAddress\": \"92:56:19\",\n \"type\": 1,\n \"rssi\": -67\n },\n {\n \"macAddress\": \"35:73:4\",\n \"type\": 1,\n \"rssi\": -65\n },\n {\n \"macAddress\": \"8:70:97\",\n \"type\": 0,\n \"rssi\": -21\n },\n {\n \"macAddress\": \"76:11:36\",\n \"type\": 0,\n \"rssi\": -78\n },\n {\n \"macAddress\": \"2:49:72\",\n \"type\": 1,\n \"rssi\": -3\n },\n {\n \"macAddress\": \"29:66:73\",\n \"type\": 0,\n \"rssi\": -22\n },\n {\n \"macAddress\": \"17:87:86\",\n \"type\": 1,\n \"rssi\": -10\n },\n {\n \"macAddress\": \"59:81:90\",\n \"type\": 0,\n \"rssi\": -66\n },\n {\n \"macAddress\": \"60:33:20\",\n \"type\": 1,\n \"rssi\": -52\n },\n {\n \"macAddress\": \"78:12:53\",\n \"type\": 0,\n \"rssi\": -77\n },\n {\n \"macAddress\": \"23:14:50\",\n \"type\": 0,\n \"rssi\": -1\n },\n {\n \"macAddress\": \"36:45:70\",\n \"type\": 1,\n \"rssi\": -96\n },\n {\n \"macAddress\": \"42:15:65\",\n \"type\": 1,\n \"rssi\": -70\n },\n {\n \"macAddress\": \"87:49:14\",\n \"type\": 1,\n \"rssi\": -91\n },\n {\n \"macAddress\": \"23:4:11\",\n \"type\": 1,\n \"rssi\": -12\n },\n {\n \"macAddress\": \"41:40:82\",\n \"type\": 1,\n \"rssi\": -75\n },\n {\n \"macAddress\": \"50:36:85\",\n \"type\": 0,\n \"rssi\": -23\n },\n {\n \"macAddress\": \"13:95:97\",\n \"type\": 1,\n \"rssi\": -30\n },\n {\n \"macAddress\": \"13:53:69\",\n \"type\": 0,\n \"rssi\": -82\n },\n {\n \"macAddress\": \"94:38:38\",\n \"type\": 1,\n \"rssi\": -99\n },\n {\n \"macAddress\": \"0:53:78\",\n \"type\": 0,\n \"rssi\": -90\n },\n {\n \"macAddress\": \"99:4:27\",\n \"type\": 1,\n \"rssi\": -66\n },\n {\n \"macAddress\": \"25:11:55\",\n \"type\": 0,\n \"rssi\": -82\n },\n {\n \"macAddress\": \"95:46:84\",\n \"type\": 1,\n \"rssi\": -9\n },\n {\n \"macAddress\": \"93:13:16\",\n \"type\": 1,\n \"rssi\": -27\n },\n {\n \"macAddress\": \"73:97:54\",\n \"type\": 1,\n \"rssi\": -54\n },\n {\n \"macAddress\": \"82:86:10\",\n \"type\": 1,\n \"rssi\": -22\n },\n {\n \"macAddress\": \"21:26:67\",\n \"type\": 0,\n \"rssi\": -56\n },\n {\n \"macAddress\": \"14:85:10\",\n \"type\": 1,\n \"rssi\": -14\n },\n {\n \"macAddress\": \"40:33:90\",\n \"type\": 0,\n \"rssi\": -86\n },\n {\n \"macAddress\": \"50:82:63\",\n \"type\": 1,\n \"rssi\": -5\n },\n {\n \"macAddress\": \"72:89:8\",\n \"type\": 0,\n \"rssi\": -66\n },\n {\n \"macAddress\": \"3:31:10\",\n \"type\": 1,\n \"rssi\": -10\n },\n {\n \"macAddress\": \"48:90:60\",\n \"type\": 0,\n \"rssi\": 0\n },\n {\n \"macAddress\": \"60:25:93\",\n \"type\": 0,\n \"rssi\": -61\n },\n {\n \"macAddress\": \"19:27:90\",\n \"type\": 0,\n \"rssi\": 9\n },\n {\n \"macAddress\": \"85:75:76\",\n \"type\": 1,\n \"rssi\": 0\n },\n {\n \"macAddress\": \"37:32:87\",\n \"type\": 1,\n \"rssi\": -63\n },\n {\n \"macAddress\": \"54:0:35\",\n \"type\": 1,\n \"rssi\": -50\n },\n {\n \"macAddress\": \"72:94:19\",\n \"type\": 1,\n \"rssi\": -60\n },\n {\n \"macAddress\": \"58:40:54\",\n \"type\": 0,\n \"rssi\": -27\n },\n {\n \"macAddress\": \"93:63:8\",\n \"type\": 0,\n \"rssi\": -64\n },\n {\n \"macAddress\": \"39:49:44\",\n \"type\": 0,\n \"rssi\": -85\n },\n {\n \"macAddress\": \"79:95:76\",\n \"type\": 0,\n \"rssi\": -13\n },\n {\n \"macAddress\": \"41:93:78\",\n \"type\": 0,\n \"rssi\": -75\n },\n {\n \"macAddress\": \"16:50:70\",\n \"type\": 1,\n \"rssi\": -95\n },\n {\n \"macAddress\": \"20:99:50\",\n \"type\": 1,\n \"rssi\": -77\n },\n {\n \"macAddress\": \"20:88:6\",\n \"type\": 0,\n \"rssi\": -48\n },\n {\n \"macAddress\": \"80:74:81\",\n \"type\": 1,\n \"rssi\": -91\n },\n {\n \"macAddress\": \"5:91:80\",\n \"type\": 1,\n \"rssi\": -70\n },\n {\n \"macAddress\": \"52:17:21\",\n \"type\": 0,\n \"rssi\": -33\n },\n {\n \"macAddress\": \"0:5:49\",\n \"type\": 1,\n \"rssi\": -65\n },\n {\n \"macAddress\": \"87:59:44\",\n \"type\": 1,\n \"rssi\": -91\n },\n {\n \"macAddress\": \"27:43:21\",\n \"type\": 0,\n \"rssi\": -15\n },\n {\n \"macAddress\": \"10:47:51\",\n \"type\": 0,\n \"rssi\": -96\n },\n {\n \"macAddress\": \"93:74:35\",\n \"type\": 1,\n \"rssi\": -78\n },\n {\n \"macAddress\": \"27:66:45\",\n \"type\": 1,\n \"rssi\": -42\n },\n {\n \"macAddress\": \"96:74:16\",\n \"type\": 0,\n \"rssi\": 9\n },\n {\n \"macAddress\": \"17:85:19\",\n \"type\": 0,\n \"rssi\": -13\n },\n {\n \"macAddress\": \"29:16:51\",\n \"type\": 1,\n \"rssi\": -36\n },\n {\n \"macAddress\": \"31:29:3\",\n \"type\": 0,\n \"rssi\": -79\n },\n {\n \"macAddress\": \"18:75:99\",\n \"type\": 0,\n \"rssi\": -7\n },\n {\n \"macAddress\": \"11:34:91\",\n \"type\": 1,\n \"rssi\": -65\n },\n {\n \"macAddress\": \"80:89:65\",\n \"type\": 1,\n \"rssi\": -86\n },\n {\n \"macAddress\": \"23:29:20\",\n \"type\": 0,\n \"rssi\": -90\n },\n {\n \"macAddress\": \"44:60:0\",\n \"type\": 1,\n \"rssi\": -59\n },\n {\n \"macAddress\": \"63:15:95\",\n \"type\": 0,\n \"rssi\": -63\n },\n {\n \"macAddress\": \"90:85:53\",\n \"type\": 0,\n \"rssi\": -60\n },\n {\n \"macAddress\": \"14:91:50\",\n \"type\": 0,\n \"rssi\": 5\n },\n {\n \"macAddress\": \"50:3:46\",\n \"type\": 0,\n \"rssi\": -70\n },\n {\n \"macAddress\": \"59:46:45\",\n \"type\": 0,\n \"rssi\": -14\n },\n {\n \"macAddress\": \"10:10:52\",\n \"type\": 1,\n \"rssi\": -37\n },\n {\n \"macAddress\": \"94:95:26\",\n \"type\": 1,\n \"rssi\": -39\n },\n {\n \"macAddress\": \"60:84:98\",\n \"type\": 1,\n \"rssi\": -17\n },\n {\n \"macAddress\": \"84:60:83\",\n \"type\": 1,\n \"rssi\": -34\n },\n {\n \"macAddress\": \"69:39:14\",\n \"type\": 0,\n \"rssi\": -66\n },\n {\n \"macAddress\": \"90:63:71\",\n \"type\": 1,\n \"rssi\": -38\n },\n {\n \"macAddress\": \"63:85:37\",\n \"type\": 1,\n \"rssi\": -96\n },\n {\n \"macAddress\": \"15:38:11\",\n \"type\": 1,\n \"rssi\": -87\n },\n {\n \"macAddress\": \"17:77:56\",\n \"type\": 0,\n \"rssi\": -91\n },\n {\n \"macAddress\": \"94:47:44\",\n \"type\": 0,\n \"rssi\": -80\n },\n {\n \"macAddress\": \"38:33:67\",\n \"type\": 1,\n \"rssi\": 8\n },\n {\n \"macAddress\": \"50:4:58\",\n \"type\": 1,\n \"rssi\": -84\n },\n {\n \"macAddress\": \"62:12:66\",\n \"type\": 1,\n \"rssi\": -5\n },\n {\n \"macAddress\": \"89:22:81\",\n \"type\": 1,\n \"rssi\": -41\n },\n {\n \"macAddress\": \"2:26:50\",\n \"type\": 0,\n \"rssi\": -4\n },\n {\n \"macAddress\": \"80:52:33\",\n \"type\": 1,\n \"rssi\": -34\n },\n {\n \"macAddress\": \"51:33:17\",\n \"type\": 1,\n \"rssi\": -14\n },\n {\n \"macAddress\": \"0:69:75\",\n \"type\": 1,\n \"rssi\": -40\n },\n {\n \"macAddress\": \"3:77:87\",\n \"type\": 1,\n \"rssi\": -55\n }\n ]\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://localhost:8081/measurements/add", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "8081", - "path": [ - "measurements", - "add" - ], - "query": [ - { - "key": "roomId", - "value": "1", - "disabled": true - } - ] - } - }, - "response": [] } ] } \ No newline at end of file From 7487ad6ce366f336ae73aae633a87e035f0a4e88 Mon Sep 17 00:00:00 2001 From: Casper-NS <37834568+Casper-NS@users.noreply.github.com> Date: Tue, 19 Dec 2023 20:56:39 +0100 Subject: [PATCH 19/19] =?UTF-8?q?Casper=20Nyvang=20S=C3=B8rensen=20updated?= =?UTF-8?q?=20SW7-API-Tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Postman Collections/SW7-API-Tests.json | 132 ++++++++++++++++++++++++- 1 file changed, 129 insertions(+), 3 deletions(-) diff --git a/Postman Collections/SW7-API-Tests.json b/Postman Collections/SW7-API-Tests.json index 1d1f27c..c198fef 100644 --- a/Postman Collections/SW7-API-Tests.json +++ b/Postman Collections/SW7-API-Tests.json @@ -1,7 +1,7 @@ { "info": { "_postman_id": "ebe740bc-2741-48ef-bdb6-e9ad85e8d39a", - "name": "SW7-API-Tests", + "name": "Test Setup", "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json" }, "item": [ @@ -15,10 +15,26 @@ "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than 1 s\", () => {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", "});" ], "type": "text/javascript" } + }, + { + "listen": "prerequest", + "script": { + "id": "c4edb5a8-8719-49f6-bcd9-87a73f956cee", + "exec": [ + "let roomid = pm.environment.get(\"RoomId\")", + "roomid ++", + "pm.environment.set(\"RoomId\", roomid)" + ], + "type": "text/javascript" + } } ], "id": "c2e1a61f-d755-43cc-8201-7fb289ef1c48", @@ -30,14 +46,124 @@ "header": [], "body": { "mode": "raw", - "raw": "{\n \"RoomId\": -1,\n \"Name\": \"Test room\",\n \"Description\": \"Postman Test Room\"\n}", + "raw": "{\n \"RoomId\": -1,\n \"Name\": \"Test room {{RoomId}}\",\n \"Description\": \"Postman Test Room\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": "http://127.0.0.1:8081/room/add" + }, + "response": [] + }, + { + "name": "Unregistered Trackers", + "event": [ + { + "listen": "prerequest", + "script": { + "id": "c1a422b3-cf2c-4c46-b21b-4faa7c4f7867", + "exec": [ + "let bluetoothMac = pm.environment.get(\"TrackerBluetoothMac\")", + "let wifiMac = pm.environment.get(\"TrackerWifiMac\")", + "", + "bluetoothMac ++", + "wifiMac ++", + "", + "pm.environment.set(\"TrackerBluetoothMac\", bluetoothMac)", + "pm.environment.set(\"TrackerWifiMac\", wifiMac)", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "id": "975300aa-dc06-4068-8d6b-6b388fe0ff09", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than 1 s\", () => {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});" + ], + "type": "text/javascript" + } + } + ], + "id": "299f1464-fc5c-43ab-9e1e-1f0775ddf58e", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"unregisteredTrackers\": [\n {\n \"wifiMacAddress\": \"{{TrackerWifiMac}}\",\n \"bluetoothMacAddress\": \"{{TrackerBluetoothMac}}\"\n }\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": "http://127.0.0.1:8081/tracker/registration/unregistered" + }, + "response": [] + }, + { + "name": "Register Tracker", + "event": [ + { + "listen": "prerequest", + "script": { + "id": "17bcfeed-8473-43f7-8c52-d7209d650a54", + "exec": [ + "let trackerid = pm.environment.get(\"TrackerId\")", + "trackerid ++", + "pm.environment.set(\"TrackerId\", trackerid)" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "id": "30090c71-011c-4387-a08b-9ae5d5727388", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Response time is less than 1 s\", () => {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});" + ], + "type": "text/javascript" + } + } + ], + "id": "ac735894-40df-41ca-8109-0feeb5dd0156", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"roomId\": {{TrackerId}},\n \"name\": \"Tracker {{TrackerId}}\",\n \"description\": \"string\",\n \"wifiMacAddress\": \"{{TrackerBluetoothMac}}\",\n \"bluetoothMacAddress\": \"{{TrackerWifiMac}}\"\n}", "options": { "raw": { "language": "json" } } }, - "url": "http://localhost:8081/room/add" + "url": "http://127.0.0.1:8081/tracker/add" }, "response": [] }