Commit 32eb957a authored by Darshana Herath's avatar Darshana Herath
Browse files

Adding new test cases for verifying cursor values!

parent 35298355
Pipeline #8989 failed with stages
in 6 seconds
......@@ -158,7 +158,7 @@
}
],
"url": {
"raw": "https://{{STORAGE_HOST}}/query/kinds?Cursor&limit=200",
"raw": "https://{{STORAGE_HOST}}/query/kinds",
"protocol": "https",
"host": [
"{{STORAGE_HOST}}"
......@@ -169,14 +169,16 @@
],
"query": [
{
"key": "Cursor",
"key": "cursor",
"value": null,
"description": "string"
"description": "string",
"disabled": true
},
{
"key": "limit",
"value": "200",
"description": "integer (int32)"
"description": "integer (int32)",
"disabled": true
}
]
},
......@@ -229,7 +231,7 @@
}
],
"url": {
"raw": "https://{{STORAGE_HOST}}/query/kinds?Cursor=&limit=10",
"raw": "https://{{STORAGE_HOST}}/query/kinds?limit=10",
"protocol": "https",
"host": [
"{{STORAGE_HOST}}"
......@@ -240,8 +242,80 @@
],
"query": [
{
"key": "Cursor",
"key": "cursor",
"value": "",
"description": "string",
"disabled": true
},
{
"key": "limit",
"value": "10",
"description": "integer (int32)"
}
]
},
"description": "Get all kinds\nThe API returns a list of all kinds in the specific {Slb-Data-Partition-Id}. Required roles: 'users.datalake.editors' or 'users.datalake.admins'."
},
"response": []
},
{
"name": "02a Storage - Get kinds using cursor with limit of 10 records",
"event": [
{
"listen": "test",
"script": {
"id": "bd96663d-2ac4-4b5b-a370-a282213e742f",
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"pm.test(\"Status description - OK\", function () {",
" pm.response.to.have.status(\"OK\");",
"});",
"",
"try {",
" var jsonData = JSON.parse(responseBody);",
" var counter = jsonData.results.length;",
" console.log(counter);",
" tests[\"Total number of kinds retrived: \" + counter] = counter == 10;",
"}",
"catch (e) {",
" console.log(e.message);",
"}"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [
{
"description": "This value should be the desired data partition id.",
"key": "data-partition-id",
"type": "text",
"value": "{{data-partition-id}}"
},
{
"key": "Accept",
"type": "text",
"value": "application/json"
}
],
"url": {
"raw": "https://{{STORAGE_HOST}}/query/kinds?cursor={{get_all_kind_cursor}}&limit=10",
"protocol": "https",
"host": [
"{{STORAGE_HOST}}"
],
"path": [
"query",
"kinds"
],
"query": [
{
"key": "cursor",
"value": "{{get_all_kind_cursor}}",
"description": "string"
},
{
......@@ -255,6 +329,75 @@
},
"response": []
},
{
"name": "02b Storage - Get kinds using invalid cursor value",
"event": [
{
"listen": "test",
"script": {
"id": "686f1bd7-6c88-4b87-9ea9-fdfa9dd3ff01",
"exec": [
"pm.test(\"Status code is 400\", function () {",
" pm.response.to.have.status(400);",
"});",
"pm.test(\"Status description - Bad Request\", function () {",
" pm.response.to.have.status(\"Bad Request\");",
"});",
"",
"try {",
" var jsonData = JSON.parse(responseBody);",
" tests[\"Reason: \"+jsonData.reason] = jsonData.reason == \"Cursor invalid\";",
"}",
"catch (e) {",
" console.log(e.message);",
"}"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [
{
"description": "This value should be the desired data partition id.",
"key": "data-partition-id",
"type": "text",
"value": "{{data-partition-id}}"
},
{
"key": "Accept",
"type": "text",
"value": "application/json"
}
],
"url": {
"raw": "https://{{STORAGE_HOST}}/query/kinds?cursor=invalid_cursor&limit=10",
"protocol": "https",
"host": [
"{{STORAGE_HOST}}"
],
"path": [
"query",
"kinds"
],
"query": [
{
"key": "cursor",
"value": "invalid_cursor",
"description": "string"
},
{
"key": "limit",
"value": "10",
"description": "integer (int32)"
}
]
},
"description": "Get all kinds\nThe API returns a list of all kinds in the specific {Slb-Data-Partition-Id}. Required roles: 'users.datalake.editors' or 'users.datalake.admins'."
},
"response": []
},
{
"name": "03 Storage - Get all kinds with invalid value for parameter limit",
"event": [
......@@ -301,8 +444,8 @@
],
"query": [
{
"key": "Cursor",
"value": "aa",
"key": "cursor",
"value": "",
"description": "string",
"disabled": true
},
......@@ -362,7 +505,7 @@
}
],
"url": {
"raw": "https://{{STORAGE_HOST}}/query/kinds?Cursor=&limit=100",
"raw": "https://{{STORAGE_HOST}}/query/kinds?cursor=&limit=100",
"protocol": "https",
"host": [
"{{STORAGE_HOST}}"
......@@ -373,7 +516,7 @@
],
"query": [
{
"key": "Cursor",
"key": "cursor",
"value": "",
"description": "string"
},
......@@ -680,7 +823,7 @@
],
"query": [
{
"key": "Cursor",
"key": "cursor",
"value": "",
"description": "string",
"disabled": true
......@@ -701,6 +844,230 @@
},
"response": []
},
{
"name": "08ai - Storage - Get all records for a kind with limit of 10 records",
"event": [
{
"listen": "test",
"script": {
"id": "d4542071-5048-47e8-b8ba-6f29985ae5dc",
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"pm.test(\"Status description - OK\", function () {",
" pm.response.to.have.status(\"OK\");",
"});",
"",
"try {",
" var jsonData = JSON.parse(responseBody);",
" var counter = jsonData.results.length;",
" console.log(counter);",
" tests[\"Total number of kinds retrived: \" + counter] = counter == 10;",
"}",
"catch (e) {",
" console.log(e.message);",
"}"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [
{
"description": "This value should be the desired data partition id.",
"key": "data-partition-id",
"type": "text",
"value": "{{data-partition-id}}"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"url": {
"raw": "https://{{STORAGE_HOST}}/query/records?limit=10&kind={{data-partition-id}}:osdu:well-master:{{enriched_schema_version}}",
"protocol": "https",
"host": [
"{{STORAGE_HOST}}"
],
"path": [
"query",
"records"
],
"query": [
{
"key": "cursor",
"value": "",
"description": "string",
"disabled": true
},
{
"key": "limit",
"value": "10",
"description": "integer (int32)"
},
{
"key": "kind",
"value": "{{data-partition-id}}:osdu:well-master:{{enriched_schema_version}}"
}
]
},
"description": "Get all kinds\nThe API returns a list of all kinds in the specific {Slb-Data-Partition-Id}. Required roles: 'users.datalake.editors' or 'users.datalake.admins'."
},
"response": []
},
{
"name": "08aii - Storage - Get all records for a kind with cursor limit of 10 records",
"event": [
{
"listen": "test",
"script": {
"id": "6035753a-1b63-47ed-b2ad-e36fcaf4ff6d",
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"pm.test(\"Status description - OK\", function () {",
" pm.response.to.have.status(\"OK\");",
"});",
"",
"try {",
" var jsonData = JSON.parse(responseBody);",
" var counter = jsonData.results.length;",
" console.log(counter);",
" tests[\"Total number of kinds retrived: \" + counter] = counter == 10;",
"}",
"catch (e) {",
" console.log(e.message);",
"}"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [
{
"description": "This value should be the desired data partition id.",
"key": "data-partition-id",
"type": "text",
"value": "{{data-partition-id}}"
},
{
"key": "Accept",
"type": "text",
"value": "application/json"
}
],
"url": {
"raw": "https://{{STORAGE_HOST}}/query/records?cursor={{get_all_records_cursor}}&limit=10&kind={{data-partition-id}}:osdu:well-master:{{enriched_schema_version}}",
"protocol": "https",
"host": [
"{{STORAGE_HOST}}"
],
"path": [
"query",
"records"
],
"query": [
{
"key": "cursor",
"value": "{{get_all_records_cursor}}",
"description": "string"
},
{
"key": "limit",
"value": "10",
"description": "integer (int32)"
},
{
"key": "kind",
"value": "{{data-partition-id}}:osdu:well-master:{{enriched_schema_version}}"
}
]
},
"description": "Get all kinds\nThe API returns a list of all kinds in the specific {Slb-Data-Partition-Id}. Required roles: 'users.datalake.editors' or 'users.datalake.admins'."
},
"response": []
},
{
"name": "08aiii - Storage - Get all records for a kind with invalid cursor",
"event": [
{
"listen": "test",
"script": {
"id": "f8e99ca4-7825-49dc-ae52-16703f82e3d6",
"exec": [
"pm.test(\"Status code is 400\", function () {",
" pm.response.to.have.status(400);",
"});",
"pm.test(\"Status description - Bad Request\", function () {",
" pm.response.to.have.status(\"Bad Request\");",
"});",
"",
"try {",
" var jsonData = JSON.parse(responseBody);",
" tests[\"Reason: \"+jsonData.reason] = jsonData.reason == \"Cursor invalid\";",
"}",
"catch (e) {",
" console.log(e.message);",
"}"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [
{
"description": "This value should be the desired data partition id.",
"key": "data-partition-id",
"type": "text",
"value": "{{data-partition-id}}"
},
{
"key": "Accept",
"type": "text",
"value": "application/json"
}
],
"url": {
"raw": "https://{{STORAGE_HOST}}/query/records?cursor=invalid_cursor&limit=10&kind={{data-partition-id}}:osdu:well-master:{{enriched_schema_version}}",
"protocol": "https",
"host": [
"{{STORAGE_HOST}}"
],
"path": [
"query",
"records"
],
"query": [
{
"key": "cursor",
"value": "invalid_cursor",
"description": "string"
},
{
"key": "limit",
"value": "10",
"description": "integer (int32)"
},
{
"key": "kind",
"value": "{{data-partition-id}}:osdu:well-master:{{enriched_schema_version}}"
}
]
},
"description": "Get all kinds\nThe API returns a list of all kinds in the specific {Slb-Data-Partition-Id}. Required roles: 'users.datalake.editors' or 'users.datalake.admins'."
},
"response": []
},
{
"name": "08b Storage - Fetch records",
"event": [
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment