Skip to content

Commit

Permalink
Add postman
Browse files Browse the repository at this point in the history
  • Loading branch information
TayGov committed Oct 21, 2024
1 parent 9fb3db5 commit 90f4a6f
Show file tree
Hide file tree
Showing 2 changed files with 155 additions and 0 deletions.
33 changes: 33 additions & 0 deletions testing/jag-document-utils-env.postman_environment.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"id": "e03086d2-2a9a-405a-a561-9e92d2b8cdc0",
"name": "jag-document-utils-env",
"values": [
{
"key": "keycloakUrl",
"value": "http://localhost:8081/realms/jag",
"type": "default",
"enabled": true
},
{
"key": "baseApiUrl",
"value": "http://localhost:5656",
"type": "default",
"enabled": true
},
{
"key": "keycloakCredentail",
"value": "",
"type": "secret",
"enabled": true
},
{
"key": "jwt",
"value": "",
"type": "default",
"enabled": true
}
],
"_postman_variable_scope": "environment",
"_postman_exported_at": "2024-10-21T17:23:33.068Z",
"_postman_exported_using": "Postman/11.13.1"
}
122 changes: 122 additions & 0 deletions testing/jag-document-utils.postman_collection.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
{
"info": {
"_postman_id": "9c6e2805-f935-4237-afed-77f442808f56",
"name": "jag-document-utils",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "7463243"
},
"item": [
{
"name": "auth",
"item": [
{
"name": "token",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Get jwt\", function () {\r",
" var jsonData = pm.response.json();\r",
" pm.environment.set(\"jwt\", jsonData.access_token);\r",
"});"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "grant_type",
"value": "client_credentials",
"type": "default"
},
{
"key": "client_secret",
"value": "{{keycloakCredentail}}",
"type": "default"
},
{
"key": "client_id",
"value": "justin",
"type": "default"
},
{
"key": "scope",
"value": "",
"type": "default",
"disabled": true
}
]
},
"url": {
"raw": "{{keycloakUrl}}",
"host": [
"{{keycloakUrl}}"
]
}
},
"response": []
}
]
},
{
"name": "merge",
"item": [
{
"name": "doc merge",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{jwt}}",
"type": "string"
}
]
},
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "X-Correlation-ID",
"value": "1231231",
"type": "default"
},
{
"key": "X-Client-ID",
"value": "123123",
"type": "default"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"options\":{\n \"forcePDFAOnLoad\": true,\n \"createToC\": false\n },\n \"documents\":[\n {\n \"id\":\"optional\",\n \"docType\":\"pdf\",\n \"order\":1,\n \"data\": {{fileDat}}\n }\n ]\n}"
},
"url": {
"raw": "{{baseApiUrl}}/document/merge",
"host": [
"{{baseApiUrl}}"
],
"path": [
"document",
"merge"
]
}
},
"response": []
}
]
}
]
}

0 comments on commit 90f4a6f

Please sign in to comment.