Skip to content

Commit

Permalink
implement tests for registry-api #494
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdunnjpl committed Aug 7, 2024
1 parent 1d9802a commit 5ee8bbc
Showing 1 changed file with 324 additions and 0 deletions.
324 changes: 324 additions & 0 deletions docker/postman/postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,330 @@
{
"name": "requirements",
"item": [
{
"name": "NASA-PDS/registry-api#494 querystring supports EQ",
"event": [
{
"listen": "test",
"script": {
"exec": [
"const testrailId = \"C4440539\";",
"const minimumExpectedHits = 2; // actual count may increase as data is added to test corpus",
"function testHitConstraints(hit) {",
" pm.expect(hit.properties.product_class[0]).to.eq(\"Product_Bundle\")",
"};",
"",
"pm.test(`${testrailId} Status code is 200`, () => {",
" pm.response.to.have.status(200);",
"});",
"",
"var data = pm.response.json().data;",
"",
"pm.test(`${testrailId} Number of results is at least ${minimumExpectedHits}`, () => {",
" pm.expect(data.length).gte(minimumExpectedHits); ",
"});",
"",
"pm.test(`${testrailId} Returned hits satisfy constraints`, () => {",
" data.forEach(testHitConstraints) ",
"});",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{baseUrl}}/products?q=(product_class EQ \"Product_Bundle\")",
"host": [
"{{baseUrl}}"
],
"path": [
"products"
],
"query": [
{
"key": "q",
"value": "(product_class EQ \"Product_Bundle\")"
}
]
}
},
"response": []
},
{
"name": "NASA-PDS/registry-api#494 querystring supports NE",
"event": [
{
"listen": "test",
"script": {
"exec": [
"const testrailId = \"C4440540\";",
"const minimumExpectedHits = 36; // actual count may increase as data is added to test corpus",
"function testHitConstraints(hit) {",
" pm.expect(hit.properties.product_class[0]).to.not.eq(\"Product_Bundle\")",
"};",
"",
"pm.test(`${testrailId} Status code is 200`, () => {",
" pm.response.to.have.status(200);",
"});",
"",
"var data = pm.response.json().data;",
"",
"pm.test(`${testrailId} Number of results is at least ${minimumExpectedHits}`, () => {",
" pm.expect(data.length).gte(minimumExpectedHits); ",
"});",
"",
"pm.test(`${testrailId} Returned hits satisfy constraints`, () => {",
" data.forEach(testHitConstraints) ",
"});",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{baseUrl}}/products?q=(product_class NE \"Product_Bundle\")",
"host": [
"{{baseUrl}}"
],
"path": [
"products"
],
"query": [
{
"key": "q",
"value": "(product_class NE \"Product_Bundle\")"
}
]
}
},
"response": []
},
{
"name": "NASA-PDS/registry-api#494 querystring supports GT",
"event": [
{
"listen": "test",
"script": {
"exec": [
"const testrailId = \"C4440541\";",
"const minimumExpectedHits = 6; // actual count may increase as data is added to test corpus",
"function testHitConstraints(hit) {",
" pm.expect(Date.parse(hit.properties[\"pds:Time_Coordinates.pds:start_date_time\"][0])).gt(Date.parse(\"2020-07-30T12:51:34Z\"))",
"};",
"",
"pm.test(`${testrailId} Status code is 200`, () => {",
" pm.response.to.have.status(200);",
"});",
"",
"var data = pm.response.json().data;",
"",
"pm.test(`${testrailId} Number of results is at least ${minimumExpectedHits}`, () => {",
" pm.expect(data.length).gte(minimumExpectedHits); ",
"});",
"",
"pm.test(`${testrailId} Returned hits satisfy constraints`, () => {",
" data.forEach(testHitConstraints) ",
"});",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{baseUrl}}/products?q=(pds:Time_Coordinates.pds:start_date_time GT \"2020-07-30T12:51:34Z\")",
"host": [
"{{baseUrl}}"
],
"path": [
"products"
],
"query": [
{
"key": "q",
"value": "(pds:Time_Coordinates.pds:start_date_time GT \"2020-07-30T12:51:34Z\")"
}
]
}
},
"response": []
},
{
"name": "NASA-PDS/registry-api#494 querystring supports LT",
"event": [
{
"listen": "test",
"script": {
"exec": [
"const testrailId = \"C4440542\";",
"const minimumExpectedHits = 25; // actual count may increase as data is added to test corpus",
"function testHitConstraints(hit) {",
" pm.expect(Date.parse(hit.properties[\"pds:Time_Coordinates.pds:start_date_time\"][0])).lt(Date.parse(\"2020-07-30T12:51:34Z\"))",
"};",
"",
"pm.test(`${testrailId} Status code is 200`, () => {",
" pm.response.to.have.status(200);",
"});",
"",
"var data = pm.response.json().data;",
"",
"pm.test(`${testrailId} Number of results is at least ${minimumExpectedHits}`, () => {",
" pm.expect(data.length).gte(minimumExpectedHits); ",
"});",
"",
"pm.test(`${testrailId} Returned hits satisfy constraints`, () => {",
" data.forEach(testHitConstraints) ",
"});",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{baseUrl}}/products?q=(pds:Time_Coordinates.pds:start_date_time LT \"2020-07-30T12:51:34Z\")",
"host": [
"{{baseUrl}}"
],
"path": [
"products"
],
"query": [
{
"key": "q",
"value": "(pds:Time_Coordinates.pds:start_date_time LT \"2020-07-30T12:51:34Z\")"
}
]
}
},
"response": []
},
{
"name": "NASA-PDS/registry-api#494 querystring supports GE",
"event": [
{
"listen": "test",
"script": {
"exec": [
"const testrailId = \"C4440543\";",
"const minimumExpectedHits = 13; // actual count may increase as data is added to test corpus",
"function testHitConstraints(hit) {",
" pm.expect(Date.parse(hit.properties[\"pds:Time_Coordinates.pds:start_date_time\"][0])).gte(Date.parse(\"2020-07-30T12:51:34Z\"))",
"};",
"",
"pm.test(`${testrailId} Status code is 200`, () => {",
" pm.response.to.have.status(200);",
"});",
"",
"var data = pm.response.json().data;",
"",
"pm.test(`${testrailId} Number of results is at least ${minimumExpectedHits}`, () => {",
" pm.expect(data.length).gte(minimumExpectedHits); ",
"});",
"",
"pm.test(`${testrailId} Returned hits satisfy constraints`, () => {",
" data.forEach(testHitConstraints) ",
"});",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{baseUrl}}/products?q=(pds:Time_Coordinates.pds:start_date_time GE \"2020-07-30T12:51:34Z\")",
"host": [
"{{baseUrl}}"
],
"path": [
"products"
],
"query": [
{
"key": "q",
"value": "(pds:Time_Coordinates.pds:start_date_time GE \"2020-07-30T12:51:34Z\")"
}
]
}
},
"response": []
},
{
"name": "NASA-PDS/registry-api#494 querystring supports LE",
"event": [
{
"listen": "test",
"script": {
"exec": [
"const testrailId = \"C4440544\";",
"const minimumExpectedHits = 32; // actual count may increase as data is added to test corpus",
"function testHitConstraints(hit) {",
" pm.expect(Date.parse(hit.properties[\"pds:Time_Coordinates.pds:start_date_time\"][0])).lte(Date.parse(\"2020-07-30T12:51:34Z\"))",
"};",
"",
"pm.test(`${testrailId} Status code is 200`, () => {",
" pm.response.to.have.status(200);",
"});",
"",
"var data = pm.response.json().data;",
"",
"pm.test(`${testrailId} Number of results is at least ${minimumExpectedHits}`, () => {",
" pm.expect(data.length).gte(minimumExpectedHits); ",
"});",
"",
"pm.test(`${testrailId} Returned hits satisfy constraints`, () => {",
" data.forEach(testHitConstraints) ",
"});",
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{baseUrl}}/products?q=(pds:Time_Coordinates.pds:start_date_time LE \"2020-07-30T12:51:34Z\")",
"host": [
"{{baseUrl}}"
],
"path": [
"products"
],
"query": [
{
"key": "q",
"value": "(pds:Time_Coordinates.pds:start_date_time LE \"2020-07-30T12:51:34Z\")"
}
]
}
},
"response": []
},
{
"name": "NASA-PDS/registry-api#495 querystring supports AND",
"event": [
Expand Down

0 comments on commit 5ee8bbc

Please sign in to comment.