From 35d869944a507b9ee07ea39b6d7207342e5f9790 Mon Sep 17 00:00:00 2001 From: jdotcms Date: Wed, 30 Oct 2024 11:28:32 -0600 Subject: [PATCH] #30472 adding postman to check shortyId --- .../ContentResourceV1.postman_collection.json | 29 +++++++++++++++++-- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/dotcms-postman/src/main/resources/postman/ContentResourceV1.postman_collection.json b/dotcms-postman/src/main/resources/postman/ContentResourceV1.postman_collection.json index 9737cf41313f..bb85b4ab07f3 100644 --- a/dotcms-postman/src/main/resources/postman/ContentResourceV1.postman_collection.json +++ b/dotcms-postman/src/main/resources/postman/ContentResourceV1.postman_collection.json @@ -1,6 +1,6 @@ { "info": { - "_postman_id": "05e460a0-406c-42b4-a8e7-0d61a8c6f794", + "_postman_id": "015f66fd-6d09-4641-873d-03e8b08011f4", "name": "ContentResourceV1", "description": "This folder contains a comprehensive set of API requests related to the `ContentResourceV1` API endpoints. These requests cover various operations such as creating, retrieving and updating content. The folder is organized to help developers and testers efficiently validate and interact with the content resource endpoints in the system.\n\n#### Objectives:\n\n1. **Create Content**:\n \n - Test the creation of new content items with valid and invalid data.\n \n - Ensure that the response includes all necessary details for the created content.\n \n2. **Retrieve Content**:\n \n - Validate the retrieval of content items by ID.\n \n - Ensure the response contains accurate and complete content details.\n \n3. **Update Content**:\n \n - Test updating existing content items with valid and invalid data.\n \n - Verify that the response reflects the updated content accurately.\n \n - Ensure that only authorized users can update content.\n \n4. **Error Handling**:\n \n - Verify that the API returns appropriate error messages for invalid requests.\n \n - Ensure the correct HTTP status codes are used for different error scenarios.\n \n5. **Security**:\n \n - Validate that only authorized users can perform operations on the content.\n \n - Ensure that all security protocols are enforced during API interactions.", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", @@ -474,11 +474,16 @@ "listen": "test", "script": { "exec": [ + "var jsonData = pm.response.json();", + "", "pm.test(\"Valid response\", function () {", " pm.expect(pm.response.text()).to.include(\"SucessRequest\");", + "", + " pm.expect(jsonData.entity).to.have.property('shortyId');", + " pm.expect(jsonData.entity).to.have.property('identifier');", "});", "", - "var jsonData = pm.response.json();", + "", "pm.collectionVariables.set(\"contentletIdentifier\", jsonData.entity.identifier);", "pm.collectionVariables.set(\"contentletInode\", jsonData.entity.inode);", "", @@ -490,6 +495,16 @@ } ], "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{jwt}}", + "type": "string" + } + ] + }, "method": "PUT", "header": [ { @@ -499,7 +514,7 @@ ], "body": { "mode": "raw", - "raw": "{ \"contentlet\" : {\n \"stInode\" : \"f4d7c1b8-2c88-4071-abf1-a5328977b07d\",\n \"languageId\" : 1,\n \"key\": \"SucessRequest{{$timestamp}}\",\n \"value\": \"SucessRequest{{$timestamp}}\"\n}\n}" + "raw": "{\n \"contentlet\": {\n \"stInode\": \"f4d7c1b8-2c88-4071-abf1-a5328977b07d\",\n \"languageId\": 1,\n \"key\": \"SucessRequest{{$timestamp}}\",\n \"value\": \"SucessRequest{{$timestamp}}\"\n }\n}" }, "url": { "raw": "{{serverURL}}/api/v1/workflow/actions/default/fire/PUBLISH", @@ -2871,6 +2886,14 @@ { "key": "contentIdentifier", "value": "" + }, + { + "key": "contentletIdentifier", + "value": "" + }, + { + "key": "contentletInode", + "value": "" } ] } \ No newline at end of file