From 2ce0c117629944380f359eb55614449a4fae807b Mon Sep 17 00:00:00 2001 From: edunn Date: Tue, 23 Jul 2024 15:59:46 -0700 Subject: [PATCH] implement tests for 484, 485, 486, 487 --- docker/postman/postman_collection.json | 146 ++++++++++++++++++++++++- 1 file changed, 144 insertions(+), 2 deletions(-) diff --git a/docker/postman/postman_collection.json b/docker/postman/postman_collection.json index 84bccb0..a88e8ed 100644 --- a/docker/postman/postman_collection.json +++ b/docker/postman/postman_collection.json @@ -1848,6 +1848,41 @@ }, "response": [] }, + { + "name": "NASA-PDS/registry-api#484 products/{id}/members default to latest-only", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"C4438479 Status code is 200\", () => {pm.response.to.have.status(200)});", + "const content = pm.response.json();", + "const relevantHits = content.data.filter(hit => hit.properties.lid[0] === \"urn:nasa:pds:mars2020.spice:spice_kernels\")", + "pm.test(\"C4438479 Correct hits returned\", () => { pm.expect(relevantHits.length).to.eql(1) });", + "pm.test(\"C4438479 Correct data returned\", () => {pm.expect(relevantHits[0].id).to.eql(\"urn:nasa:pds:mars2020.spice:spice_kernels::3.0\")});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/products/urn:nasa:pds:mars2020.spice/members", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + "urn:nasa:pds:mars2020.spice", + "members" + ] + } + }, + "response": [] + }, { "name": "NASA-PDS/registry-api#453 products/{id}/members/members", "event": [ @@ -1882,6 +1917,43 @@ }, "response": [] }, + { + "name": "NASA-PDS/registry-api#485 products/{id}/members/members default to latest-only", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"C4438481 Status code is 200\", () => { pm.response.to.have.status(200) });", + "const content = pm.response.json();", + "const relevantHits = content.data.filter(hit => hit.properties.lid[0] === \"urn:nasa:pds:mars2020.spice:spice_kernels:mk_m2020\")", + "pm.test(\"C4438481 Correct hits returned\", () => { pm.expect(relevantHits.length).to.eql(1) });", + "pm.test(\"C4438481 Correct data returned\", () => {pm.expect(relevantHits[0].id).to.eql(\"urn:nasa:pds:mars2020.spice:spice_kernels:mk_m2020::3.0\")});", + "" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/products/urn:nasa:pds:mars2020.spice/members/members", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + "urn:nasa:pds:mars2020.spice", + "members", + "members" + ] + } + }, + "response": [] + }, { "name": "NASA-PDS/registry-api#451/452 products/{id}/member-of", "event": [ @@ -1903,13 +1975,48 @@ "method": "GET", "header": [], "url": { - "raw": "{{baseUrl}}/products/urn:nasa:pds:mars2020.spice:spice_kernels:sclk_m2020_168_sclkscet_refit_v01.tsc::1.0/member-of", + "raw": "{{baseUrl}}/products/urn:nasa:pds:mars2020.spice:spice_kernels:mk_m2020/member-of", "host": [ "{{baseUrl}}" ], "path": [ "products", - "urn:nasa:pds:mars2020.spice:spice_kernels:sclk_m2020_168_sclkscet_refit_v01.tsc::1.0", + "urn:nasa:pds:mars2020.spice:spice_kernels:mk_m2020", + "member-of" + ] + } + }, + "response": [] + }, + { + "name": "NASA-PDS/registry-api#451/486 products/{id}/member-of default to latest-only", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"C4438482 Status code is 200\", () => {pm.response.to.have.status(200)});", + "const content = pm.response.json();", + "const relevantHits = content.data.filter(hit => hit.properties.lid[0] === \"urn:nasa:pds:mars2020.spice:spice_kernels\")", + "pm.test(\"C4438482 Correct hits returned\", () => { pm.expect(relevantHits.length).to.eql(1) });", + "pm.test(\"C4438482 Correct data returned\", () => {pm.expect(relevantHits[0].id).to.eql(\"urn:nasa:pds:mars2020.spice:spice_kernels::3.0\")});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/products/urn:nasa:pds:mars2020.spice:spice_kernels:mk_m2020/member-of", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + "urn:nasa:pds:mars2020.spice:spice_kernels:mk_m2020", "member-of" ] } @@ -1949,6 +2056,41 @@ } }, "response": [] + }, + { + "name": "NASA-PDS/registry-api#487 products/{id}/member-of/member-of default to latest-only", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"C4438483 Status code is 200\", () => {pm.response.to.have.status(200)});", + "const content = pm.response.json();", + "const relevantHits = content.data.filter(hit => hit.properties.lid[0] === \"urn:nasa:pds:mars2020.spice:spice_kernels\")", + "pm.test(\"C4438483 Correct hits returned\", () => { pm.expect(relevantHits.length).to.eql(1) });", + "pm.test(\"C4438483 Correct data returned\", () => {pm.expect(relevantHits[0].id).to.eql(\"urn:nasa:pds:mars2020.spice:spice_kernels::3.0\")});" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/products/urn:nasa:pds:mars2020.spice:spice_kernels:mk_m2020/member-of", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + "urn:nasa:pds:mars2020.spice:spice_kernels:mk_m2020", + "member-of" + ] + } + }, + "response": [] } ] },