Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(core): Add more test for #26861 #27346

Merged
merged 3 commits into from
Jan 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
227 changes: 225 additions & 2 deletions dotCMS/src/curl-test/Workflow_Resource_Tests.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"info": {
"_postman_id": "214cded5-3144-4394-b9e4-15431e29b76e",
"_postman_id": "e5a39255-b6a9-4ab9-bde9-9e581b2c9fbc",
"name": "Workflow Resource Tests [/api/v1/workflows]",
"description": "Test the necesary validations to every end point of the worlflow resource ",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "5403727"
"_exporter_id": "781456"
},
"item": [
{
Expand Down Expand Up @@ -16714,6 +16714,219 @@
}
],
"description": "Provides the current status of a given Contentlet within the current Step of the Worklow that it's going through. This is used by the Angular UI to show this data to the logged-in User."
},
{
"name": "issue-26861",
"item": [
{
"name": "CreateItalian",
"event": [
{
"listen": "test",
"script": {
"exec": [
"var jsonData = pm.response.json();",
"",
"pm.collectionVariables.set(\"italianLanguageId\", jsonData.entity.id);",
"pm.test(\"Status code should be ok 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
""
],
"type": "text/javascript"
}
}
],
"request": {
"auth": {
"type": "basic",
"basic": [
{
"key": "password",
"value": "admin",
"type": "string"
},
{
"key": "username",
"value": "admin@dotcms.com",
"type": "string"
}
]
},
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"languageCode\":\"it\",\n \"countryCode\":\"it\",\n \"language\":\"Italian\",\n \"country\":\"Italy\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{serverURL}}/api/v2/languages",
"host": [
"{{serverURL}}"
],
"path": [
"api",
"v2",
"languages"
]
}
},
"response": []
},
{
"name": "CreateEnglish",
"event": [
{
"listen": "test",
"script": {
"exec": [
"var jsonData = pm.response.json();",
"",
"pm.collectionVariables.set(\"englishidentifier\", jsonData.entity.identifier);",
"pm.test(\"Status code should be ok 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"pm.test(\"Check that the Contentlet's english languageId\", function () {",
" pm.expect(jsonData.entity.languageId).to.eql(1);",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"auth": {
"type": "basic",
"basic": [
{
"key": "password",
"value": "admin",
"type": "string"
},
{
"key": "username",
"value": "admin@dotcms.com",
"type": "string"
}
]
},
"method": "PUT",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"contentlet\":{\n \"contentType\":\"webPageContent\",\n \"title\":\"TestEnglishSpanish\",\n \"contentHost\":\"default\",\n \"body\":\"Body Test\",\n \"languageId\":1\n }\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{serverURL}}/api/v1/workflow/actions/default/fire/PUBLISH?indexPolicy=WAIT_FOR ",
"host": [
"{{serverURL}}"
],
"path": [
"api",
"v1",
"workflow",
"actions",
"default",
"fire",
"PUBLISH"
],
"query": [
{
"key": "indexPolicy",
"value": "WAIT_FOR "
}
]
}
},
"response": []
},
{
"name": "CreateItalian",
"event": [
{
"listen": "test",
"script": {
"exec": [
"var jsonData = pm.response.json();",
"",
"pm.test(\"Status code should be ok 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"var italianLanguageId = pm.collectionVariables.get(\"italianLanguageId\");",
"",
"pm.test(\"Check that the Contentlet's english languageId\", function () {",
" pm.expect(jsonData.entity.languageId).to.eql(italianLanguageId);",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"auth": {
"type": "basic",
"basic": [
{
"key": "password",
"value": "admin",
"type": "string"
},
{
"key": "username",
"value": "admin@dotcms.com",
"type": "string"
}
]
},
"method": "PUT",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"contentlet\":{\n \"identifier\":\"{{englishidentifier}}\",\n \"languageId\":{{italianLanguageId}},\n \"contentType\":\"webPageContent\",\n \"title\":\"TestEnglishSpanish\",\n \"contentHost\":\"default\",\n \"body\":\"Corpo di prova\"\n }\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{serverURL}}/api/v1/workflow/actions/default/fire/PUBLISH?indexPolicy=WAIT_FOR ",
"host": [
"{{serverURL}}"
],
"path": [
"api",
"v1",
"workflow",
"actions",
"default",
"fire",
"PUBLISH"
],
"query": [
{
"key": "indexPolicy",
"value": "WAIT_FOR "
}
]
}
},
"response": []
}
]
}
],
"event": [
Expand All @@ -16735,5 +16948,15 @@
]
}
}
],
"variable": [
{
"key": "italianLanguageId",
"value": ""
},
{
"key": "englishidentifier",
"value": ""
}
]
}