From 149c7e35f170fbfa0354fff16cc66e945e99fec6 Mon Sep 17 00:00:00 2001 From: Alex Dunn Date: Wed, 24 Jul 2024 14:30:43 -0700 Subject: [PATCH] 484 485 486 487 Membership latest tests (#299) * move tests for registry-api requirements 223, 451, 452, 453, 454 to correct section * implement tests for 484, 485, 486, 487 * add default credentials for docker registry * update membership tests for consistency * apply tloubrieu's fixes from #300 --- docker/postman/postman_collection.json | 434 +++++++++++++++++-------- 1 file changed, 296 insertions(+), 138 deletions(-) diff --git a/docker/postman/postman_collection.json b/docker/postman/postman_collection.json index 5e3710c..936ebec 100644 --- a/docker/postman/postman_collection.json +++ b/docker/postman/postman_collection.json @@ -1813,6 +1813,285 @@ } }, "response": [] + }, + { + "name": "NASA-PDS/registry-api#223 products/{id}/members", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"C4438463 Status code is 200\", () => {pm.response.to.have.status(200)});", + "const content = pm.response.json();", + "pm.test(\"C4438463 Correct hits returned\", () => {pm.expect(content.summary.hits).to.eql(1)});", + "pm.test(\"C4438463 Correct data returned\", () => {pm.expect(content.data[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#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": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"C4438464 Status code is 200\", () => {pm.response.to.have.status(200)});", + "const content = pm.response.json();", + "pm.test(\"C4438464 Correct hits returned\", () => {pm.expect(content.summary.hits).to.eql(11)});" + ], + "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#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": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"C4438465 Status code is 200\", () => {pm.response.to.have.status(200)});", + "const content = pm.response.json();", + "pm.test(\"C4438465 Correct hits returned\", () => {pm.expect(content.summary.hits).to.eql(1)});", + "pm.test(\"C4438465 Correct data returned\", () => {pm.expect(content.data[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": [] + }, + { + "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" + ] + } + }, + "response": [] + }, + { + "name": "NASA-PDS/registry-api#454 products/{id}/member-of/member-of", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"C4438466 Status code is 200\", () => {pm.response.to.have.status(200)});", + "const content = pm.response.json();", + "pm.test(\"C4438466 Correct hits returned\", () => {pm.expect(content.summary.hits).to.eql(1)});", + "pm.test(\"C4438466 Correct data returned\", () => {pm.expect(content.data[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": [] + }, + { + "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\")", + "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::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/member-of", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + "urn:nasa:pds:mars2020.spice:spice_kernels:mk_m2020", + "member-of", + "member-of" + ] + } + }, + "response": [] } ] }, @@ -2207,142 +2486,6 @@ } }, "response": [] - }, - { - "name": "NASA-PDS/registry-api#223 products/{id}/members", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"C4438463 Status code is 200\", () => {pm.response.to.have.status(200)});", - "const content = pm.response.json();", - "pm.test(\"C4438463 Correct hits returned\", () => {pm.expect(content.summary.hits).to.eql(1)});", - "pm.test(\"C4438463 Correct data returned\", () => {pm.expect(content.data[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": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"C4438464 Status code is 200\", () => {pm.response.to.have.status(200)});", - "const content = pm.response.json();", - "pm.test(\"C4438464 Correct hits returned\", () => {pm.expect(content.summary.hits).to.eql(11)});" - ], - "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": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"C4438465 Status code is 200\", () => {pm.response.to.have.status(200)});", - "const content = pm.response.json();", - "pm.test(\"C4438465 Correct hits returned\", () => {pm.expect(content.summary.hits).to.eql(1)});", - "pm.test(\"C4438465 Correct data returned\", () => {pm.expect(content.data[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:sclk_m2020_168_sclkscet_refit_v01.tsc::1.0/member-of", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "products", - "urn:nasa:pds:mars2020.spice:spice_kernels:sclk_m2020_168_sclkscet_refit_v01.tsc::1.0", - "member-of" - ] - } - }, - "response": [] - }, - { - "name": "NASA-PDS/registry-api#454 products/{id}/member-of/member-of", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"C4438466 Status code is 200\", () => {pm.response.to.have.status(200)});", - "const content = pm.response.json();", - "pm.test(\"C4438466 Correct hits returned\", () => {pm.expect(content.summary.hits).to.eql(1)});", - "pm.test(\"C4438466 Correct data returned\", () => {pm.expect(content.data[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:sclk_m2020_168_sclkscet_refit_v01.tsc::1.0/member-of", - "host": [ - "{{baseUrl}}" - ], - "path": [ - "products", - "urn:nasa:pds:mars2020.spice:spice_kernels:sclk_m2020_168_sclkscet_refit_v01.tsc::1.0", - "member-of" - ] - } - }, - "response": [] } ] }, @@ -2594,6 +2737,21 @@ ] } ], + "auth": { + "type": "basic", + "basic": [ + { + "key": "password", + "value": "admin", + "type": "string" + }, + { + "key": "username", + "value": "admin", + "type": "string" + } + ] + }, "event": [ { "listen": "prerequest", @@ -2619,7 +2777,7 @@ "variable": [ { "key": "baseUrl", - "value": "http://registry-api:8080" + "value": "http://localhost:8081" }, { "key": "opensearchUrl", @@ -2627,4 +2785,4 @@ "type": "string" } ] -} \ No newline at end of file +}