Commit 85bb9146 authored by Dipika Khera's avatar Dipika Khera
Browse files

Partition Service: Updated health check URL & related test cases

parent bc875a2b
Pipeline #57152 failed with stages
in 1 minute and 41 seconds
{
"info": {
"_postman_id": "f77da190-eea0-47bb-b4ab-d790f4dd5b4b",
"_postman_id": "80a922ec-cae8-429e-a47d-0ef221063226",
"name": "Partition API CI/CD v1.0",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
......@@ -2089,10 +2089,7 @@
"name": "Health Check",
"item": [
{
"name": "Liveness Check",
"item": [
{
"name": "28 Partition - get liveness check success scenario",
"name": "28 Partition - get health check success scenario",
"event": [
{
"listen": "prerequest",
......@@ -2112,150 +2109,21 @@
"});",
"pm.test(\"Status description - OK\", function () {",
" pm.response.to.have.status(\"OK\");",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disableBodyPruning": true,
"disabledSystemHeaders": {}
},
"request": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"type": "text",
"value": "application/json"
},
{
"key": "",
"type": "text",
"value": "",
"disabled": true
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "https://{{PARTITION_HOST}}/_ah/liveness_check",
"protocol": "https",
"host": [
"{{PARTITION_HOST}}"
],
"path": [
"_ah",
"liveness_check"
]
}
},
"response": []
},
{
"name": "29 Partition - get liveness check without auth token",
"event": [
{
"listen": "prerequest",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
},
{
"listen": "test",
"script": {
"exec": [
"// Validate the status code and description - 200 also included since some CSP's not validated token for health check",
"pm.test(\"Status code to be 401 or 403 or 200\", function () {",
" pm.expect(pm.response.code).to.be.oneOf([401,403,200]);",
"});",
"try {",
" let resBody = pm.response.json();",
" if (resBody != null) {",
" pm.test(\"Response has not authorized string\", function () {",
" pm.expect(pm.response.text()).to.include(\"not authorized\");",
" pm.test(\"Response contains - Services status\", function () {",
" pm.expect(resBody.status)==\"UP\";",
" });",
" }",
"}",
"catch (e) {",
" console.log(e.message);",
"}"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disableBodyPruning": true,
"disabledSystemHeaders": {}
},
"request": {
"auth": {
"type": "noauth"
},
"method": "GET",
"header": [
{
"key": "Content-Type",
"type": "text",
"value": "application/json"
},
{
"key": "data-partition-id",
"type": "text",
"value": "{{data-partition-id}}",
"disabled": true
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "https://{{PARTITION_HOST}}/_ah/liveness_check",
"protocol": "https",
"host": [
"{{PARTITION_HOST}}"
],
"path": [
"_ah",
"liveness_check"
]
}
},
"response": []
},
{
"name": "30 Partition - get liveness check with invalid auth token",
"event": [
{
"listen": "prerequest",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
},
{
"listen": "test",
"script": {
"exec": [
"// Validate the status code and description - 200 also included since some CSP's not validated token for health check",
"pm.test(\"Status code to be 401 or 403 or 200\", function () {",
" pm.expect(pm.response.code).to.be.oneOf([401,403,200]);",
"});",
"try {",
" let resBody = pm.response.json();",
" if (resBody != null) {",
" pm.test(\"Response has not authorized string\", function () {",
" pm.expect(pm.response.text()).to.include(\"not authorized\");",
" pm.test(\"Response contains -Groups length\", function () {",
" pm.expect(resBody.groups).length==2;",
" });",
" pm.test(\"Response contains - Livenes check\", function () {",
" pm.expect(resBody.groups).contains(\"liveness\");",
" });",
" pm.test(\"Response contains - Readiness check\", function () {",
" pm.expect(resBody.groups).contains(\"readiness\");",
" });",
" }",
"}",
......@@ -2272,16 +2140,6 @@
"disabledSystemHeaders": {}
},
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{access_token}}_invalid",
"type": "string"
}
]
},
"method": "GET",
"header": [
{
......@@ -2290,9 +2148,9 @@
"value": "application/json"
},
{
"key": "data-partition-id",
"key": "",
"type": "text",
"value": "{{data-partition-id}}",
"value": "",
"disabled": true
}
],
......@@ -2301,21 +2159,21 @@
"raw": ""
},
"url": {
"raw": "https://{{PARTITION_HOST}}/_ah/liveness_check",
"raw": "https://{{PARTITION_HOST}}/actuator/health",
"protocol": "https",
"host": [
"{{PARTITION_HOST}}"
],
"path": [
"_ah",
"liveness_check"
"actuator",
"health"
]
}
},
"response": []
},
{
"name": "31 Partition - get liveness check with expired auth token",
"name": "29 Partition - get health check without auth token",
"event": [
{
"listen": "prerequest",
......@@ -2354,150 +2212,6 @@
"disableBodyPruning": true,
"disabledSystemHeaders": {}
},
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{expiredToken}}",
"type": "string"
}
]
},
"method": "GET",
"header": [
{
"key": "Content-Type",
"type": "text",
"value": "application/json"
},
{
"key": "data-partition-id",
"type": "text",
"value": "{{data-partition-id}}",
"disabled": true
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "https://{{PARTITION_HOST}}/_ah/liveness_check",
"protocol": "https",
"host": [
"{{PARTITION_HOST}}"
],
"path": [
"_ah",
"liveness_check"
]
}
},
"response": []
}
]
},
{
"name": "Readiness Check",
"item": [
{
"name": "32 Partition - get readiness check success scenario",
"event": [
{
"listen": "prerequest",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
},
{
"listen": "test",
"script": {
"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\");",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disableBodyPruning": true,
"disabledSystemHeaders": {}
},
"request": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"type": "text",
"value": "application/json"
},
{
"key": "",
"type": "text",
"value": "",
"disabled": true
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "https://{{PARTITION_HOST}}/_ah/readiness_check",
"protocol": "https",
"host": [
"{{PARTITION_HOST}}"
],
"path": [
"_ah",
"readiness_check"
]
}
},
"response": []
},
{
"name": "33 Partition - get readiness check without auth token",
"event": [
{
"listen": "prerequest",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
},
{
"listen": "test",
"script": {
"exec": [
"// Validate the status code and description - token not required for this request",
"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\");",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disableBodyPruning": true,
"disabledSystemHeaders": {}
},
"request": {
"auth": {
"type": "noauth"
......@@ -2521,21 +2235,21 @@
"raw": ""
},
"url": {
"raw": "https://{{PARTITION_HOST}}/_ah/readiness_check",
"raw": "https://{{PARTITION_HOST}}/actuator/health",
"protocol": "https",
"host": [
"{{PARTITION_HOST}}"
],
"path": [
"_ah",
"readiness_check"
"actuator",
"health"
]
}
},
"response": []
},
{
"name": "34 Partition - get readiness check with invalid auth token",
"name": "30 Partition - get health check with invalid auth token",
"event": [
{
"listen": "prerequest",
......@@ -2604,21 +2318,21 @@
"raw": ""
},
"url": {
"raw": "https://{{PARTITION_HOST}}/_ah/readiness_check",
"raw": "https://{{PARTITION_HOST}}/actuator/health",
"protocol": "https",
"host": [
"{{PARTITION_HOST}}"
],
"path": [
"_ah",
"readiness_check"
"actuator",
"health"
]
}
},
"response": []
},
{
"name": "35 Partition - get readiness check with expired auth token",
"name": "31 Partition - get health check with expired auth token",
"event": [
{
"listen": "prerequest",
......@@ -2687,14 +2401,14 @@
"raw": ""
},
"url": {
"raw": "https://{{PARTITION_HOST}}/_ah/readiness_check",
"raw": "https://{{PARTITION_HOST}}/actuator/health",
"protocol": "https",
"host": [
"{{PARTITION_HOST}}"
],
"path": [
"_ah",
"readiness_check"
"actuator",
"health"
]
}
},
......@@ -2704,8 +2418,6 @@
}
]
}
]
}
],
"auth": {
"type": "bearer",
......
Markdown is supported
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