From fa49dacae3c5654d80539ae1c4afe5ef82525551 Mon Sep 17 00:00:00 2001 From: Thomas Kranitsas Date: Tue, 14 Sep 2021 21:05:58 +0300 Subject: [PATCH] Integrate with the automated API testing framework --- .gitignore | 3 + README.md | 104 +- Verification.md | 93 + config/default.js | 4 +- config/test.js | 40 + package-lock.json | 1382 +- package.json | 8 +- scripts/db/migrations.js | 1 - src/modules/cleanup/controller.js | 19 + src/modules/cleanup/route.js | 16 + src/modules/cleanup/service.js | 127 + test/postman/README.md | 23 + .../postman/Ubahn-api.postman_collection.json | 22577 ++++++++++++++++ .../Ubahn-api.postman_environment.json | 334 + test/postman/clearTestData.js | 28 + test/postman/envHelper.js | 107 + test/postman/importData/Achievement.json | 28 + .../importData/AchievementsProvider.json | 42 + test/postman/importData/Attribute.json | 92 + test/postman/importData/AttributeGroup.json | 38 + test/postman/importData/ExternalProfile.json | 62 + test/postman/importData/Organization.json | 34 + .../OrganizationSkillsProvider.json | 29 + test/postman/importData/Role.json | 34 + test/postman/importData/Skill.json | 68 + test/postman/importData/SkillsProvider.json | 34 + test/postman/importData/User.json | 255 + test/postman/importData/UserAttribute.json | 32 + test/postman/importData/UsersRole.json | 20 + test/postman/importData/UsersSkill.json | 134 + test/postman/insert-postman-data.js | 31 + test/postman/newman.js | 1543 ++ ...create-achievements-provider-by-admin.json | 14 + .../create-achievements-provider-by-user.json | 14 + ...hievements-provider-with-invalid-data.json | 30 + ...evements-provider-with-invalid-tokens.json | 16 + ...vements-provider-with-invalid-request.json | 25 + .../get-achievements-provider-by-admin.json | 10 + .../get-achievements-provider-by-user.json | 6 + ...ents-provider-with-invalid-parameters.json | 12 + ...evements-provider-with-invalid-tokens.json | 26 + ...nts-provider-with-any-fields-by-admin.json | 12 + ...ents-provider-with-any-fields-by-user.json | 12 + ...hievements-provider-with-invalid-data.json | 42 + ...evements-provider-with-invalid-tokens.json | 19 + ...nts-providers-with-invalid-parameters.json | 22 + ...vements-providers-with-invalid-tokens.json | 17 + ...nts-providers-with-various-parameters.json | 17 + .../create-attribute-group-by-admin.json | 17 + .../create-attribute-group-by-user.json | 17 + ...ate-attribute-group-with-invalid-data.json | 49 + ...e-attribute-group-with-invalid-tokens.json | 16 + ...-attribute-group-with-invalid-request.json | 31 + .../get-attribute-group-by-admin.json | 10 + .../get-attribute-group-by-user.json | 6 + ...tribute-group-with-invalid-parameters.json | 12 + ...t-attribute-group-with-invalid-tokens.json | 26 + ...ribute-group-with-any-fields-by-admin.json | 34 + ...tribute-group-with-any-fields-by-user.json | 34 + ...tch-attribute-group-with-invalid-data.json | 50 + ...h-attribute-group-with-invalid-tokens.json | 19 + ...ribute-groups-with-invalid-parameters.json | 27 + ...-attribute-groups-with-invalid-tokens.json | 17 + ...ribute-groups-with-various-parameters.json | 20 + .../attribute/create-attribute-by-admin.json | 17 + .../attribute/create-attribute-by-user.json | 17 + .../create-attribute-with-invalid-data.json | 49 + .../create-attribute-with-invalid-tokens.json | 16 + ...delete-attribute-with-invalid-request.json | 31 + .../attribute/get-attribute-by-admin.json | 10 + .../attribute/get-attribute-by-user.json | 6 + ...get-attribute-with-invalid-parameters.json | 12 + .../get-attribute-with-invalid-tokens.json | 26 + ...ch-attribute-with-any-fields-by-admin.json | 24 + ...tch-attribute-with-any-fields-by-user.json | 24 + .../patch-attribute-with-invalid-data.json | 58 + .../patch-attribute-with-invalid-tokens.json | 20 + ...ch-attributes-with-invalid-parameters.json | 27 + ...search-attributes-with-invalid-tokens.json | 17 + ...ch-attributes-with-various-parameters.json | 20 + .../create-external-profile-by-admin.json | 58 + .../create-external-profile-by-user.json | 58 + ...te-external-profile-with-invalid-data.json | 83 + ...-external-profile-with-invalid-tokens.json | 20 + .../delete-external-profile-by-admin.json | 6 + ...external-profile-with-invalid-request.json | 36 + .../get-external-profile-by-admin.json | 7 + .../get-external-profile-by-user.json | 7 + ...ernal-profile-with-invalid-parameters.json | 26 + ...-external-profile-with-invalid-tokens.json | 30 + ...rnal-profile-with-any-fields-by-admin.json | 50 + ...ernal-profile-with-any-fields-by-user.json | 50 + ...ch-external-profile-with-invalid-data.json | 54 + ...-external-profile-with-invalid-tokens.json | 23 + ...rnal-profiles-with-invalid-parameters.json | 40 + ...external-profiles-with-invalid-tokens.json | 20 + ...rnal-profiles-with-various-parameters.json | 22 + ...-organization-skill-provider-by-admin.json | 12 + ...e-organization-skill-provider-by-user.json | 12 + ...tion-skill-provider-with-invalid-data.json | 41 + ...on-skill-provider-with-invalid-tokens.json | 20 + ...-organization-skill-provider-by-admin.json | 6 + ...n-skill-provider-with-invalid-request.json | 36 + ...-organization-skill-provider-by-admin.json | 7 + ...t-organization-skill-provider-by-user.json | 7 + ...kill-provider-with-invalid-parameters.json | 26 + ...on-skill-provider-with-invalid-tokens.json | 30 + ...ill-providers-with-invalid-parameters.json | 26 + ...n-skill-providers-with-invalid-tokens.json | 20 + ...ill-providers-with-various-parameters.json | 10 + .../create-organization-by-admin.json | 14 + .../create-organization-by-user.json | 14 + ...create-organization-with-invalid-data.json | 30 + ...eate-organization-with-invalid-tokens.json | 16 + ...ete-organization-with-invalid-request.json | 25 + .../get-organization-by-admin.json | 10 + .../get-organization-by-user.json | 6 + ...-organization-with-invalid-parameters.json | 12 + .../get-organization-with-invalid-tokens.json | 26 + ...organization-with-any-fields-by-admin.json | 12 + ...-organization-with-any-fields-by-user.json | 12 + .../patch-organization-with-invalid-data.json | 42 + ...atch-organization-with-invalid-tokens.json | 19 + ...organizations-with-invalid-parameters.json | 22 + ...rch-organizations-with-invalid-tokens.json | 17 + ...organizations-with-various-parameters.json | 17 + .../testData/role/create-role-by-admin.json | 14 + .../testData/role/create-role-by-user.json | 14 + .../role/create-role-with-invalid-data.json | 30 + .../role/create-role-with-invalid-tokens.json | 16 + .../testData/role/delete-role-by-admin.json | 5 + .../delete-role-with-invalid-request.json | 31 + .../testData/role/get-role-by-admin.json | 10 + .../testData/role/get-role-by-user.json | 6 + .../get-role-with-invalid-parameters.json | 12 + .../role/get-role-with-invalid-tokens.json | 26 + .../patch-role-with-any-fields-by-admin.json | 12 + .../patch-role-with-any-fields-by-user.json | 12 + .../role/patch-role-with-invalid-data.json | 42 + .../role/patch-role-with-invalid-tokens.json | 19 + .../search-roles-with-invalid-parameters.json | 22 + .../search-roles-with-invalid-tokens.json | 17 + .../search-roles-with-various-parameters.json | 17 + .../create-skill-provider-by-admin.json | 14 + .../create-skill-provider-by-user.json | 14 + ...eate-skill-provider-with-invalid-data.json | 23 + ...te-skill-provider-with-invalid-tokens.json | 16 + .../delete-skill-provider-by-admin.json | 5 + ...e-skill-provider-with-invalid-request.json | 31 + .../get-skill-provider-by-admin.json | 10 + .../get-skill-provider-by-user.json | 6 + ...kill-provider-with-invalid-parameters.json | 12 + ...et-skill-provider-with-invalid-tokens.json | 26 + ...ill-provider-with-any-fields-by-admin.json | 12 + ...kill-provider-with-any-fields-by-user.json | 12 + ...atch-skill-provider-with-invalid-data.json | 34 + ...ch-skill-provider-with-invalid-tokens.json | 19 + ...ill-providers-with-invalid-parameters.json | 22 + ...h-skill-providers-with-invalid-tokens.json | 17 + ...ill-providers-with-various-parameters.json | 17 + ...-achievements-with-invalid-parameters.json | 7 + ...user-achievements-with-invalid-tokens.json | 26 + ...-achievements-with-various-parameters.json | 8 + ...h-user-attributes-with-invalid-tokens.json | 22 + ...er-attributes-with-various-parameters.json | 14 + ...h-user-skills-with-invalid-parameters.json | 12 + ...earch-user-skills-with-invalid-tokens.json | 26 + ...h-user-skills-with-various-parameters.json | 5 + ...-search-users-with-invalid-parameters.json | 33 + ...kill-search-users-with-invalid-tokens.json | 29 + ...-search-users-with-various-parameters.json | 14 + .../testData/skill/create-skill-by-admin.json | 23 + .../testData/skill/create-skill-by-user.json | 23 + .../skill/create-skill-with-invalid-data.json | 81 + .../create-skill-with-invalid-tokens.json | 17 + .../testData/skill/delete-skill-by-admin.json | 5 + .../delete-skill-with-invalid-request.json | 31 + .../testData/skill/get-skill-by-admin.json | 10 + .../testData/skill/get-skill-by-user.json | 6 + .../get-skill-with-invalid-parameters.json | 12 + .../skill/get-skill-with-invalid-tokens.json | 26 + .../patch-skill-with-any-fields-by-admin.json | 48 + .../patch-skill-with-any-fields-by-user.json | 48 + .../skill/patch-skill-with-invalid-data.json | 58 + .../patch-skill-with-invalid-tokens.json | 20 + ...search-skills-with-invalid-parameters.json | 42 + .../search-skills-with-invalid-tokens.json | 17 + ...search-skills-with-various-parameters.json | 29 + .../create-user-achievement-by-admin.json | 74 + .../create-user-achievement-by-user.json | 74 + ...te-user-achievement-with-invalid-data.json | 114 + ...-user-achievement-with-invalid-tokens.json | 20 + .../delete-user-achievement-by-admin.json | 6 + ...user-achievement-with-invalid-request.json | 36 + .../get-user-achievement-by-admin.json | 7 + .../get-user-achievement-by-user.json | 7 + ...r-achievement-with-invalid-parameters.json | 26 + ...-user-achievement-with-invalid-tokens.json | 30 + ...-achievement-with-any-fields-by-admin.json | 63 + ...r-achievement-with-any-fields-by-user.json | 63 + ...ch-user-achievement-with-invalid-data.json | 54 + ...-user-achievement-with-invalid-tokens.json | 23 + ...-achievements-with-invalid-parameters.json | 25 + ...user-achievements-with-invalid-tokens.json | 20 + ...-achievements-with-various-parameters.json | 10 + .../create-user-attribute-by-admin.json | 14 + .../create-user-attribute-by-user.json | 14 + ...eate-user-attribute-with-invalid-data.json | 63 + ...te-user-attribute-with-invalid-tokens.json | 20 + .../delete-user-attribute-by-admin.json | 6 + ...e-user-attribute-with-invalid-request.json | 36 + .../get-user-attribute-by-admin.json | 7 + .../get-user-attribute-by-user.json | 7 + ...ser-attribute-with-invalid-parameters.json | 26 + ...et-user-attribute-with-invalid-tokens.json | 30 + ...er-attribute-with-any-fields-by-admin.json | 13 + ...ser-attribute-with-any-fields-by-user.json | 13 + ...atch-user-attribute-with-invalid-data.json | 36 + ...ch-user-attribute-with-invalid-tokens.json | 23 + ...er-attributes-with-invalid-parameters.json | 35 + ...h-user-attributes-with-invalid-tokens.json | 20 + ...er-attributes-with-various-parameters.json | 22 + .../user-role/create-user-role-by-admin.json | 12 + .../user-role/create-user-role-by-user.json | 12 + .../create-user-role-with-invalid-data.json | 41 + .../create-user-role-with-invalid-tokens.json | 20 + ...delete-user-role-with-invalid-request.json | 36 + .../user-role/get-user-role-by-admin.json | 7 + .../user-role/get-user-role-by-user.json | 7 + ...get-user-role-with-invalid-parameters.json | 26 + .../get-user-role-with-invalid-tokens.json | 30 + ...ch-user-roles-with-invalid-parameters.json | 26 + ...search-user-roles-with-invalid-tokens.json | 20 + ...ch-user-roles-with-various-parameters.json | 10 + .../create-user-skill-by-admin.json | 30 + .../user-skill/create-user-skill-by-user.json | 14 + .../create-user-skill-with-invalid-data.json | 78 + ...create-user-skill-with-invalid-tokens.json | 20 + ...elete-user-skill-with-invalid-request.json | 36 + .../user-skill/get-user-skill-by-admin.json | 12 + .../user-skill/get-user-skill-by-user.json | 7 + ...et-user-skill-with-invalid-parameters.json | 26 + .../get-user-skill-with-invalid-tokens.json | 30 + ...h-user-skill-with-any-fields-by-admin.json | 50 + ...ch-user-skill-with-any-fields-by-user.json | 50 + .../patch-user-skill-with-invalid-data.json | 54 + .../patch-user-skill-with-invalid-tokens.json | 23 + ...h-user-skills-with-invalid-parameters.json | 32 + ...earch-user-skills-with-invalid-tokens.json | 20 + ...h-user-skills-with-various-parameters.json | 14 + .../testData/user/create-user-by-admin.json | 20 + .../testData/user/create-user-by-user.json | 20 + .../user/create-user-with-invalid-data.json | 72 + .../user/create-user-with-invalid-tokens.json | 16 + .../testData/user/delete-user-by-admin.json | 5 + .../user/delete-user-with-invalid-tokens.json | 25 + .../testData/user/get-user-by-admin.json | 17 + .../testData/user/get-user-by-user.json | 12 + .../get-user-with-invalid-parameters.json | 8 + .../user/get-user-with-invalid-tokens.json | 23 + .../patch-user-with-any-fields-by-admin.json | 82 + .../patch-user-with-any-fields-by-user.json | 82 + .../user/patch-user-with-invalid-data.json | 42 + .../user/patch-user-with-invalid-tokens.json | 19 + .../search-users-with-invalid-parameters.json | 42 + .../search-users-with-invalid-tokens.json | 17 + .../search-users-with-various-parameters.json | 32 + 267 files changed, 32995 insertions(+), 138 deletions(-) create mode 100644 Verification.md create mode 100644 config/test.js create mode 100644 src/modules/cleanup/controller.js create mode 100644 src/modules/cleanup/route.js create mode 100644 src/modules/cleanup/service.js create mode 100644 test/postman/README.md create mode 100644 test/postman/Ubahn-api.postman_collection.json create mode 100644 test/postman/Ubahn-api.postman_environment.json create mode 100644 test/postman/clearTestData.js create mode 100644 test/postman/envHelper.js create mode 100644 test/postman/importData/Achievement.json create mode 100644 test/postman/importData/AchievementsProvider.json create mode 100644 test/postman/importData/Attribute.json create mode 100644 test/postman/importData/AttributeGroup.json create mode 100644 test/postman/importData/ExternalProfile.json create mode 100644 test/postman/importData/Organization.json create mode 100644 test/postman/importData/OrganizationSkillsProvider.json create mode 100644 test/postman/importData/Role.json create mode 100644 test/postman/importData/Skill.json create mode 100644 test/postman/importData/SkillsProvider.json create mode 100644 test/postman/importData/User.json create mode 100644 test/postman/importData/UserAttribute.json create mode 100644 test/postman/importData/UsersRole.json create mode 100644 test/postman/importData/UsersSkill.json create mode 100644 test/postman/insert-postman-data.js create mode 100644 test/postman/newman.js create mode 100644 test/postman/testData/achievements-provider/create-achievements-provider-by-admin.json create mode 100644 test/postman/testData/achievements-provider/create-achievements-provider-by-user.json create mode 100644 test/postman/testData/achievements-provider/create-achievements-provider-with-invalid-data.json create mode 100644 test/postman/testData/achievements-provider/create-achievements-provider-with-invalid-tokens.json create mode 100644 test/postman/testData/achievements-provider/delete-achievements-provider-with-invalid-request.json create mode 100644 test/postman/testData/achievements-provider/get-achievements-provider-by-admin.json create mode 100644 test/postman/testData/achievements-provider/get-achievements-provider-by-user.json create mode 100644 test/postman/testData/achievements-provider/get-achievements-provider-with-invalid-parameters.json create mode 100644 test/postman/testData/achievements-provider/get-achievements-provider-with-invalid-tokens.json create mode 100644 test/postman/testData/achievements-provider/patch-achievements-provider-with-any-fields-by-admin.json create mode 100644 test/postman/testData/achievements-provider/patch-achievements-provider-with-any-fields-by-user.json create mode 100644 test/postman/testData/achievements-provider/patch-achievements-provider-with-invalid-data.json create mode 100644 test/postman/testData/achievements-provider/patch-achievements-provider-with-invalid-tokens.json create mode 100644 test/postman/testData/achievements-provider/search-achievements-providers-with-invalid-parameters.json create mode 100644 test/postman/testData/achievements-provider/search-achievements-providers-with-invalid-tokens.json create mode 100644 test/postman/testData/achievements-provider/search-achievements-providers-with-various-parameters.json create mode 100644 test/postman/testData/attribute-group/create-attribute-group-by-admin.json create mode 100644 test/postman/testData/attribute-group/create-attribute-group-by-user.json create mode 100644 test/postman/testData/attribute-group/create-attribute-group-with-invalid-data.json create mode 100644 test/postman/testData/attribute-group/create-attribute-group-with-invalid-tokens.json create mode 100644 test/postman/testData/attribute-group/delete-attribute-group-with-invalid-request.json create mode 100644 test/postman/testData/attribute-group/get-attribute-group-by-admin.json create mode 100644 test/postman/testData/attribute-group/get-attribute-group-by-user.json create mode 100644 test/postman/testData/attribute-group/get-attribute-group-with-invalid-parameters.json create mode 100644 test/postman/testData/attribute-group/get-attribute-group-with-invalid-tokens.json create mode 100644 test/postman/testData/attribute-group/patch-attribute-group-with-any-fields-by-admin.json create mode 100644 test/postman/testData/attribute-group/patch-attribute-group-with-any-fields-by-user.json create mode 100644 test/postman/testData/attribute-group/patch-attribute-group-with-invalid-data.json create mode 100644 test/postman/testData/attribute-group/patch-attribute-group-with-invalid-tokens.json create mode 100644 test/postman/testData/attribute-group/search-attribute-groups-with-invalid-parameters.json create mode 100644 test/postman/testData/attribute-group/search-attribute-groups-with-invalid-tokens.json create mode 100644 test/postman/testData/attribute-group/search-attribute-groups-with-various-parameters.json create mode 100644 test/postman/testData/attribute/create-attribute-by-admin.json create mode 100644 test/postman/testData/attribute/create-attribute-by-user.json create mode 100644 test/postman/testData/attribute/create-attribute-with-invalid-data.json create mode 100644 test/postman/testData/attribute/create-attribute-with-invalid-tokens.json create mode 100644 test/postman/testData/attribute/delete-attribute-with-invalid-request.json create mode 100644 test/postman/testData/attribute/get-attribute-by-admin.json create mode 100644 test/postman/testData/attribute/get-attribute-by-user.json create mode 100644 test/postman/testData/attribute/get-attribute-with-invalid-parameters.json create mode 100644 test/postman/testData/attribute/get-attribute-with-invalid-tokens.json create mode 100644 test/postman/testData/attribute/patch-attribute-with-any-fields-by-admin.json create mode 100644 test/postman/testData/attribute/patch-attribute-with-any-fields-by-user.json create mode 100644 test/postman/testData/attribute/patch-attribute-with-invalid-data.json create mode 100644 test/postman/testData/attribute/patch-attribute-with-invalid-tokens.json create mode 100644 test/postman/testData/attribute/search-attributes-with-invalid-parameters.json create mode 100644 test/postman/testData/attribute/search-attributes-with-invalid-tokens.json create mode 100644 test/postman/testData/attribute/search-attributes-with-various-parameters.json create mode 100644 test/postman/testData/external-profile/create-external-profile-by-admin.json create mode 100644 test/postman/testData/external-profile/create-external-profile-by-user.json create mode 100644 test/postman/testData/external-profile/create-external-profile-with-invalid-data.json create mode 100644 test/postman/testData/external-profile/create-external-profile-with-invalid-tokens.json create mode 100644 test/postman/testData/external-profile/delete-external-profile-by-admin.json create mode 100644 test/postman/testData/external-profile/delete-external-profile-with-invalid-request.json create mode 100644 test/postman/testData/external-profile/get-external-profile-by-admin.json create mode 100644 test/postman/testData/external-profile/get-external-profile-by-user.json create mode 100644 test/postman/testData/external-profile/get-external-profile-with-invalid-parameters.json create mode 100644 test/postman/testData/external-profile/get-external-profile-with-invalid-tokens.json create mode 100644 test/postman/testData/external-profile/patch-external-profile-with-any-fields-by-admin.json create mode 100644 test/postman/testData/external-profile/patch-external-profile-with-any-fields-by-user.json create mode 100644 test/postman/testData/external-profile/patch-external-profile-with-invalid-data.json create mode 100644 test/postman/testData/external-profile/patch-external-profile-with-invalid-tokens.json create mode 100644 test/postman/testData/external-profile/search-external-profiles-with-invalid-parameters.json create mode 100644 test/postman/testData/external-profile/search-external-profiles-with-invalid-tokens.json create mode 100644 test/postman/testData/external-profile/search-external-profiles-with-various-parameters.json create mode 100644 test/postman/testData/organization-skill-provider/create-organization-skill-provider-by-admin.json create mode 100644 test/postman/testData/organization-skill-provider/create-organization-skill-provider-by-user.json create mode 100644 test/postman/testData/organization-skill-provider/create-organization-skill-provider-with-invalid-data.json create mode 100644 test/postman/testData/organization-skill-provider/create-organization-skill-provider-with-invalid-tokens.json create mode 100644 test/postman/testData/organization-skill-provider/delete-organization-skill-provider-by-admin.json create mode 100644 test/postman/testData/organization-skill-provider/delete-organization-skill-provider-with-invalid-request.json create mode 100644 test/postman/testData/organization-skill-provider/get-organization-skill-provider-by-admin.json create mode 100644 test/postman/testData/organization-skill-provider/get-organization-skill-provider-by-user.json create mode 100644 test/postman/testData/organization-skill-provider/get-organization-skill-provider-with-invalid-parameters.json create mode 100644 test/postman/testData/organization-skill-provider/get-organization-skill-provider-with-invalid-tokens.json create mode 100644 test/postman/testData/organization-skill-provider/search-organization-skill-providers-with-invalid-parameters.json create mode 100644 test/postman/testData/organization-skill-provider/search-organization-skill-providers-with-invalid-tokens.json create mode 100644 test/postman/testData/organization-skill-provider/search-organization-skill-providers-with-various-parameters.json create mode 100644 test/postman/testData/organization/create-organization-by-admin.json create mode 100644 test/postman/testData/organization/create-organization-by-user.json create mode 100644 test/postman/testData/organization/create-organization-with-invalid-data.json create mode 100644 test/postman/testData/organization/create-organization-with-invalid-tokens.json create mode 100644 test/postman/testData/organization/delete-organization-with-invalid-request.json create mode 100644 test/postman/testData/organization/get-organization-by-admin.json create mode 100644 test/postman/testData/organization/get-organization-by-user.json create mode 100644 test/postman/testData/organization/get-organization-with-invalid-parameters.json create mode 100644 test/postman/testData/organization/get-organization-with-invalid-tokens.json create mode 100644 test/postman/testData/organization/patch-organization-with-any-fields-by-admin.json create mode 100644 test/postman/testData/organization/patch-organization-with-any-fields-by-user.json create mode 100644 test/postman/testData/organization/patch-organization-with-invalid-data.json create mode 100644 test/postman/testData/organization/patch-organization-with-invalid-tokens.json create mode 100644 test/postman/testData/organization/search-organizations-with-invalid-parameters.json create mode 100644 test/postman/testData/organization/search-organizations-with-invalid-tokens.json create mode 100644 test/postman/testData/organization/search-organizations-with-various-parameters.json create mode 100644 test/postman/testData/role/create-role-by-admin.json create mode 100644 test/postman/testData/role/create-role-by-user.json create mode 100644 test/postman/testData/role/create-role-with-invalid-data.json create mode 100644 test/postman/testData/role/create-role-with-invalid-tokens.json create mode 100644 test/postman/testData/role/delete-role-by-admin.json create mode 100644 test/postman/testData/role/delete-role-with-invalid-request.json create mode 100644 test/postman/testData/role/get-role-by-admin.json create mode 100644 test/postman/testData/role/get-role-by-user.json create mode 100644 test/postman/testData/role/get-role-with-invalid-parameters.json create mode 100644 test/postman/testData/role/get-role-with-invalid-tokens.json create mode 100644 test/postman/testData/role/patch-role-with-any-fields-by-admin.json create mode 100644 test/postman/testData/role/patch-role-with-any-fields-by-user.json create mode 100644 test/postman/testData/role/patch-role-with-invalid-data.json create mode 100644 test/postman/testData/role/patch-role-with-invalid-tokens.json create mode 100644 test/postman/testData/role/search-roles-with-invalid-parameters.json create mode 100644 test/postman/testData/role/search-roles-with-invalid-tokens.json create mode 100644 test/postman/testData/role/search-roles-with-various-parameters.json create mode 100644 test/postman/testData/skill-provider/create-skill-provider-by-admin.json create mode 100644 test/postman/testData/skill-provider/create-skill-provider-by-user.json create mode 100644 test/postman/testData/skill-provider/create-skill-provider-with-invalid-data.json create mode 100644 test/postman/testData/skill-provider/create-skill-provider-with-invalid-tokens.json create mode 100644 test/postman/testData/skill-provider/delete-skill-provider-by-admin.json create mode 100644 test/postman/testData/skill-provider/delete-skill-provider-with-invalid-request.json create mode 100644 test/postman/testData/skill-provider/get-skill-provider-by-admin.json create mode 100644 test/postman/testData/skill-provider/get-skill-provider-by-user.json create mode 100644 test/postman/testData/skill-provider/get-skill-provider-with-invalid-parameters.json create mode 100644 test/postman/testData/skill-provider/get-skill-provider-with-invalid-tokens.json create mode 100644 test/postman/testData/skill-provider/patch-skill-provider-with-any-fields-by-admin.json create mode 100644 test/postman/testData/skill-provider/patch-skill-provider-with-any-fields-by-user.json create mode 100644 test/postman/testData/skill-provider/patch-skill-provider-with-invalid-data.json create mode 100644 test/postman/testData/skill-provider/patch-skill-provider-with-invalid-tokens.json create mode 100644 test/postman/testData/skill-provider/search-skill-providers-with-invalid-parameters.json create mode 100644 test/postman/testData/skill-provider/search-skill-providers-with-invalid-tokens.json create mode 100644 test/postman/testData/skill-provider/search-skill-providers-with-various-parameters.json create mode 100644 test/postman/testData/skill-search/skill-search-user-achievements-with-invalid-parameters.json create mode 100644 test/postman/testData/skill-search/skill-search-user-achievements-with-invalid-tokens.json create mode 100644 test/postman/testData/skill-search/skill-search-user-achievements-with-various-parameters.json create mode 100644 test/postman/testData/skill-search/skill-search-user-attributes-with-invalid-tokens.json create mode 100644 test/postman/testData/skill-search/skill-search-user-attributes-with-various-parameters.json create mode 100644 test/postman/testData/skill-search/skill-search-user-skills-with-invalid-parameters.json create mode 100644 test/postman/testData/skill-search/skill-search-user-skills-with-invalid-tokens.json create mode 100644 test/postman/testData/skill-search/skill-search-user-skills-with-various-parameters.json create mode 100644 test/postman/testData/skill-search/skill-search-users-with-invalid-parameters.json create mode 100644 test/postman/testData/skill-search/skill-search-users-with-invalid-tokens.json create mode 100644 test/postman/testData/skill-search/skill-search-users-with-various-parameters.json create mode 100644 test/postman/testData/skill/create-skill-by-admin.json create mode 100644 test/postman/testData/skill/create-skill-by-user.json create mode 100644 test/postman/testData/skill/create-skill-with-invalid-data.json create mode 100644 test/postman/testData/skill/create-skill-with-invalid-tokens.json create mode 100644 test/postman/testData/skill/delete-skill-by-admin.json create mode 100644 test/postman/testData/skill/delete-skill-with-invalid-request.json create mode 100644 test/postman/testData/skill/get-skill-by-admin.json create mode 100644 test/postman/testData/skill/get-skill-by-user.json create mode 100644 test/postman/testData/skill/get-skill-with-invalid-parameters.json create mode 100644 test/postman/testData/skill/get-skill-with-invalid-tokens.json create mode 100644 test/postman/testData/skill/patch-skill-with-any-fields-by-admin.json create mode 100644 test/postman/testData/skill/patch-skill-with-any-fields-by-user.json create mode 100644 test/postman/testData/skill/patch-skill-with-invalid-data.json create mode 100644 test/postman/testData/skill/patch-skill-with-invalid-tokens.json create mode 100644 test/postman/testData/skill/search-skills-with-invalid-parameters.json create mode 100644 test/postman/testData/skill/search-skills-with-invalid-tokens.json create mode 100644 test/postman/testData/skill/search-skills-with-various-parameters.json create mode 100644 test/postman/testData/user-achievement/create-user-achievement-by-admin.json create mode 100644 test/postman/testData/user-achievement/create-user-achievement-by-user.json create mode 100644 test/postman/testData/user-achievement/create-user-achievement-with-invalid-data.json create mode 100644 test/postman/testData/user-achievement/create-user-achievement-with-invalid-tokens.json create mode 100644 test/postman/testData/user-achievement/delete-user-achievement-by-admin.json create mode 100644 test/postman/testData/user-achievement/delete-user-achievement-with-invalid-request.json create mode 100644 test/postman/testData/user-achievement/get-user-achievement-by-admin.json create mode 100644 test/postman/testData/user-achievement/get-user-achievement-by-user.json create mode 100644 test/postman/testData/user-achievement/get-user-achievement-with-invalid-parameters.json create mode 100644 test/postman/testData/user-achievement/get-user-achievement-with-invalid-tokens.json create mode 100644 test/postman/testData/user-achievement/patch-user-achievement-with-any-fields-by-admin.json create mode 100644 test/postman/testData/user-achievement/patch-user-achievement-with-any-fields-by-user.json create mode 100644 test/postman/testData/user-achievement/patch-user-achievement-with-invalid-data.json create mode 100644 test/postman/testData/user-achievement/patch-user-achievement-with-invalid-tokens.json create mode 100644 test/postman/testData/user-achievement/search-user-achievements-with-invalid-parameters.json create mode 100644 test/postman/testData/user-achievement/search-user-achievements-with-invalid-tokens.json create mode 100644 test/postman/testData/user-achievement/search-user-achievements-with-various-parameters.json create mode 100644 test/postman/testData/user-attribute/create-user-attribute-by-admin.json create mode 100644 test/postman/testData/user-attribute/create-user-attribute-by-user.json create mode 100644 test/postman/testData/user-attribute/create-user-attribute-with-invalid-data.json create mode 100644 test/postman/testData/user-attribute/create-user-attribute-with-invalid-tokens.json create mode 100644 test/postman/testData/user-attribute/delete-user-attribute-by-admin.json create mode 100644 test/postman/testData/user-attribute/delete-user-attribute-with-invalid-request.json create mode 100644 test/postman/testData/user-attribute/get-user-attribute-by-admin.json create mode 100644 test/postman/testData/user-attribute/get-user-attribute-by-user.json create mode 100644 test/postman/testData/user-attribute/get-user-attribute-with-invalid-parameters.json create mode 100644 test/postman/testData/user-attribute/get-user-attribute-with-invalid-tokens.json create mode 100644 test/postman/testData/user-attribute/patch-user-attribute-with-any-fields-by-admin.json create mode 100644 test/postman/testData/user-attribute/patch-user-attribute-with-any-fields-by-user.json create mode 100644 test/postman/testData/user-attribute/patch-user-attribute-with-invalid-data.json create mode 100644 test/postman/testData/user-attribute/patch-user-attribute-with-invalid-tokens.json create mode 100644 test/postman/testData/user-attribute/search-user-attributes-with-invalid-parameters.json create mode 100644 test/postman/testData/user-attribute/search-user-attributes-with-invalid-tokens.json create mode 100644 test/postman/testData/user-attribute/search-user-attributes-with-various-parameters.json create mode 100644 test/postman/testData/user-role/create-user-role-by-admin.json create mode 100644 test/postman/testData/user-role/create-user-role-by-user.json create mode 100644 test/postman/testData/user-role/create-user-role-with-invalid-data.json create mode 100644 test/postman/testData/user-role/create-user-role-with-invalid-tokens.json create mode 100644 test/postman/testData/user-role/delete-user-role-with-invalid-request.json create mode 100644 test/postman/testData/user-role/get-user-role-by-admin.json create mode 100644 test/postman/testData/user-role/get-user-role-by-user.json create mode 100644 test/postman/testData/user-role/get-user-role-with-invalid-parameters.json create mode 100644 test/postman/testData/user-role/get-user-role-with-invalid-tokens.json create mode 100644 test/postman/testData/user-role/search-user-roles-with-invalid-parameters.json create mode 100644 test/postman/testData/user-role/search-user-roles-with-invalid-tokens.json create mode 100644 test/postman/testData/user-role/search-user-roles-with-various-parameters.json create mode 100644 test/postman/testData/user-skill/create-user-skill-by-admin.json create mode 100644 test/postman/testData/user-skill/create-user-skill-by-user.json create mode 100644 test/postman/testData/user-skill/create-user-skill-with-invalid-data.json create mode 100644 test/postman/testData/user-skill/create-user-skill-with-invalid-tokens.json create mode 100644 test/postman/testData/user-skill/delete-user-skill-with-invalid-request.json create mode 100644 test/postman/testData/user-skill/get-user-skill-by-admin.json create mode 100644 test/postman/testData/user-skill/get-user-skill-by-user.json create mode 100644 test/postman/testData/user-skill/get-user-skill-with-invalid-parameters.json create mode 100644 test/postman/testData/user-skill/get-user-skill-with-invalid-tokens.json create mode 100644 test/postman/testData/user-skill/patch-user-skill-with-any-fields-by-admin.json create mode 100644 test/postman/testData/user-skill/patch-user-skill-with-any-fields-by-user.json create mode 100644 test/postman/testData/user-skill/patch-user-skill-with-invalid-data.json create mode 100644 test/postman/testData/user-skill/patch-user-skill-with-invalid-tokens.json create mode 100644 test/postman/testData/user-skill/search-user-skills-with-invalid-parameters.json create mode 100644 test/postman/testData/user-skill/search-user-skills-with-invalid-tokens.json create mode 100644 test/postman/testData/user-skill/search-user-skills-with-various-parameters.json create mode 100644 test/postman/testData/user/create-user-by-admin.json create mode 100644 test/postman/testData/user/create-user-by-user.json create mode 100644 test/postman/testData/user/create-user-with-invalid-data.json create mode 100644 test/postman/testData/user/create-user-with-invalid-tokens.json create mode 100644 test/postman/testData/user/delete-user-by-admin.json create mode 100644 test/postman/testData/user/delete-user-with-invalid-tokens.json create mode 100644 test/postman/testData/user/get-user-by-admin.json create mode 100644 test/postman/testData/user/get-user-by-user.json create mode 100644 test/postman/testData/user/get-user-with-invalid-parameters.json create mode 100644 test/postman/testData/user/get-user-with-invalid-tokens.json create mode 100644 test/postman/testData/user/patch-user-with-any-fields-by-admin.json create mode 100644 test/postman/testData/user/patch-user-with-any-fields-by-user.json create mode 100644 test/postman/testData/user/patch-user-with-invalid-data.json create mode 100644 test/postman/testData/user/patch-user-with-invalid-tokens.json create mode 100644 test/postman/testData/user/search-users-with-invalid-parameters.json create mode 100644 test/postman/testData/user/search-users-with-invalid-tokens.json create mode 100644 test/postman/testData/user/search-users-with-various-parameters.json diff --git a/.gitignore b/.gitignore index d31a0ba..94c21b3 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,6 @@ scripts/generate .env coverage .vscode + +# Newman tests +newman diff --git a/README.md b/README.md index 8637573..4183db7 100755 --- a/README.md +++ b/README.md @@ -14,6 +14,8 @@ Configuration for the application is at config/default.js and config/production. - LOG_LEVEL: the log level - PORT: the server port +- API_BASE_URL: the api base url, default to 'http://127.0.0.1:3001/api/1.0' +- AUTOMATED_TESTING_NAME_PREFIX: the prefix for the records from db, default to 'POSTMANE2E-', - CASCADE_PAUSE_MS: how many milliseconds to pause between deleting records during cascade delete (default to 1000) - AUTH_SECRET: TC Authentication secret - VALID_ISSUERS: valid issuers for TC authentication @@ -58,7 +60,38 @@ Configuration for the application is at config/default.js and config/production. For `ES.DOCUMENTS` configuration, you will find multiple other configurations below it. Each has default values that you can override using the environment variables - +Configuration for testing is at `config/test.js`, only add such new configurations different from `config/default.js` +- WAIT_TIME: wait time used in test, default is 0 or 0 second (5000 stands for 5 seconds) +- AUTH_V2_URL: The auth v2 url +- AUTH_V2_CLIENT_ID: The auth v2 client id +- AUTH_V3_URL: The auth v3 url +- ADMIN_CREDENTIALS_USERNAME: The user's username with admin role +- ADMIN_CREDENTIALS_PASSWORD: The user's password with admin role +- USER_CREDENTIALS_USERNAME: The user's username with user role +- USER_CREDENTIALS_PASSWORD: The user's password with user role +- MANAGER_CREDENTIALS_USERNAME: The user's username with manager role +- MANAGER_CREDENTIALS_PASSWORD: The user's password with manager role +- COPILOT_CREDENTIALS_USERNAME: The user's username with copilot role +- COPILOT_CREDENTIALS_PASSWORD: The user's password with copilot role +- USER_ID_BY_ADMIN: the user id which is created by admin +- USER_ID_BY_TESTER: the user id which is created by a normal user +- PROVIDER_ID_BY_ADMIN: the service provider id which is created by admin +- PROVIDER_ID_BY_TESTER: the service provider id which is created by a normal user +- SKILL_ID_BY_ADMIN: the skill id which is created by admin +- SKILL_ID_BY_TESTER: the skill id which is created by a normal user +- ROLE_ID_BY_ADMIN: the role id which is created by organization +- ROLE_ID_BY_TESTER: the role id which is created by a normal user +- ORGANIZATION_ID_BY_ADMIN: the organization id which is created by admin +- ORGANIZATION_ID_BY_TESTER: the organization id which is created by a normal user +- ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN: the achievement provider id which is created by admin +- ACHIEVEMENTS_PROVIDER_ID_BY_TESTER: the achievement provider id which is created by a normal user +- ATTRIBUTE_GROUP_ID_BY_ADMIN: the attribute group id which is created by admin +- ATTRIBUTE_GROUP_ID_BY_TESTER: the attribute group id which is created by a normal user +- ATTRIBUTE_ID_BY_ADMIN: the attribute id which is created by admin +- ATTRIBUTE_ID_BY_TESTER: the attribute id which is created by a normal user +- ACHIEVEMENT_ID_BY_ADMIN: the achievement id which is created by admin +- ACHIEVEMENT_ID_BY_TESTER: the achievement id which is created by a normal user +- AUTOMATED_TESTING_REPORTERS_FORMAT: The format of output for Newman Automation Testing Report. ## Local deployment Setup your Elasticsearch instance and ensure that it is up and running. @@ -105,3 +138,72 @@ Make sure all config values are right, and you can run on local successfully, th 5. When you are running the application for the first time, It will take some time initially to download the image and install the dependencies You can also head into `docker-pgsql-es` folder and run `docker-compose up -d` to have docker instances of pgsql and elasticsearch to use with the api + +## Running tests + +### Configuration +Test configuration is at `config/test.js`. You don't need to change them. + +The following test parameters can be set in config file or in env variables: + +- WAIT_TIME: wait time +- AUTH_V2_URL: The auth v2 url +- AUTH_V2_CLIENT_ID: The auth v2 client id +- AUTH_V3_URL: The auth v3 url +- ADMIN_CREDENTIALS_USERNAME: The user's username with admin role +- ADMIN_CREDENTIALS_PASSWORD: The user's password with admin role +- USER_CREDENTIALS_USERNAME: The user's username with user role +- USER_CREDENTIALS_PASSWORD: The user's password with user role +- COPILOT_CREDENTIALS_USERNAME: The user's username with copilot role +- COPILOT_CREDENTIALS_PASSWORD: The user's password with copilot role +- MANAGER_CREDENTIALS_USERNAME: The user's username with manager role +- MANAGER_CREDENTIALS_PASSWORD: The user's password with manager role + +### Prepare + +- Start Postgres. +- Create DynamoDB tables. +- Start Local ElasticSearch. +- Create ElasticSearch index. +- Various config parameters should be properly set. + +### Running E2E tests with Postman + +#### `Start` the app server before running e2e tests. You may need to set the env variables by calling `source env.sh` before calling `NODE_ENV=test npm start`. + +- Make sure the db and es are properly started +```bash + $ cd u-bahn-api + + # NOTE: + # if tables and data already exist, please run first + + # $ npm run delete-data + + # to drop data and tables + + # Then re-initialize the es server and the database. (Note, You need to drop the `SequelizeMeta` table manually.) + + $ npm run migrations up # to create table + $ npm run insert-postman-data # to insert the testing data for postman + $ npm run migrate-db-to-es # to index the db data to the ES +``` + +To run postman e2e tests. + +```bash +npm run test:newman +``` + +To clear the testing data from postman e2e tests. + +```bash +npm run test:newman:clear +``` + +## Running tests in CI +- TBD + +## Verification + +Refer to the verification document `Verification.md`. \ No newline at end of file diff --git a/Verification.md b/Verification.md new file mode 100644 index 0000000..5d0b322 --- /dev/null +++ b/Verification.md @@ -0,0 +1,93 @@ +# # U-Bahn API + +You can start the local pgsql and es by running `docker-compose up` from `docker-pgsql-es` folder. You should create a `.env` file and correctly set it. + +## E2E testing with Postman + +You should be able to find the tests result from the command window of running `npm run test:newman` for each test case. + +Below is a sample output result of finding users by a normal user. + +``` +Ubahn-api + +Iteration 1/9 + +❏ users / search users +↳ search users with various parameters by user + GET http://127.0.0.1:3001/api/1.0/users?page=1&perPage=10&enrich=true [200 OK, 2.28KB, 31ms] + ✓ Status code is 200 + +Iteration 2/9 + +↳ search users with various parameters by user + GET http://127.0.0.1:3001/api/1.0/users?page=1&perPage=1 [200 OK, 822B, 11ms] + ✓ Status code is 200 + +Iteration 3/9 + +↳ search users with various parameters by user + GET http://127.0.0.1:3001/api/1.0/users?page=1&perPage=1&handle=POSTMANE2E-lazybaer [200 OK, 424B, 10ms] + ✓ Status code is 200 + +Iteration 4/9 + +↳ search users with various parameters by user + GET http://127.0.0.1:3001/api/1.0/users?roleId=977d66bb-112f-49b1-8b20-2ef7a17f4943 [200 OK, 425B, 9ms] + ✓ Status code is 200 + +Iteration 5/9 + +↳ search users with various parameters by user + GET http://127.0.0.1:3001/api/1.0/users?enrich=true&externalProfile.externalId=8547899 [200 OK, 425B, 10ms] + ✓ Status code is 200 + +Iteration 6/9 + +↳ search users with various parameters by user + GET http://127.0.0.1:3001/api/1.0/users?enrich=true&externalProfile.organizationId=36ed815b-3da1-49f1-a043-aaed0a4e81ad [200 OK, 2.39KB, 11ms] + ✓ Status code is 200 + +Iteration 7/9 + +↳ search users with various parameters by user + GET http://127.0.0.1:3001/api/1.0/users?page=1&perPage=10&enrich=true&handle=POSTMANE2E-tc-Admin&roleId=977d66bb-112f-49b1-8b20-2ef7a17f4943&externalProfile.externalId=8547899&externalProfile.organizationId=36ed815b-3da1-49f1-a043-aaed0a4e81ad [200 OK, 425B, 14ms] + ✓ Status code is 200 + +Iteration 8/9 + +↳ search users with various parameters by user + GET http://127.0.0.1:3001/api/1.0/users?handle=POSTMANE2E-Sylvan_Gorczany [200 OK, 425B, 12ms] + ✓ Status code is 200 + +Iteration 9/9 + +↳ search users with various parameters by user + GET http://127.0.0.1:3001/api/1.0/users?handle=POSTMANE2E-Dana_Paucek6 [200 OK, 425B, 11ms] + ✓ Status code is 200 + +┌─────────────────────────┬──────────────────┬─────────────────┐ +│ │ executed │ failed │ +├─────────────────────────┼──────────────────┼─────────────────┤ +│ iterations │ 9 │ 0 │ +├─────────────────────────┼──────────────────┼─────────────────┤ +│ requests │ 9 │ 0 │ +├─────────────────────────┼──────────────────┼─────────────────┤ +│ test-scripts │ 9 │ 0 │ +├─────────────────────────┼──────────────────┼─────────────────┤ +│ prerequest-scripts │ 9 │ 0 │ +├─────────────────────────┼──────────────────┼─────────────────┤ +│ assertions │ 9 │ 0 │ +├─────────────────────────┴──────────────────┴─────────────────┤ +│ total run duration: 479ms │ +├──────────────────────────────────────────────────────────────┤ +│ total data received: 3.66KB (approx) │ +├──────────────────────────────────────────────────────────────┤ +│ average response time: 13ms [min: 9ms, max: 31ms, s.d.: 6ms] │ +└──────────────────────────────────────────────────────────────┘ +``` + +Then you can run `npm run test:newman:clear` to delete all testing data by above postman tests. + +If 'socket hang up' appears while running the `npm run test:newman`. You can increase the `WAIT_TIME` from the `default/test.js`. +Then run `npm run test:newman:clear`, `npm run insert-postman-data` and `npm run migrate-db-to-es` before calling `npm run test:newman` again. \ No newline at end of file diff --git a/config/default.js b/config/default.js index 1df223b..0f18778 100755 --- a/config/default.js +++ b/config/default.js @@ -5,12 +5,14 @@ module.exports = { LOG_LEVEL: process.env.LOG_LEVEL || 'debug', PORT: process.env.PORT || 3001, + API_BASE_URL: process.env.API_BASE_URL || 'http://127.0.0.1:3001/api/1.0', + AUTOMATED_TESTING_NAME_PREFIX: process.env.AUTOMATED_TESTING_NAME_PREFIX || 'POSTMANE2E-', CASCADE_PAUSE_MS: process.env.CASCADE_PAUSE_MS || 1000, AUTH_SECRET: process.env.AUTH_SECRET || 'CLIENT_SECRET', VALID_ISSUERS: process.env.VALID_ISSUERS ? process.env.VALID_ISSUERS.replace(/\\"/g, '') - : '["https://topcoder-dev.auth0.com/", "https://api.topcoder.com"]', + : '["https://api.topcoder-dev.com", "https://api.topcoder.com", "https://topcoder-dev.auth0.com/"]', PAGE_SIZE: process.env.PAGE_SIZE || 20, MAX_PAGE_SIZE: parseInt(process.env.MAX_PAGE_SIZE) || 100, diff --git a/config/test.js b/config/test.js new file mode 100644 index 0000000..d4ca56f --- /dev/null +++ b/config/test.js @@ -0,0 +1,40 @@ +/** + * The configuration file. + */ + +module.exports = { + BUSAPI_URL: 'http://localhost:9000', + WAIT_TIME: process.env.WAIT_TIME || 5000, + AUTH_V2_URL: process.env.AUTH_V2_URL || 'https://topcoder-dev.auth0.com/oauth/ro', + AUTH_V2_CLIENT_ID: process.env.AUTH_V2_CLIENT_ID || '', + AUTH_V3_URL: process.env.AUTH_V3_URL || 'https://api.topcoder-dev.com/v3/authorizations', + ADMIN_CREDENTIALS_USERNAME: process.env.ADMIN_CREDENTIALS_USERNAME || '', + ADMIN_CREDENTIALS_PASSWORD: process.env.ADMIN_CREDENTIALS_PASSWORD || '', + USER_CREDENTIALS_USERNAME: process.env.USER_CREDENTIALS_USERNAME || '', + USER_CREDENTIALS_PASSWORD: process.env.USER_CREDENTIALS_PASSWORD || '', + MANAGER_CREDENTIALS_USERNAME: process.env.MANAGER_CREDENTIALS_USERNAME || '', + MANAGER_CREDENTIALS_PASSWORD: process.env.MANAGER_CREDENTIALS_PASSWORD || '', + COPILOT_CREDENTIALS_USERNAME: process.env.COPILOT_CREDENTIALS_USERNAME || '', + COPILOT_CREDENTIALS_PASSWORD: process.env.COPILOT_CREDENTIALS_PASSWORD || '', + AUTOMATED_TESTING_REPORTERS_FORMAT: process.env.AUTOMATED_TESTING_REPORTERS_FORMAT + ? process.env.AUTOMATED_TESTING_REPORTERS_FORMAT.split(',') + : ['cli', 'html'], + USER_ID_BY_ADMIN: '0bcb0d86-09bb-410a-b2b1-fba90d1a7699', + USER_ID_BY_TESTER: 'bdcb113f-6715-40fd-8dab-14aa01327ae9', + PROVIDER_ID_BY_ADMIN: '7637ae1a-3b7c-44eb-a5ed-10ea02f1885d', + PROVIDER_ID_BY_TESTER: '4df1f70b-52e8-4e55-b79b-15ffc2c6a4f6', + SKILL_ID_BY_ADMIN: '0aec2956-cbcb-4c80-8c00-25cc02a71611', + SKILL_ID_BY_TESTER: '9ad4eb94-4029-49ff-b01a-9ac0a964dd35', + ROLE_ID_BY_ADMIN: '8607ddb3-abf6-4512-a618-c60d4771174b', + ROLE_ID_BY_TESTER: '58fffc97-db2a-48a7-9066-cfc83bbde7b5', + ORGANIZATION_ID_BY_ADMIN: 'a866fd95-c2d5-4fa8-b341-a367138c9911', + ORGANIZATION_ID_BY_TESTER: 'f1e7cf4d-e688-4037-980e-820f12c822d9', + ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN: 'b1b22eba-ba1b-4740-8f70-da607de52ce7', + ACHIEVEMENTS_PROVIDER_ID_BY_TESTER: '1ad72e52-4b44-4634-9c02-4e792c156b43', + ATTRIBUTE_GROUP_ID_BY_ADMIN: '03df695f-0b97-4fe3-ae29-17f1aa0addc4', + ATTRIBUTE_GROUP_ID_BY_TESTER: '8599dbcb-7301-46a1-ab23-7b3dfd610f26', + ATTRIBUTE_ID_BY_ADMIN: '5c22a53f-6530-4f92-b934-64cc9b05f1d0', + ATTRIBUTE_ID_BY_TESTER: 'a15f160c-5634-4af5-9967-cc4b28bdc94c', + ACHIEVEMENT_ID_BY_ADMIN: '9a771c88-1e57-4a47-bf20-a9a62c118237', + ACHIEVEMENT_ID_BY_TESTER: '6499865c-6cb6-49c1-991f-be95fb03ed56' +} diff --git a/package-lock.json b/package-lock.json index def25a5..d7d712f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,6 +30,31 @@ "js-tokens": "^4.0.0" } }, + "@dabh/diagnostics": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.2.tgz", + "integrity": "sha512-+A1YivoVDNNVCdfozHSR8v/jyuuLTMXwjWuxPFlFlUapXoGc+Gj9mDlTDDfrwl7rXCl2tNZ0kE8sIBO6YOn96Q==", + "dev": true, + "requires": { + "colorspace": "1.1.x", + "enabled": "2.0.x", + "kuler": "^2.0.0" + }, + "dependencies": { + "enabled": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz", + "integrity": "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==", + "dev": true + }, + "kuler": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz", + "integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==", + "dev": true + } + } + }, "@elastic/elasticsearch": { "version": "7.9.1", "resolved": "https://registry.npmjs.org/@elastic/elasticsearch/-/elasticsearch-7.9.1.tgz", @@ -105,15 +130,64 @@ "@hapi/hoek": "^8.3.0" } }, + "@postman/form-data": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@postman/form-data/-/form-data-3.1.1.tgz", + "integrity": "sha512-vjh8Q2a8S6UCm/KKs31XFJqEEgmbjBmpPNVV2eVav6905wyFAwaUOBGA1NPBI4ERH9MMZc6w0umFgM6WbEPMdg==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + }, + "@postman/tunnel-agent": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/@postman/tunnel-agent/-/tunnel-agent-0.6.3.tgz", + "integrity": "sha512-k57fzmAZ2PJGxfOA4SGR05ejorHbVAa/84Hxh/2nAztjNXc4ZjOm9NUIk6/Z6LCrBvJZqjRZbN8e/nROVUPVdg==", + "dev": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "@sideway/address": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.2.tgz", + "integrity": "sha512-idTz8ibqWFrPU8kMirL0CoPH/A29XOzzAzpyN3zQ4kAWnzmNfFmRaoMNN6VI8ske5M73HZyhIaW4OuSFIdM4oA==", + "dev": true, + "requires": { + "@hapi/hoek": "^9.0.0" + }, + "dependencies": { + "@hapi/hoek": { + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.2.0.tgz", + "integrity": "sha512-sqKVVVOe5ivCaXDWivIJYVSaEgdQK9ul7a4Kity5Iw7u9+wBAPbX1RMSnLLmp7O4Vzj0WOWwMAJsTL00xwaNug==", + "dev": true + } + } + }, + "@sideway/formula": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.0.tgz", + "integrity": "sha512-vHe7wZ4NOXVfkoRb8T5otiENVlT7a3IAiw7H5M2+GO+9CDgcVUUsX1zalAztCmwyOr2RUTGJdgB+ZvSVqmdHmg==", + "dev": true + }, + "@sideway/pinpoint": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz", + "integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==", + "dev": true + }, "@tootallnate/once": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==" }, "@types/body-parser": { - "version": "1.19.0", - "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.0.tgz", - "integrity": "sha512-W98JrE0j2K78swW4ukqMleo8R7h/pFETjM2DQ90MF6XK2i4LO4W3gQ71Lt4w3bfm2EvVSyWHplECvB5sK22yFQ==", + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.1.tgz", + "integrity": "sha512-a6bTJ21vFOGIkwM0kzh9Yr89ziVxq4vYH2fQ6N8AeipEzai/cFK6aGMArIkUeIdRIgpwQa+2bXiLuUJCpSf2Cg==", "requires": { "@types/connect": "*", "@types/node": "*" @@ -126,20 +200,20 @@ "dev": true }, "@types/connect": { - "version": "3.4.33", - "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.33.tgz", - "integrity": "sha512-2+FrkXY4zllzTNfJth7jOqEHC+enpLeGslEhpnTAkg21GkRrWV4SsAtqchtT4YS9/nODBU2/ZfsBY2X4J/dX7A==", + "version": "3.4.35", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", + "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", "requires": { "@types/node": "*" } }, "@types/express": { - "version": "4.17.8", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.8.tgz", - "integrity": "sha512-wLhcKh3PMlyA2cNAB9sjM1BntnhPMiM0JOBwPBqttjHev2428MLEB4AYVN+d8s2iyCVZac+o41Pflm/ZH5vLXQ==", + "version": "4.17.13", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz", + "integrity": "sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA==", "requires": { "@types/body-parser": "*", - "@types/express-serve-static-core": "*", + "@types/express-serve-static-core": "^4.17.18", "@types/qs": "*", "@types/serve-static": "*" } @@ -154,9 +228,9 @@ } }, "@types/express-serve-static-core": { - "version": "4.17.13", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.13.tgz", - "integrity": "sha512-RgDi5a4nuzam073lRGKTUIaL3eF2+H7LJvJ8eUnCI0wA6SNjXc44DCmWNiTLs/AZ7QlsFWZiw/gTG3nSQGL0fA==", + "version": "4.17.24", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.24.tgz", + "integrity": "sha512-3UJuW+Qxhzwjq3xhwXm2onQcFHn76frIYVbTu+kn24LFxI+dEhdfISDFovPB8VpEgW8oQCTpRuCe+0zJxB7NEA==", "requires": { "@types/node": "*", "@types/qs": "*", @@ -164,17 +238,17 @@ } }, "@types/express-unless": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/@types/express-unless/-/express-unless-0.5.1.tgz", - "integrity": "sha512-5fuvg7C69lemNgl0+v+CUxDYWVPSfXHhJPst4yTLcqi4zKJpORCxnDrnnilk3k0DTq/WrAUdvXFs01+vUqUZHw==", + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@types/express-unless/-/express-unless-0.5.2.tgz", + "integrity": "sha512-Q74UyYRX/zIgl1HSp9tUX2PlG8glkVm+59r7aK4KGKzC5jqKIOX6rrVLRQrzpZUQ84VukHtRoeAuon2nIssHPQ==", "requires": { "@types/express": "*" } }, "@types/mime": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@types/mime/-/mime-2.0.3.tgz", - "integrity": "sha512-Jus9s4CDbqwocc5pOAnh8ShfrnMcPHuJYzVcSUU7lrh8Ni5HuIqX3oilL86p3dlTrk0LzHRCgA/GQ7uNCw6l2Q==" + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz", + "integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==" }, "@types/node": { "version": "12.0.2", @@ -182,22 +256,22 @@ "integrity": "sha512-5tabW/i+9mhrfEOUcLDu2xBPsHJ+X5Orqy9FKpale3SjDA17j5AEpYq5vfy3oAeAHGcvANRCO3NV3d2D6q3NiA==" }, "@types/qs": { - "version": "6.9.5", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.5.tgz", - "integrity": "sha512-/JHkVHtx/REVG0VVToGRGH2+23hsYLHdyG+GrvoUGlGAd0ErauXDyvHtRI/7H7mzLm+tBCKA7pfcpkQ1lf58iQ==" + "version": "6.9.7", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", + "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==" }, "@types/range-parser": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.3.tgz", - "integrity": "sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA==" + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", + "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==" }, "@types/serve-static": { - "version": "1.13.5", - "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.5.tgz", - "integrity": "sha512-6M64P58N+OXjU432WoLLBQxbA0LRGBCRm7aAGQJ+SMC1IMl0dgRVi9EFfoDcS2a7Xogygk/eGN94CfwU9UF7UQ==", + "version": "1.13.10", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.10.tgz", + "integrity": "sha512-nCkHGI4w7ZgAdNkrEu0bv+4xNV/XDqW+DydknebMOQwkpDGx8G+HTlj7R7ABI8i8nKxVw0wtKPi1D+lPOkh4YQ==", "requires": { - "@types/express-serve-static-core": "*", - "@types/mime": "*" + "@types/mime": "^1", + "@types/node": "*" } }, "accepts": { @@ -222,17 +296,17 @@ "dev": true }, "agent-base": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.1.tgz", - "integrity": "sha512-01q25QQDwLSsyfhrKbn8yuur+JNw0H+0Y4JiGIKd3z9aYk/w/2kxD/Upc+t2ZBBSUNff50VjPsSW2YxM8QYKVg==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", "requires": { "debug": "4" }, "dependencies": { "debug": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", - "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", "requires": { "ms": "2.1.2" } @@ -465,6 +539,15 @@ "concat-map": "0.0.1" } }, + "brotli": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/brotli/-/brotli-1.3.2.tgz", + "integrity": "sha1-UlqcrU/LqWR119OI9q7LE+7VL0Y=", + "dev": true, + "requires": { + "base64-js": "^1.1.2" + } + }, "buffer": { "version": "4.9.2", "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", @@ -486,9 +569,9 @@ "integrity": "sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==" }, "bunyan": { - "version": "1.8.14", - "resolved": "https://registry.npmjs.org/bunyan/-/bunyan-1.8.14.tgz", - "integrity": "sha512-LlahJUxXzZLuw/hetUQJmRgZ1LF6+cr5TPpRj6jf327AsiIq2jhYEH4oqUUkVKTor+9w2BT3oxVwhzE5lw9tcg==", + "version": "1.8.15", + "resolved": "https://registry.npmjs.org/bunyan/-/bunyan-1.8.15.tgz", + "integrity": "sha512-0tECWShh6wUysgucJcBAoYegf3JJoZWibxdqhTm7OHPeT42qdjkZ29QCMcKwbgU1kiH+auSIasNRXMLWXafXig==", "requires": { "dtrace-provider": "~0.8", "moment": "^2.19.3", @@ -534,6 +617,12 @@ "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", "dev": true }, + "charset": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/charset/-/charset-1.0.1.tgz", + "integrity": "sha512-6dVyOOYjpfFcL1Y4qChrAoQLRHvj2ziyhcm0QJlhOcAhykL/k1kTUPbeo+87MNRTRdk2OIIsIXbuF3x2wi5EXg==", + "dev": true + }, "cli-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", @@ -543,6 +632,27 @@ "restore-cursor": "^3.1.0" } }, + "cli-progress": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/cli-progress/-/cli-progress-3.9.0.tgz", + "integrity": "sha512-g7rLWfhAo/7pF+a/STFH/xPyosaL1zgADhI0OM83hl3c7S43iGvJWEAV2QuDOnQ8i6EMBj/u4+NTd0d5L+4JfA==", + "dev": true, + "requires": { + "colors": "^1.1.2", + "string-width": "^4.2.0" + } + }, + "cli-table3": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.0.tgz", + "integrity": "sha512-gnB85c3MGC7Nm9I/FkiasNBOKjOiO1RNuXXarQms37q4QMpWdlbBgD/VnOStA2faG1dpXMv31RFApjX1/QdgWQ==", + "dev": true, + "requires": { + "colors": "^1.1.2", + "object-assign": "^4.1.0", + "string-width": "^4.2.0" + } + }, "cli-width": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", @@ -675,6 +785,12 @@ "delayed-stream": "~1.0.0" } }, + "commander": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", + "dev": true + }, "component-emitter": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", @@ -728,9 +844,9 @@ "integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==" }, "core-js": { - "version": "2.6.11", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.11.tgz", - "integrity": "sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg==" + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==" }, "core-util-is": { "version": "1.0.2", @@ -759,6 +875,12 @@ "which": "^1.2.9" } }, + "csv-parse": { + "version": "4.16.0", + "resolved": "https://registry.npmjs.org/csv-parse/-/csv-parse-4.16.0.tgz", + "integrity": "sha512-Zb4tGPANH4SW0LgC9+s9Mnequs9aqn7N3/pCqNbVjs2XhEF6yWNU2Vm4OGl1v2Go9nw8rXt87Cm2QN/o6Vpqgg==", + "dev": true + }, "dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", @@ -767,6 +889,12 @@ "assert-plus": "^1.0.0" } }, + "dbug": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/dbug/-/dbug-0.4.2.tgz", + "integrity": "sha1-MrSzEF6IYQQ6b5rHVdgOVC02WzE=", + "dev": true + }, "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -1304,6 +1432,12 @@ "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" }, + "eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", + "dev": true + }, "events": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", @@ -1367,6 +1501,12 @@ "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" }, + "faker": { + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/faker/-/faker-5.5.3.tgz", + "integrity": "sha512-wLTv2a28wjUyWkbnX7u/ABZBkUkIF2fCd73V6P2oFqEGEktDfzWx4UxrSqtPRw0xPRAcjeAOIiJWqZm3pP4u3g==", + "dev": true + }, "fast-deep-equal": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz", @@ -1411,6 +1551,18 @@ "flat-cache": "^2.0.1" } }, + "file-type": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz", + "integrity": "sha1-JXoHg4TR24CHvESdEH1SpSZyuek=", + "dev": true + }, + "filesize": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/filesize/-/filesize-6.3.0.tgz", + "integrity": "sha512-ytx0ruGpDHKWVoiui6+BY/QMNngtDQ/pJaFwfBpQif0J63+E8DLdFyqS3NkKQn7vIruUEpoGD9JUJSg7Kp+I0g==", + "dev": true + }, "finalhandler": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", @@ -1482,6 +1634,12 @@ "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", "dev": true }, + "fn.name": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz", + "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==", + "dev": true + }, "follow-redirects": { "version": "1.5.10", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz", @@ -1506,9 +1664,9 @@ "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" }, "form-data": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz", - "integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", "requires": { "asynckit": "^0.4.0", "combined-stream": "^1.0.6", @@ -1613,6 +1771,19 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==" }, + "handlebars": { + "version": "4.7.7", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", + "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", + "dev": true, + "requires": { + "minimist": "^1.2.5", + "neo-async": "^2.6.0", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4", + "wordwrap": "^1.0.0" + } + }, "har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", @@ -1649,6 +1820,23 @@ "function-bind": "^1.1.1" } }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + } + } + }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -1694,9 +1882,9 @@ }, "dependencies": { "debug": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", - "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", "requires": { "ms": "2.1.2" } @@ -1708,6 +1896,12 @@ } } }, + "http-reasons": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/http-reasons/-/http-reasons-0.1.0.tgz", + "integrity": "sha1-qVPKZwB4Zp3eFCzomUAbnW6F07Q=", + "dev": true + }, "http-signature": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", @@ -1718,6 +1912,30 @@ "sshpk": "^1.7.0" } }, + "httpntlm": { + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/httpntlm/-/httpntlm-1.7.7.tgz", + "integrity": "sha512-Pv2Rvrz8H0qv1Dne5mAdZ9JegG1uc6Vu5lwLflIY6s8RKHdZQbW39L4dYswSgqMDT0pkJILUTKjeyU0VPNRZjA==", + "dev": true, + "requires": { + "httpreq": ">=0.4.22", + "underscore": "~1.12.1" + }, + "dependencies": { + "underscore": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.12.1.tgz", + "integrity": "sha512-hEQt0+ZLDVUMhebKxL4x1BTtDY7bavVofhZ9KZ4aI26X9SRaE+Y3m83XUL1UP2jn8ynjndwCCpEHdUG+9pP1Tw==", + "dev": true + } + } + }, + "httpreq": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/httpreq/-/httpreq-0.5.2.tgz", + "integrity": "sha512-2Jm+x9WkExDOeFRrdBCBSpLPT5SokTcRHkunV3pjKmX/cx6av8zQ0WtHUMDrYb6O4hBFzNU6sxJEypvRUVYKnw==", + "dev": true + }, "https-proxy-agent": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", @@ -1728,9 +1946,9 @@ }, "dependencies": { "debug": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", - "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", "requires": { "ms": "2.1.2" } @@ -1878,6 +2096,62 @@ } } }, + "intel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/intel/-/intel-1.2.0.tgz", + "integrity": "sha1-EdEUfraz9Fgr31M3s31UFYTp5B4=", + "dev": true, + "requires": { + "chalk": "^1.1.0", + "dbug": "~0.4.2", + "stack-trace": "~0.0.9", + "strftime": "~0.10.0", + "symbol": "~0.3.1", + "utcstring": "~0.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + } + } + }, "invert-kv": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", @@ -1899,6 +2173,12 @@ "jsbi": "^3.1.1" } }, + "ip-regex": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz", + "integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=", + "dev": true + }, "ipaddr.js": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", @@ -2027,6 +2307,12 @@ "topo": "3.x.x" } }, + "js-sha512": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/js-sha512/-/js-sha512-0.8.0.tgz", + "integrity": "sha512-PWsmefG6Jkodqt+ePTvBZCSMFgN7Clckjd0O7su3I0+BW2QWUTJNzjktHsztGLhncP2h8mcF9V9Y2Ha59pAViQ==", + "dev": true + }, "js-string-escape": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/js-string-escape/-/js-string-escape-1.0.1.tgz", @@ -2110,9 +2396,9 @@ }, "dependencies": { "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" } } }, @@ -2148,33 +2434,54 @@ } }, "jwks-rsa": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/jwks-rsa/-/jwks-rsa-1.10.1.tgz", - "integrity": "sha512-UmjOsATVu7eQr17wbBCS+BSoz5LFtl57PtNXHbHFeT1WKomHykCHtn7c8inWVI7tpnsy6CZ1KOMJTgipFwXPig==", + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/jwks-rsa/-/jwks-rsa-1.12.3.tgz", + "integrity": "sha512-cFipFDeYYaO9FhhYJcZWX/IyZgc0+g316rcHnDpT2dNRNIE/lMOmWKKqp09TkJoYlNFzrEVODsR4GgXJMgWhnA==", "requires": { "@types/express-jwt": "0.0.42", - "axios": "^0.19.2", + "axios": "^0.21.1", "debug": "^4.1.0", "http-proxy-agent": "^4.0.1", "https-proxy-agent": "^5.0.0", "jsonwebtoken": "^8.5.1", "limiter": "^1.1.5", "lru-memoizer": "^2.1.2", - "ms": "^2.1.2" + "ms": "^2.1.2", + "proxy-from-env": "^1.1.0" }, "dependencies": { + "axios": { + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", + "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", + "requires": { + "follow-redirects": "^1.10.0" + } + }, "debug": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", - "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", "requires": { "ms": "2.1.2" + }, + "dependencies": { + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } } }, + "follow-redirects": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.1.tgz", + "integrity": "sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg==" + }, "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" } } }, @@ -2218,6 +2525,12 @@ "resolved": "https://registry.npmjs.org/limiter/-/limiter-1.1.5.tgz", "integrity": "sha512-FWWMIEOxz3GwUI4Ts/IvgVy6LPvoMPgjMdQ185nN6psJyBJ4yOpzqm695/h5umdLJg2vW3GR5iG11MAkR2AzJA==" }, + "liquid-json": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/liquid-json/-/liquid-json-0.3.1.tgz", + "integrity": "sha1-kVWhgTbYprJhXl8W+aJEira1Duo=", + "dev": true + }, "load-json-file": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", @@ -2328,9 +2641,9 @@ } }, "lru-memoizer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/lru-memoizer/-/lru-memoizer-2.1.2.tgz", - "integrity": "sha512-N5L5xlnVcbIinNn/TJ17vHBZwBMt9t7aJDz2n97moWubjNl6VO9Ao2XuAGBBddkYdjrwR9HfzXbT6NfMZXAZ/A==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/lru-memoizer/-/lru-memoizer-2.1.4.tgz", + "integrity": "sha512-IXAq50s4qwrOBrXJklY+KhgZF+5y98PDaNo0gi/v2KQBFLyWr+JyFvijZXkGKjQj/h9c0OwoE+JZbwUXce76hQ==", "requires": { "lodash.clonedeep": "^4.5.0", "lru-cache": "~4.0.0" @@ -2366,6 +2679,15 @@ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==" }, + "mime-format": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mime-format/-/mime-format-2.0.1.tgz", + "integrity": "sha512-XxU3ngPbEnrYnNbIX+lYSaYg0M01v6p2ntd2YaFksTu0vayaw5OJvbdRyWs07EYRlLED5qadUZ+xo+XhOvFhwg==", + "dev": true, + "requires": { + "charset": "^1.0.0" + } + }, "mime-types": { "version": "2.1.27", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", @@ -2464,6 +2786,161 @@ "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==" }, + "neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, + "newman": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/newman/-/newman-5.2.4.tgz", + "integrity": "sha512-RFo3Bteh8CMDD4/eld+ItQ1trrtLN9Mlwk/6mnk2/lBKG08U+ysREwk8Jy74X+a0vmpVCljlGk5MifdcCdkkRg==", + "dev": true, + "requires": { + "async": "3.2.0", + "chardet": "1.3.0", + "cli-progress": "3.9.0", + "cli-table3": "0.6.0", + "colors": "1.4.0", + "commander": "7.2.0", + "csv-parse": "4.16.0", + "eventemitter3": "4.0.7", + "filesize": "6.3.0", + "lodash": "4.17.21", + "mkdirp": "1.0.4", + "postman-collection": "4.0.0", + "postman-collection-transformer": "4.1.2", + "postman-request": "2.88.1-postman.30", + "postman-runtime": "7.28.2", + "pretty-ms": "7.0.1", + "semver": "7.3.5", + "serialised-error": "1.1.3", + "tough-cookie": "3.0.1", + "word-wrap": "1.2.3", + "xmlbuilder": "15.1.1" + }, + "dependencies": { + "async": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz", + "integrity": "sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw==", + "dev": true + }, + "chardet": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-1.3.0.tgz", + "integrity": "sha512-cyTQGGptIjIT+CMGT5J/0l9c6Fb+565GCFjjeUTKxUO7w3oR+FcNCMEKTn5xtVKaLFmladN7QF68IiQsv5Fbdw==", + "dev": true + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "tough-cookie": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-3.0.1.tgz", + "integrity": "sha512-yQyJ0u4pZsv9D4clxO69OEjLWYw+jbgspjTue4lTQZLfV0c5l1VmK2y1JK8E9ahdpltPOaAThPcp5nKPUgSnsg==", + "dev": true, + "requires": { + "ip-regex": "^2.1.0", + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + }, + "xmlbuilder": { + "version": "15.1.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-15.1.1.tgz", + "integrity": "sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg==", + "dev": true + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } + } + }, + "newman-reporter-html": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/newman-reporter-html/-/newman-reporter-html-1.0.5.tgz", + "integrity": "sha512-Kz8ejzJqDaasyqNuP8F7bBYzsts7JP3wBfdRQDOYPCUchVQF63KsbxtxbGadyzOeXcZsXs6YT3pe4FFlN51jcw==", + "dev": true, + "requires": { + "filesize": "6.0.1", + "handlebars": "4.5.3", + "lodash": "4.17.15", + "pretty-ms": "5.1.0" + }, + "dependencies": { + "filesize": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/filesize/-/filesize-6.0.1.tgz", + "integrity": "sha512-u4AYWPgbI5GBhs6id1KdImZWn5yfyFrrQ8OWZdN7ZMfA8Bf4HcO0BGo9bmUIEV8yrp8I1xVfJ/dn90GtFNNJcg==", + "dev": true + }, + "handlebars": { + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.5.3.tgz", + "integrity": "sha512-3yPecJoJHK/4c6aZhSvxOyG4vJKDshV36VHp0iVCDVh7o9w2vwi3NSnL2MMPj3YdduqaBcu7cGbggJQM0br9xA==", + "dev": true, + "requires": { + "neo-async": "^2.6.0", + "optimist": "^0.6.1", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4" + } + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + }, + "pretty-ms": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-5.1.0.tgz", + "integrity": "sha512-4gaK1skD2gwscCfkswYQRmddUb2GJZtzDGRjHWadVHtK/DIKFufa12MvES6/xu1tVbUYeia5bmLcwJtZJQUqnw==", + "dev": true, + "requires": { + "parse-ms": "^2.1.0" + } + } + } + }, "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", @@ -2478,6 +2955,12 @@ "clone": "2.x" } }, + "node-oauth1": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/node-oauth1/-/node-oauth1-1.3.0.tgz", + "integrity": "sha512-0yggixNfrA1KcBwvh/Hy2xAS1Wfs9dcg6TdFf2zN7gilcAigMdrtZ4ybrBSXBgLvGDw9V1p2MRnGBMq7XjTWLg==", + "dev": true + }, "normalize-package-data": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", @@ -2504,6 +2987,12 @@ "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" }, + "object-hash": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-1.3.1.tgz", + "integrity": "sha512-OSuu/pU4ENM9kmREg0BdNrUDIl1heYa4mBZacJc+vVWz4GtAwu7jO8s4AIt2aGRUTqxykpWzI3Oqnsm13tTMDA==", + "dev": true + }, "object-inspect": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", @@ -2594,6 +3083,30 @@ "mimic-fn": "^2.1.0" } }, + "optimist": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "dev": true, + "requires": { + "minimist": "~0.0.1", + "wordwrap": "~0.0.2" + }, + "dependencies": { + "minimist": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", + "dev": true + }, + "wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", + "dev": true + } + } + }, "optionator": { "version": "0.8.3", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", @@ -2668,6 +3181,12 @@ "error-ex": "^1.2.0" } }, + "parse-ms": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-2.1.0.tgz", + "integrity": "sha512-kHt7kzLoS9VBZfUsiKjv43mr91ea+U05EyKkEtqp7vNbHxmaVuEqN7XxeEVnGrMtYOAxGrDElSi96K7EgO1zCA==", + "dev": true + }, "parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -3006,6 +3525,312 @@ "xtend": "^4.0.0" } }, + "postman-collection": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postman-collection/-/postman-collection-4.0.0.tgz", + "integrity": "sha512-vDrXG/dclSu6RMqPqBz4ZqoQBwcj/a80sJYsQZmzWJ6dWgXiudPhwu6Vm3C1Hy7zX5W8A6am1Z6vb/TB4eyURA==", + "dev": true, + "requires": { + "faker": "5.5.3", + "file-type": "3.9.0", + "http-reasons": "0.1.0", + "iconv-lite": "0.6.3", + "liquid-json": "0.3.1", + "lodash": "4.17.21", + "mime-format": "2.0.1", + "mime-types": "2.1.31", + "postman-url-encoder": "3.0.1", + "semver": "7.3.5", + "uuid": "8.3.2" + }, + "dependencies": { + "iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + } + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "mime-db": { + "version": "1.48.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.48.0.tgz", + "integrity": "sha512-FM3QwxV+TnZYQ2aRqhlKBMHxk10lTbMt3bBkMAp54ddrNeVSfcQYOOKuGuy3Ddrm38I04If834fOUSq1yzslJQ==", + "dev": true + }, + "mime-types": { + "version": "2.1.31", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.31.tgz", + "integrity": "sha512-XGZnNzm3QvgKxa8dpzyhFTHmpP3l5YNusmne07VUOXxou9CqUqYa/HBy124RqtVh/O2pECas/MOcsDgpilPOPg==", + "dev": true, + "requires": { + "mime-db": "1.48.0" + } + }, + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } + } + }, + "postman-collection-transformer": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/postman-collection-transformer/-/postman-collection-transformer-4.1.2.tgz", + "integrity": "sha512-3mRM18QALmasbza1LznlwQkymAYM0H79VY1LkR1BUAe8B7hwELofltMNSmpDn27MPGf0w9rPJJOcRSI3MWCCZg==", + "dev": true, + "requires": { + "commander": "7.2.0", + "inherits": "2.0.4", + "intel": "1.2.0", + "lodash": "4.17.21", + "semver": "7.3.5", + "strip-json-comments": "3.1.1" + }, + "dependencies": { + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } + } + }, + "postman-request": { + "version": "2.88.1-postman.30", + "resolved": "https://registry.npmjs.org/postman-request/-/postman-request-2.88.1-postman.30.tgz", + "integrity": "sha512-zsGvs8OgNeno1Q44zTgGP2IL7kCqUy4DAtl8/ms0AQpqkIoysrxzR/Zg4kM1Kz8/duBvwxt8NN717wB7SMNm6w==", + "dev": true, + "requires": { + "@postman/form-data": "~3.1.1", + "@postman/tunnel-agent": "^0.6.3", + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "brotli": "~1.3.2", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "har-validator": "~5.1.3", + "http-signature": "~1.3.1", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "stream-length": "^1.0.2", + "tough-cookie": "~2.5.0", + "uuid": "^3.3.2" + }, + "dependencies": { + "http-signature": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.3.5.tgz", + "integrity": "sha512-NwoTQYSJoFt34jSBbwzDHDofoA61NGXzu6wXh95o1Ry62EnmKjXb/nR/RknLeZ3G/uGwrlKNY2z7uPt+Cdl7Tw==", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.14.1" + } + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true + }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true + } + } + }, + "postman-runtime": { + "version": "7.28.2", + "resolved": "https://registry.npmjs.org/postman-runtime/-/postman-runtime-7.28.2.tgz", + "integrity": "sha512-YjcJwipcOfDFMOTM1/z9t/UB1zhF3ONZuffGhaP+FMG9aDAH2J1moO+PuUbLIcddggWR9ljtDk+O3TBxBmmvtQ==", + "dev": true, + "requires": { + "async": "2.6.3", + "aws4": "1.11.0", + "eventemitter3": "4.0.7", + "handlebars": "4.7.7", + "http-reasons": "0.1.0", + "httpntlm": "1.7.7", + "inherits": "2.0.4", + "js-sha512": "0.8.0", + "lodash": "4.17.21", + "node-oauth1": "1.3.0", + "performance-now": "2.1.0", + "postman-collection": "4.0.0", + "postman-request": "2.88.1-postman.30", + "postman-sandbox": "4.0.3", + "postman-url-encoder": "3.0.1", + "resolve-from": "5.0.0", + "serialised-error": "1.1.3", + "tough-cookie": "3.0.1", + "uuid": "3.4.0" + }, + "dependencies": { + "aws4": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", + "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", + "dev": true + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + }, + "tough-cookie": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-3.0.1.tgz", + "integrity": "sha512-yQyJ0u4pZsv9D4clxO69OEjLWYw+jbgspjTue4lTQZLfV0c5l1VmK2y1JK8E9ahdpltPOaAThPcp5nKPUgSnsg==", + "dev": true, + "requires": { + "ip-regex": "^2.1.0", + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true + } + } + }, + "postman-sandbox": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/postman-sandbox/-/postman-sandbox-4.0.3.tgz", + "integrity": "sha512-FCPJsiyxCKU0Rtyz9SnXXCzR54LUlln8u913JHyt0SkqMEbM/Y0qe+6m8zRt/SPxx+rzAZOqWfrCk5oiDyuTsg==", + "dev": true, + "requires": { + "lodash": "4.17.21", + "teleport-javascript": "1.0.0", + "uvm": "2.0.2" + }, + "dependencies": { + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + } + } + }, + "postman-url-encoder": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/postman-url-encoder/-/postman-url-encoder-3.0.1.tgz", + "integrity": "sha512-dMPqXnkDlstM2Eya+Gw4MIGWEan8TzldDcUKZIhZUsJ/G5JjubfQPhFhVWKzuATDMvwvrWbSjF+8VmAvbu6giw==", + "dev": true, + "requires": { + "punycode": "^2.1.1" + }, + "dependencies": { + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + } + } + }, "precond": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/precond/-/precond-0.2.3.tgz", @@ -3017,6 +3842,15 @@ "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "dev": true }, + "pretty-ms": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-7.0.1.tgz", + "integrity": "sha512-973driJZvxiGOQ5ONsFhOF/DtzPMOMtgC11kCpUrPGMTgqp2q/1gwzCquocrN33is0VZ5GFHXZYMM9l6h67v2Q==", + "dev": true, + "requires": { + "parse-ms": "^2.1.0" + } + }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -3048,6 +3882,11 @@ "ipaddr.js": "1.9.1" } }, + "proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "pseudomap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", @@ -3201,16 +4040,6 @@ "uuid": "^3.3.2" }, "dependencies": { - "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, "qs": { "version": "6.5.2", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", @@ -3413,6 +4242,31 @@ "resolved": "https://registry.npmjs.org/sequelize-pool/-/sequelize-pool-6.1.0.tgz", "integrity": "sha512-4YwEw3ZgK/tY/so+GfnSgXkdwIJJ1I32uZJztIEgZeAO6HMgj64OzySbWLgxj+tXhZCJnzRfkY9gINw8Ft8ZMg==" }, + "serialised-error": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/serialised-error/-/serialised-error-1.1.3.tgz", + "integrity": "sha512-vybp3GItaR1ZtO2nxZZo8eOo7fnVaNtP3XE2vJKgzkKR2bagCkdJ1EpYYhEMd3qu/80DwQk9KjsNSxE3fXWq0g==", + "dev": true, + "requires": { + "object-hash": "^1.1.2", + "stack-trace": "0.0.9", + "uuid": "^3.0.0" + }, + "dependencies": { + "stack-trace": { + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.9.tgz", + "integrity": "sha1-qPbq7KkGdMMz58Q5U/J1tFFRBpU=", + "dev": true + }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true + } + } + }, "serve-static": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", @@ -3482,6 +4336,12 @@ } } }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, "spdx-correct": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", @@ -3578,6 +4438,29 @@ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" }, + "stream-length": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/stream-length/-/stream-length-1.0.2.tgz", + "integrity": "sha1-gnfzy+5JpNqrz9tOL0qbXp8snwA=", + "dev": true, + "requires": { + "bluebird": "^2.6.2" + }, + "dependencies": { + "bluebird": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.11.0.tgz", + "integrity": "sha1-U0uQM8AiyVecVro7Plpcqvu2UOE=", + "dev": true + } + } + }, + "strftime": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/strftime/-/strftime-0.10.0.tgz", + "integrity": "sha1-s/D6QZKVICpaKJ9ta+n0kJphcZM=", + "dev": true + }, "string-width": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", @@ -3686,60 +4569,6 @@ "integrity": "sha512-e6/d0eBu7gHtdCqFt0xJr642LdToM5/cN4Qb9DbHjVx1CP5RyeM+zH7pbecEmDv/lBqb0QH+6Uqq75rxFPkM0w==", "dev": true }, - "superagent": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/superagent/-/superagent-3.8.3.tgz", - "integrity": "sha512-GLQtLMCoEIK4eDv6OGtkOoSMt3D+oq0y3dsxMuYuDvaNUvuT8eFBuLmfR0iYYzHC1e8hpzC6ZsxbuP6DIalMFA==", - "requires": { - "component-emitter": "^1.2.0", - "cookiejar": "^2.1.0", - "debug": "^3.1.0", - "extend": "^3.0.0", - "form-data": "^2.3.1", - "formidable": "^1.2.0", - "methods": "^1.1.1", - "mime": "^1.4.1", - "qs": "^6.5.1", - "readable-stream": "^2.3.5" - }, - "dependencies": { - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "requires": { - "ms": "^2.1.1" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, "supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -3762,6 +4591,12 @@ "swagger-ui-dist": "^3.18.1" } }, + "symbol": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/symbol/-/symbol-0.3.1.tgz", + "integrity": "sha1-tvmpANSWpX8CQI8iGYwQndoGMEE=", + "dev": true + }, "table": { "version": "5.4.6", "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", @@ -3799,6 +4634,181 @@ } } }, + "tc-api-testing-lib": { + "version": "git+https://github.com/mfrank37/api-automated-testing.git#7efd244fe1ca3abb4a9ae0ff786a1aa07ac1d9c5", + "from": "git+https://github.com/mfrank37/api-automated-testing.git", + "dev": true, + "requires": { + "axios": "^0.21.1", + "config": "^3.3.6", + "handlebars": "^4.7.7", + "joi": "^17.4.0", + "lodash": "^4.17.21", + "newman": "^5.2.3", + "newman-reporter-html": "^1.0.5", + "tc-core-library-js": "github:appirio-tech/tc-core-library-js#df0b36c51cf80918194cbff777214b3c0cf5a151", + "winston": "^3.3.3" + }, + "dependencies": { + "@hapi/hoek": { + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.2.0.tgz", + "integrity": "sha512-sqKVVVOe5ivCaXDWivIJYVSaEgdQK9ul7a4Kity5Iw7u9+wBAPbX1RMSnLLmp7O4Vzj0WOWwMAJsTL00xwaNug==", + "dev": true + }, + "@hapi/topo": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.1.0.tgz", + "integrity": "sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==", + "dev": true, + "requires": { + "@hapi/hoek": "^9.0.0" + } + }, + "async": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz", + "integrity": "sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw==", + "dev": true + }, + "axios": { + "version": "0.21.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", + "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", + "dev": true, + "requires": { + "follow-redirects": "^1.10.0" + } + }, + "config": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/config/-/config-3.3.6.tgz", + "integrity": "sha512-Hj5916C5HFawjYJat1epbyY2PlAgLpBtDUlr0MxGLgo3p5+7kylyvnRY18PqJHgnNWXcdd0eWDemT7eYWuFgwg==", + "dev": true, + "requires": { + "json5": "^2.1.1" + } + }, + "fecha": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.1.tgz", + "integrity": "sha512-MMMQ0ludy/nBs1/o0zVOiKTpG7qMbonKUzjJgQFEuvq6INZ1OraKPRAWkBq5vlKLOUMpmNYG1JoN3oDPUQ9m3Q==", + "dev": true + }, + "follow-redirects": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.1.tgz", + "integrity": "sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg==", + "dev": true + }, + "is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true + }, + "joi": { + "version": "17.4.1", + "resolved": "https://registry.npmjs.org/joi/-/joi-17.4.1.tgz", + "integrity": "sha512-gDPOwQ5sr+BUxXuPDGrC1pSNcVR/yGGcTI0aCnjYxZEa3za60K/iCQ+OFIkEHWZGVCUcUlXlFKvMmrlmxrG6UQ==", + "dev": true, + "requires": { + "@hapi/hoek": "^9.0.0", + "@hapi/topo": "^5.0.0", + "@sideway/address": "^4.1.0", + "@sideway/formula": "^3.0.0", + "@sideway/pinpoint": "^2.0.0" + } + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "logform": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/logform/-/logform-2.2.0.tgz", + "integrity": "sha512-N0qPlqfypFx7UHNn4B3lzS/b0uLqt2hmuoa+PpuXNYgozdJYAyauF5Ky0BWVjrxDlMWiT3qN4zPq3vVAfZy7Yg==", + "dev": true, + "requires": { + "colors": "^1.2.1", + "fast-safe-stringify": "^2.0.4", + "fecha": "^4.2.0", + "ms": "^2.1.1", + "triple-beam": "^1.3.0" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "one-time": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz", + "integrity": "sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==", + "dev": true, + "requires": { + "fn.name": "1.x.x" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "winston": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/winston/-/winston-3.3.3.tgz", + "integrity": "sha512-oEXTISQnC8VlSAKf1KYSSd7J6IWuRPQqDdo8eoRNaYKLvwSb5+79Z3Yi1lrl6KDpU6/VWaxpakDAtb1oQ4n9aw==", + "dev": true, + "requires": { + "@dabh/diagnostics": "^2.0.2", + "async": "^3.1.0", + "is-stream": "^2.0.0", + "logform": "^2.2.0", + "one-time": "^1.0.0", + "readable-stream": "^3.4.0", + "stack-trace": "0.0.x", + "triple-beam": "^1.3.0", + "winston-transport": "^4.4.0" + } + }, + "winston-transport": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.4.0.tgz", + "integrity": "sha512-Lc7/p3GtqtqPBYYtS6KCN3c77/2QCev51DvcJKbkFPQNoj1sinkGwLGFDxkXY9J6p9+EPnYs+D90uwbnaiURTw==", + "dev": true, + "requires": { + "readable-stream": "^2.3.7", + "triple-beam": "^1.2.0" + }, + "dependencies": { + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + } + } + } + } + }, "tc-bus-api-wrapper": { "version": "github:topcoder-platform/tc-bus-api-wrapper#f8cbd335a0e0b4d6edd7cae859473593271fd97f", "from": "github:topcoder-platform/tc-bus-api-wrapper", @@ -3806,7 +4816,71 @@ "joi": "^13.4.0", "lodash": "^4.17.15", "superagent": "^3.8.3", - "tc-core-library-js": "github:appirio-tech/tc-core-library-js#v2.6.4" + "tc-core-library-js": "github:appirio-tech/tc-core-library-js#df0b36c51cf80918194cbff777214b3c0cf5a151" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "requires": { + "ms": "^2.1.1" + } + }, + "form-data": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz", + "integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "superagent": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-3.8.3.tgz", + "integrity": "sha512-GLQtLMCoEIK4eDv6OGtkOoSMt3D+oq0y3dsxMuYuDvaNUvuT8eFBuLmfR0iYYzHC1e8hpzC6ZsxbuP6DIalMFA==", + "requires": { + "component-emitter": "^1.2.0", + "cookiejar": "^2.1.0", + "debug": "^3.1.0", + "extend": "^3.0.0", + "form-data": "^2.3.1", + "formidable": "^1.2.0", + "methods": "^1.1.1", + "mime": "^1.4.1", + "qs": "^6.5.1", + "readable-stream": "^2.3.5" + } + } } }, "tc-core-library-js": { @@ -3823,6 +4897,12 @@ "request": "^2.88.0" } }, + "teleport-javascript": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/teleport-javascript/-/teleport-javascript-1.0.0.tgz", + "integrity": "sha512-j1llvWVFyEn/6XIFDfX5LAU43DXe0GCt3NfXDwJ8XpRRMkS+i50SAkonAONBy+vxwPFBd50MFU8a2uj8R/ccLg==", + "dev": true + }, "text-hex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", @@ -3938,6 +5018,13 @@ "mime-types": "~2.1.24" } }, + "uglify-js": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.14.1.tgz", + "integrity": "sha512-JhS3hmcVaXlp/xSo3PKY5R0JqKs5M3IV+exdLHW99qKvKivPO4Z8qbej6mte17SOPqAOVMjt/XGgWacnFSzM3g==", + "dev": true, + "optional": true + }, "umzug": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/umzug/-/umzug-2.3.0.tgz", @@ -3986,6 +5073,12 @@ "querystring": "0.2.0" } }, + "utcstring": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/utcstring/-/utcstring-0.1.0.tgz", + "integrity": "sha1-Qw/VEKt/yVtdWRDJAteYgMIIQ2s=", + "dev": true + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -4001,6 +5094,23 @@ "resolved": "https://registry.npmjs.org/uuid/-/uuid-7.0.3.tgz", "integrity": "sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg==" }, + "uvm": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/uvm/-/uvm-2.0.2.tgz", + "integrity": "sha512-Ra+aPiS5GXAbwXmyNExqdS42sTqmmx4XWEDF8uJlsTfOkKf9Rd9xNgav1Yckv4HfVEZg4iOFODWHFYuJ+9Fzfg==", + "dev": true, + "requires": { + "flatted": "3.1.1" + }, + "dependencies": { + "flatted": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz", + "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==", + "dev": true + } + } + }, "v8-compile-cache": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz", @@ -4118,6 +5228,12 @@ "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", "dev": true }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, "wrap-ansi": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", diff --git a/package.json b/package.json index 4c8d737..5b852bd 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,10 @@ "migrations": "node scripts/db/migrations.js", "insert-data": "node scripts/db/insert-data.js", "migrate-qldb-to-pg": "node scripts/db/migrateQldbToPg.js", - "import-s3-data": "node scripts/db/importS3ToQldb.js" + "import-s3-data": "node scripts/db/importS3ToQldb.js", + "insert-postman-data": "node test/postman/insert-postman-data.js", + "test:newman": "NODE_ENV=test node test/postman/newman.js", + "test:newman:clear": "NODE_ENV=test node test/postman/clearTestData.js" }, "repository": { "type": "git", @@ -47,7 +50,8 @@ "winston": "^3.2.1" }, "devDependencies": { - "standard": "^14.3.0" + "standard": "^14.3.0", + "tc-api-testing-lib": "git+https://github.com/mfrank37/api-automated-testing.git" }, "engines": { "node": "12.x" diff --git a/scripts/db/migrations.js b/scripts/db/migrations.js index baf1d45..359597f 100644 --- a/scripts/db/migrations.js +++ b/scripts/db/migrations.js @@ -1,7 +1,6 @@ const sequelize = require('../../src/models/index') const path = require('path') const Umzug = require('umzug') -const { createDb } = require('../../src/common/db-helper') function getUmzug () { return new Umzug({ diff --git a/src/modules/cleanup/controller.js b/src/modules/cleanup/controller.js new file mode 100644 index 0000000..be3c70d --- /dev/null +++ b/src/modules/cleanup/controller.js @@ -0,0 +1,19 @@ +/** + * the skillsProvider controller + */ + +const service = require('./service') + +/** + * Get all resources of a challenge + * @param {Object} req the request + * @param {Object} res the response + */ +async function cleanUpTestData (req, res) { + await service.cleanUpTestData() + res.sendStatus(200) +} + +module.exports = { + cleanUpTestData +} diff --git a/src/modules/cleanup/route.js b/src/modules/cleanup/route.js new file mode 100644 index 0000000..59aadbe --- /dev/null +++ b/src/modules/cleanup/route.js @@ -0,0 +1,16 @@ +/** + * the skillsProvider routes + */ + +const Controller = require('./controller') +const consts = require('../../consts') +module.exports = { + '/ubahn/internal/jobs/clean': { + post: { + method: Controller.cleanUpTestData, + auth: 'jwt', + access: [...consts.AdminUser, consts.UserRoles.ubahn], + scopes: ['all:skillsProvider'] + } + } +} diff --git a/src/modules/cleanup/service.js b/src/modules/cleanup/service.js new file mode 100644 index 0000000..2d2c37c --- /dev/null +++ b/src/modules/cleanup/service.js @@ -0,0 +1,127 @@ +/** + * This service provides operations to clean up the environment for running automated tests. + */ + +const logger = require('../../common/logger') +const config = require('config') +const serviceHelper = require('../../common/service-helper') + +const sequelize = require('../../models/index') +const { Op } = require('sequelize') +const models = sequelize.models +const UsersSkill = models.UsersSkill +const UsersRole = models.UsersRole +const UserAttribute = models.UserAttribute +const Skill = models.Skill +const Role = models.Role +const OrganizationSkillsProvider = models.OrganizationSkillsProvider +const SkillsProvider = models.SkillsProvider +const ExternalProfile = models.ExternalProfile +const Attribute = models.Attribute +const AttributeGroup = models.AttributeGroup +const Organization = models.Organization +const Achievement = models.Achievement +const AchievementsProvider = models.AchievementsProvider +const User = models.User +const searchTerm = { [Op.like]: config.AUTOMATED_TESTING_NAME_PREFIX + '%' } + +logger.info('Clear the Postman test data.') + +/** + * Delete the Resource from the ES by the given id + * @param id the resource id + * @returns {Promise} + */ +const deleteFromESById = async (id, resource) => { + await serviceHelper.deleteRecordFromEs(id, undefined, resource) +} + +/** + * Delete the records from the table and ES which matches the filter. + * @param model the model + * @param modelName the name of the model + * @param field the field name + * @param t the transaction + * @returns {Promise} + */ +const deleteFromTable = async (model, modelName, field, t) => { + const filter = {} + filter[field] = searchTerm + const records = await model.findAll({ + where: filter + }) + for (const r of records) { + const id = r.id + logger.info(`Delete ${modelName} with ID ${id} from DB and ES`) + await model.destroy({ where: { id: id } }, { transaction: t }) + await deleteFromESById(id, serviceHelper.getResource(modelName)) + } +} + +/** + * Delete the record from the table and ES by the given field. + * @param model the model + * @param modelName the model name + * @param fieldName the field name + * @param fieldValue the field value + * @param t the transaction + * @returns {Promise} + */ +const deleteByField = async (model, modelName, fieldName, fieldValue, t) => { + const filter = {} + filter[fieldName] = { [Op.eq]: fieldValue } + const records = await model.findAll({ + where: filter + }) + for (const r of records) { + const id = r.id + logger.info(`Delete ${modelName} with ID ${id} from DB and ES`) + await model.destroy({ where: { id: id } }, { transaction: t }) + await deleteFromESById(id, serviceHelper.getResource(modelName)) + } +} + +/** + * Clear the postman test data. The main function of this class. + * @returns {Promise} + */ +const cleanUpTestData = async () => { + logger.info('clear the test data from postman test!') + await sequelize.transaction(async (t) => { + // check User and its related records + let records = await User.findAll({ where: { handle: searchTerm } }) + for (const r of records) { + const userId = r.id + await deleteByField(UsersSkill, 'UsersSkill', 'userId', userId, t) + await deleteByField(UsersRole, 'UsersRole', 'userId', userId, t) + await deleteByField(UserAttribute, 'UserAttribute', 'userId', userId, t) + await deleteByField(Achievement, 'Achievement', 'userId', userId, t) + await deleteByField(ExternalProfile, 'ExternalProfile', 'userId', userId, t) + await deleteByField(User, 'User', 'id', userId, t) + } + // delete all from AchievementsProvider + await deleteFromTable(AchievementsProvider, 'AchievementsProvider', 'name', t) + // delete all from Attribute + await deleteFromTable(Attribute, 'Attribute', 'name', t) + // delete all from AttributeGroup + await deleteFromTable(AttributeGroup, 'AttributeGroup', 'name', t) + // check SkillsProvider and its related records + records = await SkillsProvider.findAll({ where: { name: searchTerm } }) + for (const r of records) { + const skillProviderId = r.id + await deleteByField(OrganizationSkillsProvider, 'OrganizationSkillsProvider', 'skillProviderId', skillProviderId, t) + await deleteByField(Skill, 'Skill', 'skillProviderId', skillProviderId, t) + await deleteByField(SkillsProvider, 'SkillsProvider', 'id', skillProviderId, t) + } + // delete all from Organization + await deleteFromTable(Organization, 'Organization', 'name', t) + // delete all from Role + await deleteFromTable(Role, 'Role', 'name', t) + }) +} + +module.exports = { + cleanUpTestData +} + +logger.buildService(module.exports) diff --git a/test/postman/README.md b/test/postman/README.md new file mode 100644 index 0000000..1018d7a --- /dev/null +++ b/test/postman/README.md @@ -0,0 +1,23 @@ +# Automated testing using Postman + Newman +## Configurations + +- All configurations are set in [/config/test.js](../../config/test.js). +- All test data is set in [/test/postman/testData](testData/). + +## Running the tests locally + +- Follow the steps from the [Readme](../../ReadMe.md) + +## Running the tests on CircleCI + +- With every commit in the `develop` branch, and after the API is deployed on the development environment, a `Run-Newman-Test` job is created on CircleCI. +- You need to approve this step in order to trigger the test execution. +- The progress as well as the results can be monitored within CircleCI and the final result (pass/fail) will also be visible on the repository page on Github. +- If you simply want to trigger the tests, you can either rerun the test workflow from within CircleCI or push an empty commit to trigger a new deployment. + +## Next Step - Running the tests on CircleCI Master + +1. `npm run delete-data` (You need to drop the `SequelizeMeta` table manually.) +2. `npm run migrations up` to create tables +3. `npm run insert-postman-data` to insert the testing data for postman +4. `npm run migrate-db-to-es` to index the db data for the ES \ No newline at end of file diff --git a/test/postman/Ubahn-api.postman_collection.json b/test/postman/Ubahn-api.postman_collection.json new file mode 100644 index 0000000..4674166 --- /dev/null +++ b/test/postman/Ubahn-api.postman_collection.json @@ -0,0 +1,22577 @@ +{ + "info": { + "_postman_id": "98169e02-9e6d-4752-93d6-7408ce504a23", + "name": "Ubahn-api", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" + }, + "item": [ + { + "name": "users", + "item": [ + { + "name": "search users", + "item": [ + { + "name": "search users with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.json()", + " pm.expect(response.length).to.gte(0)", + " const iterationData = pm.iterationData", + " if (iterationData.get('idLabel')) {", + " const idLabel = iterationData.get('idLabel')", + " pm.environment.set(idLabel, response[response.length - 1].id)", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer {{admin_token}}", + "type": "text" + } + ], + "url": { + "raw": "{{URL}}/users?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search users with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.json()", + " pm.expect(response.length).to.gte(0)", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/users?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search users with invalid parameters", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/users?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search users with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/users", + "host": [ + "{{URL}}" + ], + "path": [ + "users" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "head users", + "item": [ + { + "name": "head users with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/users?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head users with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/users?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head users with invalid parameters", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/users?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head users with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/users", + "host": [ + "{{URL}}" + ], + "path": [ + "users" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "create user", + "item": [ + { + "name": "create user by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " pm.expect(response.handle).to.eq(iterationData.get('handle'))", + " pm.expect(response.firstName).to.eq(iterationData.get('firstName'))", + " pm.expect(response.lastName).to.eq(iterationData.get('lastName'))", + " pm.expect(response.createdBy).to.not.eq(null)", + " pm.expect(response.updatedBy).to.eq(null)", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"handle\":\"{{handle}}\",\n \"firstName\": \"{{firstName}}\",\n \"lastName\": \"{{lastName}}\"\n}" + }, + "url": { + "raw": "{{URL}}/users", + "host": [ + "{{URL}}" + ], + "path": [ + "users" + ] + } + }, + "response": [] + }, + { + "name": "create user by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " pm.expect(response.handle).to.eq(iterationData.get('handle'))", + " pm.expect(response.firstName).to.eq(iterationData.get('firstName'))", + " pm.expect(response.lastName).to.eq(iterationData.get('lastName'))", + " pm.expect(response.createdBy).to.not.eq(null)", + " pm.expect(response.updatedBy).to.eq(null)", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"handle\":\"{{handle}}\",\n \"firstName\": \"{{firstName}}\",\n \"lastName\": \"{{lastName}}\"\n}" + }, + "url": { + "raw": "{{URL}}/users", + "host": [ + "{{URL}}" + ], + "path": [ + "users" + ] + } + }, + "response": [] + }, + { + "name": "create user with all kinds of invalid request body", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/users", + "host": [ + "{{URL}}" + ], + "path": [ + "users" + ] + } + }, + "response": [] + }, + { + "name": "create user with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"handle\":\"POSTMANE2E-handle02\",\n \"firstName\": \"firstName\",\n \"lastName\": \"lastName\"\n}" + }, + "url": { + "raw": "{{URL}}/users", + "host": [ + "{{URL}}" + ], + "path": [ + "users" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "get user", + "item": [ + { + "name": "get user with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the id should be in the response body", + " pm.expect(response.id).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}?{{params}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}" + ], + "query": [ + { + "key": "{{params}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "get user with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the id should be in the response body", + " pm.expect(response.id).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}?{{params}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}" + ], + "query": [ + { + "key": "{{params}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "get user with invalid requests", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}?{{params}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}" + ], + "query": [ + { + "key": "{{params}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "get user with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " if (response.message) {", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + " } else {", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{USER_ID_1}}?enrich=true", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{USER_ID_1}}" + ], + "query": [ + { + "key": "enrich", + "value": "true" + } + ] + } + }, + "response": [] + } + ] + }, + { + "name": "head user", + "item": [ + { + "name": "head user with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}?{{params}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}" + ], + "query": [ + { + "key": "{{params}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head user with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}?{{params}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}" + ], + "query": [ + { + "key": "{{params}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head user with invalid requests", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}?{{params}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}" + ], + "query": [ + { + "key": "{{params}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head user with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{USER_ID_1}}?enrich=true", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{USER_ID_1}}" + ], + "query": [ + { + "key": "enrich", + "value": "true" + } + ] + } + }, + "response": [] + } + ] + }, + { + "name": "update user", + "item": [ + { + "name": "patch user by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the id should be in the response body", + " pm.expect(response.id).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " if (iterationData.get('expected').handle) {", + " pm.expect(response.handle).to.eq(iterationData.get('expected').handle)", + " }", + " if (iterationData.get('expected').firstName) {", + " pm.expect(response.firstName).to.eq(iterationData.get('expected').firstName)", + " }", + " if (iterationData.get('expected').lastName) {", + " pm.expect(response.lastName).to.eq(iterationData.get('expected').lastName)", + " } ", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/users/{{user_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}" + ] + } + }, + "response": [] + }, + { + "name": "patch user by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the id should be in the response body", + " pm.expect(response.id).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " if (iterationData.get('expected').handle) {", + " pm.expect(response.handle).to.eq(iterationData.get('expected').handle)", + " }", + " if (iterationData.get('expected').firstName) {", + " pm.expect(response.firstName).to.eq(iterationData.get('expected').firstName)", + " }", + " if (iterationData.get('expected').lastName) {", + " pm.expect(response.lastName).to.eq(iterationData.get('expected').lastName)", + " } ", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/users/{{user_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}" + ] + } + }, + "response": [] + }, + { + "name": "patch user with invalid request body", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/users/{{user_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}" + ] + } + }, + "response": [] + }, + { + "name": "patch user with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"handle\": \"POSTMANE2E-validHanldexyz\"\n}" + }, + "url": { + "raw": "{{URL}}/users/{{user_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "delete user", + "item": [ + { + "name": "delete user by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 204`, function () {", + " pm.response.to.have.status(204)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}" + ] + } + }, + "response": [] + }, + { + "name": "delete user with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " if (response.message) {", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + " } else {", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}" + ] + } + }, + "response": [] + } + ] + } + ] + }, + { + "name": "skills provider", + "item": [ + { + "name": "search skill providers", + "item": [ + { + "name": "search skill providers with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.json()", + " pm.expect(response.length).to.gte(0)", + " const iterationData = pm.iterationData", + " if (iterationData.get('idLabel')) {", + " const idLabel = iterationData.get('idLabel')", + " pm.environment.set(idLabel, response[0].id)", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/skillsProviders?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skillsProviders" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search skill providers with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.json()", + " pm.expect(response.length).to.gte(0)", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/skillsProviders?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skillsProviders" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search skill providers with invalid parameters", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/skillsProviders?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skillsProviders" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search skill providers with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/skillsProviders", + "host": [ + "{{URL}}" + ], + "path": [ + "skillsProviders" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "head skill providers", + "item": [ + { + "name": "head skill providers with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/skillsProviders?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skillsProviders" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head skill providers with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/skillsProviders?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skillsProviders" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head skill providers with invalid parameters", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/skillsProviders?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skillsProviders" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head skill providers with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/skillsProviders", + "host": [ + "{{URL}}" + ], + "path": [ + "skillsProviders" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "create skill provider", + "item": [ + { + "name": "create skill provider by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " pm.expect(response.name).to.eq(iterationData.get('name'))", + " pm.expect(response.createdBy).to.not.eq(null)", + " pm.expect(response.id).to.not.eq(null)", + " pm.expect(response.updatedBy).to.eq(null)", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"{{name}}\"\n}" + }, + "url": { + "raw": "{{URL}}/skillsProviders", + "host": [ + "{{URL}}" + ], + "path": [ + "skillsProviders" + ] + } + }, + "response": [] + }, + { + "name": "create skill provider by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " pm.expect(response.name).to.eq(iterationData.get('name'))", + " pm.expect(response.createdBy).to.not.eq(null)", + " pm.expect(response.id).to.not.eq(null)", + " pm.expect(response.updatedBy).to.eq(null)", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"{{name}}\"\n}" + }, + "url": { + "raw": "{{URL}}/skillsProviders", + "host": [ + "{{URL}}" + ], + "path": [ + "skillsProviders" + ] + } + }, + "response": [] + }, + { + "name": "create skill provider with all kinds of invalid request body", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.contains(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/skillsProviders", + "host": [ + "{{URL}}" + ], + "path": [ + "skillsProviders" + ] + } + }, + "response": [] + }, + { + "name": "create skill provider with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"POSTMANE2E-skill-validname\"\n}" + }, + "url": { + "raw": "{{URL}}/skillsProviders", + "host": [ + "{{URL}}" + ], + "path": [ + "skillsProviders" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "get skill provider", + "item": [ + { + "name": "get skill provider with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the id should be in the response body", + " pm.expect(response.id).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/skillsProviders/{{provider_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skillsProviders", + "{{provider_id}}" + ] + } + }, + "response": [] + }, + { + "name": "get skill provider with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the id should be in the response body", + " pm.expect(response.id).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/skillsProviders/{{provider_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skillsProviders", + "{{provider_id}}" + ] + } + }, + "response": [] + }, + { + "name": "get skill provider with invalid requests", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/skillsProviders/{{provider_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skillsProviders", + "{{provider_id}}" + ] + } + }, + "response": [] + }, + { + "name": "get skill provider with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " if (response.message) {", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + " } else {", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/skillsProviders/{{provide_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skillsProviders", + "{{provide_id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "head skill provider", + "item": [ + { + "name": "head skill provider with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/skillsProviders/{{provider_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skillsProviders", + "{{provider_id}}" + ] + } + }, + "response": [] + }, + { + "name": "head skill provider with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/skillsProviders/{{provider_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skillsProviders", + "{{provider_id}}" + ] + } + }, + "response": [] + }, + { + "name": "head skill provider with invalid requests", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/skillsProviders/{{provider_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skillsProviders", + "{{provider_id}}" + ] + } + }, + "response": [] + }, + { + "name": "head skill provider with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/skillsProviders/{{provide_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skillsProviders", + "{{provide_id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "update skill provider", + "item": [ + { + "name": "patch skill provider by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the id should be in the response body", + " pm.expect(response.id).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " if (iterationData.get('expected').name) {", + " pm.expect(response.name).to.eq(iterationData.get('expected').name)", + " }", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/skillsProviders/{{provider_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skillsProviders", + "{{provider_id}}" + ] + } + }, + "response": [] + }, + { + "name": "patch skill provider by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the id should be in the response body", + " pm.expect(response.id).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " if (iterationData.get('expected').name) {", + " pm.expect(response.name).to.eq(iterationData.get('expected').name)", + " }", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/skillsProviders/{{provider_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skillsProviders", + "{{provider_id}}" + ] + } + }, + "response": [] + }, + { + "name": "patch skill provider with invalid request body", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/skillsProviders/{{provider_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skillsProviders", + "{{provider_id}}" + ] + } + }, + "response": [] + }, + { + "name": "patch skill provider with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/skillsProviders/{{provider_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skillsProviders", + "{{provider_id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "delete skill provider", + "item": [ + { + "name": "delete skill provider by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 204`, function () {", + " pm.response.to.have.status(204)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "url": { + "raw": "{{URL}}/skillsProviders/{{provider_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skillsProviders", + "{{provider_id}}" + ] + } + }, + "response": [] + }, + { + "name": "delete skill provider with all kinds of invalid request", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " if (response.message) {", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + " } else {", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/skillsProviders/{{provider_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skillsProviders", + "{{provider_id}}" + ] + } + }, + "response": [] + } + ] + } + ] + }, + { + "name": "skills", + "item": [ + { + "name": "search skills", + "item": [ + { + "name": "search skills with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.json()", + " pm.expect(response.length).to.gte(0)", + " const iterationData = pm.iterationData", + " if (iterationData.get('idLabel')) {", + " const idLabel = iterationData.get('idLabel')", + " pm.environment.set(idLabel, response[0].id)", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/skills?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skills" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search skills with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.json()", + " pm.expect(response.length).to.gte(0)", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/skills?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skills" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search skills with invalid parameters", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/skills?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skills" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search skills with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/skills", + "host": [ + "{{URL}}" + ], + "path": [ + "skills" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "head skills", + "item": [ + { + "name": "head skills with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/skills?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skills" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head skills with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/skills?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skills" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head skills with invalid parameters", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/skills?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skills" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head skills with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/skills", + "host": [ + "{{URL}}" + ], + "path": [ + "skills" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "create skill", + "item": [ + { + "name": "create skill by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " pm.expect(response.name).to.eq(iterationData.get('name'))", + " pm.expect(response.uri).to.eq(iterationData.get('uri'))", + " pm.expect(response.externalId).to.eq(iterationData.get('externalId'))", + " pm.expect(response.createdBy).to.not.eq(null)", + " pm.expect(response.id).to.not.eq(null)", + " pm.expect(response.updatedBy).to.eq(null)", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"skillProviderId\":\"{{skillProviderId}}\",\n\t\"name\":\"{{name}}\",\n\t\"uri\":\"{{uri}}\",\n\t\"externalId\":\"{{externalId}}\"\n}" + }, + "url": { + "raw": "{{URL}}/skills", + "host": [ + "{{URL}}" + ], + "path": [ + "skills" + ] + } + }, + "response": [] + }, + { + "name": "create skill by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " pm.expect(response.name).to.eq(iterationData.get('name'))", + " pm.expect(response.uri).to.eq(iterationData.get('uri'))", + " pm.expect(response.externalId).to.eq(iterationData.get('externalId'))", + " pm.expect(response.createdBy).to.not.eq(null)", + " pm.expect(response.id).to.not.eq(null)", + " pm.expect(response.updatedBy).to.eq(null)", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"skillProviderId\":\"{{skillProviderId}}\",\n\t\"name\":\"{{name}}\",\n\t\"uri\":\"{{uri}}\",\n\t\"externalId\":\"{{externalId}}\"\n}" + }, + "url": { + "raw": "{{URL}}/skills", + "host": [ + "{{URL}}" + ], + "path": [ + "skills" + ] + } + }, + "response": [] + }, + { + "name": "create skill with all kinds of invalid request body", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.contains(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/skills", + "host": [ + "{{URL}}" + ], + "path": [ + "skills" + ] + } + }, + "response": [] + }, + { + "name": "create skill with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"skillProviderId\": \"{{SKILL_PROVIDER_ID_1}}\",\n \"name\": \"POSTMANE2E-Skill01-by-admin-valid\",\n \"uri\": \"POSTMANE2E-skill-uri01-by-admin\",\n \"externalId\": \"POSTMANE2E-externalId01-by-admin\"\n}" + }, + "url": { + "raw": "{{URL}}/skills", + "host": [ + "{{URL}}" + ], + "path": [ + "skills" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "get skill", + "item": [ + { + "name": "get skill with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the id should be in the response body", + " pm.expect(response.id).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/skills/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skills", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "get skill with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the id should be in the response body", + " pm.expect(response.id).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/skills/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skills", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "get skill with invalid requests", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/skills/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skills", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "get skill with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " if (response.message) {", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + " } else {", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/skills/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skills", + "{{id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "head skill", + "item": [ + { + "name": "head skill with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/skills/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skills", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "head skill with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/skills/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skills", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "head skill with invalid requests", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/skills/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skills", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "head skill with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/skills/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skills", + "{{id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "update skill", + "item": [ + { + "name": "patch skill by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the id should be in the response body", + " pm.expect(response.id).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " if (iterationData.get('expected').name) {", + " pm.expect(response.name).to.eq(iterationData.get('expected').name)", + " }", + " if (iterationData.get('expected').uri) {", + " pm.expect(response.uri).to.eq(iterationData.get('expected').uri)", + " }", + " if (iterationData.get('expected').externalId) {", + " pm.expect(response.externalId).to.eq(iterationData.get('expected').externalId)", + " }", + " if (iterationData.get('expected').skillProviderId) {", + " const skillProviderId = iterationData.get('expected').skillProviderId", + " if (skillProviderId.startsWith('{')) {", + " pm.expect(response.skillProviderId).to.eq(pm.environment.get(skillProviderId.substr(2, skillProviderId.length - 4)))", + " } else {", + " pm.expect(response.skillProviderId).to.eq(skillProviderId)", + " }", + " }", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/skills/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skills", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "patch skill by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the id should be in the response body", + " pm.expect(response.id).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " if (iterationData.get('expected').name) {", + " pm.expect(response.name).to.eq(iterationData.get('expected').name)", + " }", + " if (iterationData.get('expected').uri) {", + " pm.expect(response.uri).to.eq(iterationData.get('expected').uri)", + " }", + " if (iterationData.get('expected').externalId) {", + " pm.expect(response.externalId).to.eq(iterationData.get('expected').externalId)", + " }", + " if (iterationData.get('expected').skillProviderId) {", + " const skillProviderId = iterationData.get('expected').skillProviderId", + " if (skillProviderId.startsWith('{')) {", + " pm.expect(response.skillProviderId).to.eq(pm.environment.get(skillProviderId.substr(2, skillProviderId.length - 4)))", + " } else {", + " pm.expect(response.skillProviderId).to.eq(skillProviderId)", + " }", + " }", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/skills/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skills", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "patch skill with invalid request body", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/skills/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skills", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "patch skill with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/skills/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skills", + "{{id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "delete skill", + "item": [ + { + "name": "delete skill by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 204`, function () {", + " pm.response.to.have.status(204)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "url": { + "raw": "{{URL}}/skills/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skills", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "delete skill with all kinds of invalid request", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " if (response.message) {", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + " } else {", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/skills/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skills", + "{{id}}" + ] + } + }, + "response": [] + } + ] + } + ] + }, + { + "name": "user skills", + "item": [ + { + "name": "search user skills", + "item": [ + { + "name": "search user skills with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.json()", + " pm.expect(response.length).to.gte(0)", + " const iterationData = pm.iterationData", + " if (iterationData.get('idLabel')) {", + " const idLabel = iterationData.get('idLabel')", + " pm.environment.set(idLabel, response[0].id)", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/skills?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "skills" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search user skills with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.json()", + " pm.expect(response.length).to.gte(0)", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/skills?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "skills" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search user skills with invalid parameters", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/skills?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "skills" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search user skills with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/skills", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "skills" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "head user skills", + "item": [ + { + "name": "head user skills with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/skills?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "skills" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head user skills with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/skills?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "skills" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head user skills with invalid parameters", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/skills?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "skills" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head user skills with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/skills", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "skills" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "create user skill", + "item": [ + { + "name": "create user skill by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " if (iterationData.get('expected').metricValue) {", + " pm.expect(response.metricValue).to.eq(iterationData.get('expected').metricValue)", + " }", + " if (iterationData.get('expected').certifierId) {", + " pm.expect(response.certifierId).to.eq(iterationData.get('expected').certifierId)", + " }", + " if (iterationData.get('expected').certifiedDate) {", + " pm.expect(response.certifiedDate).to.eq(iterationData.get('expected').certifiedDate)", + " }", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/users/{{user_id}}/skills", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "skills" + ] + } + }, + "response": [] + }, + { + "name": "create user skill by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " if (iterationData.get('expected').metricValue) {", + " pm.expect(response.metricValue).to.eq(iterationData.get('expected').metricValue)", + " }", + " if (iterationData.get('expected').certifierId) {", + " pm.expect(response.certifierId).to.eq(iterationData.get('expected').certifierId)", + " }", + " if (iterationData.get('expected').certifiedDate) {", + " pm.expect(response.certifiedDate).to.eq(iterationData.get('expected').certifiedDate)", + " }", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/users/{{user_id}}/skills", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "skills" + ] + } + }, + "response": [] + }, + { + "name": "create user skill with all kinds of invalid request body", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.contains(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/users/{{user_id}}/skills", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "skills" + ] + } + }, + "response": [] + }, + { + "name": "create user skill with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"skillId\":\"{{SKILL_ID_1}}\",\n\t\"metricValue\":\"3L\",\n\t\"certifierId\":\"certifier_id\",\n\t\"certifiedDate\":\"2020-05-04T07:36:28.036Z\"\n}" + }, + "url": { + "raw": "{{URL}}/users/{{user_id}}/skills", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "skills" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "get user skill", + "item": [ + { + "name": "get user skill with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the skill id should be in the response body", + " pm.expect(response.skillId).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/skills/{{skill_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "skills", + "{{skill_id}}" + ] + } + }, + "response": [] + }, + { + "name": "get user skill with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the id should be in the response body", + " pm.expect(response.skillId).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/skills/{{skill_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "skills", + "{{skill_id}}" + ] + } + }, + "response": [] + }, + { + "name": "get user skill with invalid requests", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.contains(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/skills/{{skill_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "skills", + "{{skill_id}}" + ] + } + }, + "response": [] + }, + { + "name": "get user skill with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " if (response.message) {", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + " } else {", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/skills/{{skill_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "skills", + "{{skill_id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "head user skill", + "item": [ + { + "name": "head user skill with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/skills/{{skill_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "skills", + "{{skill_id}}" + ] + } + }, + "response": [] + }, + { + "name": "head user skill with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/skills/{{skill_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "skills", + "{{skill_id}}" + ] + } + }, + "response": [] + }, + { + "name": "head user skill with invalid requests", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/skills/{{skill_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "skills", + "{{skill_id}}" + ] + } + }, + "response": [] + }, + { + "name": "head user skill with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/skills/{{skill_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "skills", + "{{skill_id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "update user skill", + "item": [ + { + "name": "patch user skill by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " if (iterationData.get('expected').metricValue) {", + " pm.expect(response.metricValue).to.eq(iterationData.get('expected').metricValue)", + " }", + " if (iterationData.get('expected').certifierId) {", + " pm.expect(response.certifierId).to.eq(iterationData.get('expected').certifierId)", + " }", + " if (iterationData.get('expected').certifiedDate) {", + " pm.expect(response.certifiedDate).to.eq(iterationData.get('expected').certifiedDate)", + " }", + " // the skill id should be in the response body", + " pm.expect(response.skillId).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " // the user id should be in the response body", + " pm.expect(response.userId).to.eq(pm.request.url.path[pm.request.url.path.length - 3])", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/users/{{user_id}}/skills/{{skill_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "skills", + "{{skill_id}}" + ] + } + }, + "response": [] + }, + { + "name": "patch user skill by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " if (iterationData.get('expected').metricValue) {", + " pm.expect(response.metricValue).to.eq(iterationData.get('expected').metricValue)", + " }", + " if (iterationData.get('expected').certifierId) {", + " pm.expect(response.certifierId).to.eq(iterationData.get('expected').certifierId)", + " }", + " if (iterationData.get('expected').certifiedDate) {", + " pm.expect(response.certifiedDate).to.eq(iterationData.get('expected').certifiedDate)", + " }", + " // the skill id should be in the response body", + " pm.expect(response.skillId).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " // the user id should be in the response body", + " pm.expect(response.userId).to.eq(pm.request.url.path[pm.request.url.path.length - 3])", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/users/{{user_id}}/skills/{{skill_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "skills", + "{{skill_id}}" + ] + } + }, + "response": [] + }, + { + "name": "patch user skill with invalid request body", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/users/{{user_id}}/skills/{{skill_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "skills", + "{{skill_id}}" + ] + } + }, + "response": [] + }, + { + "name": "patch user skill with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/skills/{{skill_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "skills", + "{{skill_id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "delete user skill", + "item": [ + { + "name": "delete user skill by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 204`, function () {", + " pm.response.to.have.status(204)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "url": { + "raw": "{{URL}}/users/{{USER_ID_BY_TESTER}}/skills/{{SKILL_ID_BY_TESTER}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{USER_ID_BY_TESTER}}", + "skills", + "{{SKILL_ID_BY_TESTER}}" + ] + } + }, + "response": [] + }, + { + "name": "delete user skill with all kinds of invalid request", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " if (response.message) {", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + " } else {", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/skills/{{skill_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "skills", + "{{skill_id}}" + ] + } + }, + "response": [] + } + ] + } + ] + }, + { + "name": "roles", + "item": [ + { + "name": "search roles", + "item": [ + { + "name": "search roles with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.json()", + " pm.expect(response.length).to.gte(0)", + " const iterationData = pm.iterationData", + " if (iterationData.get('idLabel')) {", + " const idLabel = iterationData.get('idLabel')", + " pm.environment.set(idLabel, response[0].id)", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/roles?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "roles" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search roles with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.json()", + " pm.expect(response.length).to.gte(0)", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/roles?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "roles" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search roles with invalid parameters", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/roles?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "roles" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search roles with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/roles", + "host": [ + "{{URL}}" + ], + "path": [ + "roles" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "head roles", + "item": [ + { + "name": "head roles with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/roles?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "roles" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head roles with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/roles?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "roles" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head roles with invalid parameters", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/roles?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "roles" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head roles with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/roles", + "host": [ + "{{URL}}" + ], + "path": [ + "roles" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "create role", + "item": [ + { + "name": "create role by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " pm.expect(response.name).to.eq(iterationData.get('name'))", + " pm.expect(response.createdBy).to.not.eq(null)", + " pm.expect(response.id).to.not.eq(null)", + " pm.expect(response.updatedBy).to.eq(null)", + " pm.environment.set('ROLE_ID_FOR_DELETE', response.id)", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"{{name}}\"\n}" + }, + "url": { + "raw": "{{URL}}/roles", + "host": [ + "{{URL}}" + ], + "path": [ + "roles" + ] + } + }, + "response": [] + }, + { + "name": "create role by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " pm.expect(response.name).to.eq(iterationData.get('name'))", + " pm.expect(response.createdBy).to.not.eq(null)", + " pm.expect(response.id).to.not.eq(null)", + " pm.expect(response.updatedBy).to.eq(null)", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"{{name}}\"\n}" + }, + "url": { + "raw": "{{URL}}/roles", + "host": [ + "{{URL}}" + ], + "path": [ + "roles" + ] + } + }, + "response": [] + }, + { + "name": "create role with all kinds of invalid request body", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.contains(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/roles", + "host": [ + "{{URL}}" + ], + "path": [ + "roles" + ] + } + }, + "response": [] + }, + { + "name": "create role with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"POSTMANE2E-role-validname\"\n}" + }, + "url": { + "raw": "{{URL}}/roles", + "host": [ + "{{URL}}" + ], + "path": [ + "roles" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "get role", + "item": [ + { + "name": "get role with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the id should be in the response body", + " pm.expect(response.id).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/roles/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "roles", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "get role with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the id should be in the response body", + " pm.expect(response.id).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/roles/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "roles", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "get role with invalid requests", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/roles/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "roles", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "get role with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " if (response.message) {", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + " } else {", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/roles/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "roles", + "{{id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "head role", + "item": [ + { + "name": "head role with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/roles/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "roles", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "head role with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/roles/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "roles", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "head role with invalid requests", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/roles/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "roles", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "head role with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/roles/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "roles", + "{{id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "update role", + "item": [ + { + "name": "patch role by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the id should be in the response body", + " pm.expect(response.id).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " if (iterationData.get('expected').name) {", + " pm.expect(response.name).to.eq(iterationData.get('expected').name)", + " }", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/roles/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "roles", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "patch role by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the id should be in the response body", + " pm.expect(response.id).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " if (iterationData.get('expected').name) {", + " pm.expect(response.name).to.eq(iterationData.get('expected').name)", + " }", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/roles/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "roles", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "patch role with invalid request body", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/roles/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "roles", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "patch role with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/roles/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "roles", + "{{id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "delete role", + "item": [ + { + "name": "delete role by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 204`, function () {", + " pm.response.to.have.status(204)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "url": { + "raw": "{{URL}}/roles/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "roles", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "delete role with all kinds of invalid request", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " if (response.message) {", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + " } else {", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/roles/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "roles", + "{{id}}" + ] + } + }, + "response": [] + } + ] + } + ] + }, + { + "name": "user roles", + "item": [ + { + "name": "search user roles", + "item": [ + { + "name": "search user roles with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.json()", + " pm.expect(response.length).to.gte(0)", + " const iterationData = pm.iterationData", + " if (iterationData.get('idLabel')) {", + " const idLabel = iterationData.get('idLabel')", + " pm.environment.set(idLabel, response[0].id)", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/roles?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "roles" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search user roles with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.json()", + " pm.expect(response.length).to.gte(0)", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/roles?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "roles" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search user roles with invalid parameters", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/roles?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "roles" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search user roles with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/roles", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "roles" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "head user roles", + "item": [ + { + "name": "head user roles with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/roles?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "roles" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head user roles with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/roles?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "roles" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head user roles with invalid parameters", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/roles?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "roles" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head user roles with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/roles", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "roles" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "create user role", + "item": [ + { + "name": "create user role by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " pm.expect(response.createdBy).to.not.eq(null)", + " pm.expect(response.id).to.not.eq(null)", + " pm.expect(response.updatedBy).to.eq(null)", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/users/{{user_id}}/roles", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "roles" + ] + } + }, + "response": [] + }, + { + "name": "create user role by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " pm.expect(response.createdBy).to.not.eq(null)", + " pm.expect(response.id).to.not.eq(null)", + " pm.expect(response.updatedBy).to.eq(null)", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/users/{{user_id}}/roles", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "roles" + ] + } + }, + "response": [] + }, + { + "name": "create user role with all kinds of invalid request body", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.contains(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/users/{{user_id}}/roles", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "roles" + ] + } + }, + "response": [] + }, + { + "name": "create user role with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"roleId\":\"{{ROLE_ID_1}}\"\n}" + }, + "url": { + "raw": "{{URL}}/users/{{user_id}}/roles", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "roles" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "get user role", + "item": [ + { + "name": "get user role with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the role id should be in the response body", + " pm.expect(response.roleId).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/roles/{{role_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "roles", + "{{role_id}}" + ] + } + }, + "response": [] + }, + { + "name": "get user role with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the id should be in the response body", + " pm.expect(response.roleId).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/roles/{{role_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "roles", + "{{role_id}}" + ] + } + }, + "response": [] + }, + { + "name": "get user role with invalid requests", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.contains(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/roles/{{role_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "roles", + "{{role_id}}" + ] + } + }, + "response": [] + }, + { + "name": "get user role with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " if (response.message) {", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + " } else {", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/roles/{{role_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "roles", + "{{role_id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "head user role", + "item": [ + { + "name": "head user role with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/roles/{{role_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "roles", + "{{role_id}}" + ] + } + }, + "response": [] + }, + { + "name": "head user role with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/roles/{{role_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "roles", + "{{role_id}}" + ] + } + }, + "response": [] + }, + { + "name": "head user role with invalid requests", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/roles/{{role_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "roles", + "{{role_id}}" + ] + } + }, + "response": [] + }, + { + "name": "head user role with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/roles/{{role_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "roles", + "{{role_id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "delete user role", + "item": [ + { + "name": "delete user role by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 204`, function () {", + " pm.response.to.have.status(204)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "url": { + "raw": "{{URL}}/users/{{USER_ID_BY_TESTER}}/roles/{{ROLE_ID_1}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{USER_ID_BY_TESTER}}", + "roles", + "{{ROLE_ID_1}}" + ] + } + }, + "response": [] + }, + { + "name": "delete user role with all kinds of invalid request", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " if (response.message) {", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + " } else {", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/roles/{{role_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "roles", + "{{role_id}}" + ] + } + }, + "response": [] + } + ] + } + ] + }, + { + "name": "organizations", + "item": [ + { + "name": "search organizations", + "item": [ + { + "name": "search organizations with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.json()", + " pm.expect(response.length).to.gte(0)", + " const iterationData = pm.iterationData", + " if (iterationData.get('idLabel')) {", + " const idLabel = iterationData.get('idLabel')", + " pm.environment.set(idLabel, response[0].id)", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/organizations?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search organizations with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.json()", + " pm.expect(response.length).to.gte(0)", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/organizations?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search organizations with invalid parameters", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/organizations?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search organizations with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/organizations", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "head organizations", + "item": [ + { + "name": "head organizations with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/organizations?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head organizations with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/organizations?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head organizations with invalid parameters", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/organizations?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head organizations with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/organizations", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "create organization", + "item": [ + { + "name": "create organization by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " pm.expect(response.name).to.eq(iterationData.get('name'))", + " pm.expect(response.createdBy).to.not.eq(null)", + " pm.expect(response.id).to.not.eq(null)", + " pm.expect(response.updatedBy).to.eq(null)", + " pm.environment.set('ORGANIZATION_ID_FOR_DELETE', response.id)", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"{{name}}\"\n}" + }, + "url": { + "raw": "{{URL}}/organizations", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations" + ] + } + }, + "response": [] + }, + { + "name": "create organization by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " pm.expect(response.name).to.eq(iterationData.get('name'))", + " pm.expect(response.createdBy).to.not.eq(null)", + " pm.expect(response.id).to.not.eq(null)", + " pm.expect(response.updatedBy).to.eq(null)", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"{{name}}\"\n}" + }, + "url": { + "raw": "{{URL}}/organizations", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations" + ] + } + }, + "response": [] + }, + { + "name": "create organization with all kinds of invalid request body", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.contains(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/organizations", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations" + ] + } + }, + "response": [] + }, + { + "name": "create organization with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"POSTMANE2E-organization-validname\"\n}" + }, + "url": { + "raw": "{{URL}}/organizations", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "get organization", + "item": [ + { + "name": "get organization with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the id should be in the response body", + " pm.expect(response.id).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/organizations/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "get organization with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the id should be in the response body", + " pm.expect(response.id).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/organizations/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "get organization with invalid requests", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/organizations/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "get organization with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " if (response.message) {", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + " } else {", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/organizations/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations", + "{{id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "head organization", + "item": [ + { + "name": "head organization with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/organizations/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "head organization with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/organizations/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "head organization with invalid requests", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/organizations/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "head organization with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/organizations/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations", + "{{id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "update organization", + "item": [ + { + "name": "patch organization by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the id should be in the response body", + " pm.expect(response.id).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " if (iterationData.get('expected').name) {", + " pm.expect(response.name).to.eq(iterationData.get('expected').name)", + " }", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/organizations/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "patch organization by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the id should be in the response body", + " pm.expect(response.id).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " if (iterationData.get('expected').name) {", + " pm.expect(response.name).to.eq(iterationData.get('expected').name)", + " }", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/organizations/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "patch organization with invalid request body", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/organizations/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "patch organization with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/organizations/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations", + "{{id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "delete organization", + "item": [ + { + "name": "delete organization by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 204`, function () {", + " pm.response.to.have.status(204)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "url": { + "raw": "{{URL}}/organizations/{{ORGANIZATION_ID_FOR_DELETE}}", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations", + "{{ORGANIZATION_ID_FOR_DELETE}}" + ] + } + }, + "response": [] + }, + { + "name": "delete organization with all kinds of invalid request", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " if (response.message) {", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + " } else {", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/organizations/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations", + "{{id}}" + ] + } + }, + "response": [] + } + ] + } + ] + }, + { + "name": "achievements providers", + "item": [ + { + "name": "search achievementsProviders", + "item": [ + { + "name": "search achievementsProviders with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.json()", + " pm.expect(response.length).to.gte(0)", + " const iterationData = pm.iterationData", + " if (iterationData.get('idLabel')) {", + " const idLabel = iterationData.get('idLabel')", + " pm.environment.set(idLabel, response[0].id)", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/achievementsProviders?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "achievementsProviders" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search achievementsProviders with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.json()", + " pm.expect(response.length).to.gte(0)", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/achievementsProviders?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "achievementsProviders" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search achievementsProviders with invalid parameters", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/achievementsProviders?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "achievementsProviders" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search achievementsProviders with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/achievementsProviders", + "host": [ + "{{URL}}" + ], + "path": [ + "achievementsProviders" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "head achievementsProviders", + "item": [ + { + "name": "head achievementsProviders with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/achievementsProviders?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "achievementsProviders" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head achievementsProviders with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/achievementsProviders?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "achievementsProviders" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head achievementsProviders with invalid parameters", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/achievementsProviders?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "achievementsProviders" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head achievementsProviders with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/achievementsProviders", + "host": [ + "{{URL}}" + ], + "path": [ + "achievementsProviders" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "create achievementsProvider", + "item": [ + { + "name": "create achievementsProvider by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " pm.expect(response.name).to.eq(iterationData.get('name'))", + " pm.expect(response.createdBy).to.not.eq(null)", + " pm.expect(response.id).to.not.eq(null)", + " pm.expect(response.updatedBy).to.eq(null)", + " pm.environment.set('ACHIEVEMENTS_PROVIDER_ID_FOR_DELETE', response.id)", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"{{name}}\"\n}" + }, + "url": { + "raw": "{{URL}}/achievementsProviders", + "host": [ + "{{URL}}" + ], + "path": [ + "achievementsProviders" + ] + } + }, + "response": [] + }, + { + "name": "create achievementsProvider by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " pm.expect(response.name).to.eq(iterationData.get('name'))", + " pm.expect(response.createdBy).to.not.eq(null)", + " pm.expect(response.id).to.not.eq(null)", + " pm.expect(response.updatedBy).to.eq(null)", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"{{name}}\"\n}" + }, + "url": { + "raw": "{{URL}}/achievementsProviders", + "host": [ + "{{URL}}" + ], + "path": [ + "achievementsProviders" + ] + } + }, + "response": [] + }, + { + "name": "create achievementsProvider with all kinds of invalid request body", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.contains(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/achievementsProviders", + "host": [ + "{{URL}}" + ], + "path": [ + "achievementsProviders" + ] + } + }, + "response": [] + }, + { + "name": "create achievementsProvider with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"POSTMANE2E-achievementsProvider-validname\"\n}" + }, + "url": { + "raw": "{{URL}}/achievementsProviders", + "host": [ + "{{URL}}" + ], + "path": [ + "achievementsProviders" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "get achievementsProvider", + "item": [ + { + "name": "get achievementsProvider with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the id should be in the response body", + " pm.expect(response.id).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/achievementsProviders/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "achievementsProviders", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "get achievementsProvider with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the id should be in the response body", + " pm.expect(response.id).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/achievementsProviders/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "achievementsProviders", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "get achievementsProvider with invalid requests", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/achievementsProviders/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "achievementsProviders", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "get achievementsProvider with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " if (response.message) {", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + " } else {", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/achievementsProviders/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "achievementsProviders", + "{{id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "head achievementsProvider", + "item": [ + { + "name": "head achievementsProvider with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/achievementsProviders/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "achievementsProviders", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "head achievementsProvider with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/achievementsProviders/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "achievementsProviders", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "head achievementsProvider with invalid requests", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/achievementsProviders/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "achievementsProviders", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "head achievementsProvider with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/achievementsProviders/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "achievementsProviders", + "{{id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "update achievementsProvider", + "item": [ + { + "name": "patch achievementsProvider by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the id should be in the response body", + " pm.expect(response.id).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " if (iterationData.get('expected').name) {", + " pm.expect(response.name).to.eq(iterationData.get('expected').name)", + " }", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/achievementsProviders/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "achievementsProviders", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "patch achievementsProvider by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the id should be in the response body", + " pm.expect(response.id).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " if (iterationData.get('expected').name) {", + " pm.expect(response.name).to.eq(iterationData.get('expected').name)", + " }", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/achievementsProviders/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "achievementsProviders", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "patch achievementsProvider with invalid request body", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/achievementsProviders/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "achievementsProviders", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "patch achievementsProvider with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/achievementsProviders/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "achievementsProviders", + "{{id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "delete achievementsProvider", + "item": [ + { + "name": "delete achievementsProvider by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 204`, function () {", + " pm.response.to.have.status(204)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "url": { + "raw": "{{URL}}/achievementsProviders/{{ACHIEVEMENTS_PROVIDER_ID_FOR_DELETE}}", + "host": [ + "{{URL}}" + ], + "path": [ + "achievementsProviders", + "{{ACHIEVEMENTS_PROVIDER_ID_FOR_DELETE}}" + ] + } + }, + "response": [] + }, + { + "name": "delete achievementsProvider with all kinds of invalid request", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " if (response.message) {", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + " } else {", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/achievementsProviders/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "achievementsProviders", + "{{id}}" + ] + } + }, + "response": [] + } + ] + } + ] + }, + { + "name": "attribute groups", + "item": [ + { + "name": "search attributeGroups", + "item": [ + { + "name": "search attributeGroups with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.json()", + " pm.expect(response.length).to.gte(0)", + " const iterationData = pm.iterationData", + " if (iterationData.get('idLabel')) {", + " const idLabel = iterationData.get('idLabel')", + " pm.environment.set(idLabel, response[0].id)", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/attributeGroups?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "attributeGroups" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search attributeGroups with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.json()", + " pm.expect(response.length).to.gte(0)", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/attributeGroups?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "attributeGroups" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search attributeGroups with invalid parameters", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/attributeGroups?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "attributeGroups" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search attributeGroups with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/attributeGroups", + "host": [ + "{{URL}}" + ], + "path": [ + "attributeGroups" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "head attributeGroups", + "item": [ + { + "name": "head attributeGroups with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/attributeGroups?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "attributeGroups" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head attributeGroups with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/attributeGroups?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "attributeGroups" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head attributeGroups with invalid parameters", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/attributeGroups?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "attributeGroups" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head attributeGroups with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/attributeGroups", + "host": [ + "{{URL}}" + ], + "path": [ + "attributeGroups" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "create attributeGroup", + "item": [ + { + "name": "create attributeGroup by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " pm.expect(response.name).to.eq(iterationData.get('name'))", + " pm.expect(response.createdBy).to.not.eq(null)", + " pm.expect(response.id).to.not.eq(null)", + " pm.expect(response.updatedBy).to.eq(null)", + " pm.environment.set('ATTRIBUTE_GROUP_ID_FOR_DELETE', response.id)", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"{{name}}\",\n \"organizationId\":\"{{organization_id}}\"\n}" + }, + "url": { + "raw": "{{URL}}/attributeGroups", + "host": [ + "{{URL}}" + ], + "path": [ + "attributeGroups" + ] + } + }, + "response": [] + }, + { + "name": "create attributeGroup by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " pm.expect(response.name).to.eq(iterationData.get('name'))", + " pm.expect(response.createdBy).to.not.eq(null)", + " pm.expect(response.id).to.not.eq(null)", + " pm.expect(response.updatedBy).to.eq(null)", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"{{name}}\",\n \"organizationId\":\"{{organization_id}}\"\n}" + }, + "url": { + "raw": "{{URL}}/attributeGroups", + "host": [ + "{{URL}}" + ], + "path": [ + "attributeGroups" + ] + } + }, + "response": [] + }, + { + "name": "create attributeGroup with all kinds of invalid request body", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.contains(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/attributeGroups", + "host": [ + "{{URL}}" + ], + "path": [ + "attributeGroups" + ] + } + }, + "response": [] + }, + { + "name": "create attributeGroup with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"POSTMANE2E-attributeGroup-validname\"\n}" + }, + "url": { + "raw": "{{URL}}/attributeGroups", + "host": [ + "{{URL}}" + ], + "path": [ + "attributeGroups" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "get attributeGroup", + "item": [ + { + "name": "get attributeGroup with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the id should be in the response body", + " pm.expect(response.id).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/attributeGroups/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "attributeGroups", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "get attributeGroup with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the id should be in the response body", + " pm.expect(response.id).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/attributeGroups/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "attributeGroups", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "get attributeGroup with invalid requests", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/attributeGroups/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "attributeGroups", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "get attributeGroup with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " if (response.message) {", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + " } else {", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/attributeGroups/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "attributeGroups", + "{{id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "head attributeGroup", + "item": [ + { + "name": "head attributeGroup with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/attributeGroups/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "attributeGroups", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "head attributeGroup with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/attributeGroups/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "attributeGroups", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "head attributeGroup with invalid requests", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/attributeGroups/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "attributeGroups", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "head attributeGroup with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/attributeGroups/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "attributeGroups", + "{{id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "update attributeGroup", + "item": [ + { + "name": "patch attributeGroup by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the id should be in the response body", + " pm.expect(response.id).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " if (iterationData.get('expected').name) {", + " pm.expect(response.name).to.eq(iterationData.get('expected').name)", + " }", + " if (iterationData.get('expected').organizationId) {", + " const organizationId = iterationData.get('expected').organizationId", + " if (organizationId.startsWith('{')) {", + " pm.expect(response.organizationId).to.eq(pm.environment.get(organizationId.substr(2, organizationId.length - 4)))", + " } else {", + " pm.expect(response.organizationId).to.eq(organizationId)", + " }", + " }", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/attributeGroups/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "attributeGroups", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "patch attributeGroup by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the id should be in the response body", + " pm.expect(response.id).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " if (iterationData.get('expected').name) {", + " pm.expect(response.name).to.eq(iterationData.get('expected').name)", + " }", + " if (iterationData.get('expected').organizationId) {", + " const organizationId = iterationData.get('expected').organizationId", + " if (organizationId.startsWith('{')) {", + " pm.expect(response.organizationId).to.eq(pm.environment.get(organizationId.substr(2, organizationId.length - 4)))", + " } else {", + " pm.expect(response.organizationId).to.eq(organizationId)", + " }", + " }", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/attributeGroups/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "attributeGroups", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "patch attributeGroup with invalid request body", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/attributeGroups/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "attributeGroups", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "patch attributeGroup with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/attributeGroups/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "attributeGroups", + "{{id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "delete attributeGroup", + "item": [ + { + "name": "delete attributeGroup by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 204`, function () {", + " pm.response.to.have.status(204)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "url": { + "raw": "{{URL}}/attributeGroups/{{ATTRIBUTE_GROUP_ID_FOR_DELETE}}", + "host": [ + "{{URL}}" + ], + "path": [ + "attributeGroups", + "{{ATTRIBUTE_GROUP_ID_FOR_DELETE}}" + ] + } + }, + "response": [] + }, + { + "name": "delete attributeGroup with all kinds of invalid request", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " if (response.message) {", + " pm.expect(response.message).to.contains(iterationData.get('message'))", + " } else {", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/attributeGroups/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "attributeGroups", + "{{id}}" + ] + } + }, + "response": [] + } + ] + } + ] + }, + { + "name": "attributes", + "item": [ + { + "name": "search attributes", + "item": [ + { + "name": "search attributes with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.json()", + " pm.expect(response.length).to.gte(0)", + " const iterationData = pm.iterationData", + " if (iterationData.get('idLabel')) {", + " const idLabel = iterationData.get('idLabel')", + " pm.environment.set(idLabel, response[0].id)", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/attributes?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "attributes" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search attributes with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.json()", + " pm.expect(response.length).to.gte(0)", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/attributes?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "attributes" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search attributes with invalid parameters", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/attributes?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "attributes" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search attributes with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/attributes", + "host": [ + "{{URL}}" + ], + "path": [ + "attributes" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "head attributes", + "item": [ + { + "name": "head attributes with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/attributes?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "attributes" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head attributes with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/attributes?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "attributes" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head attributes with invalid parameters", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/attributes?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "attributes" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head attributes with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/attributes", + "host": [ + "{{URL}}" + ], + "path": [ + "attributes" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "create attribute", + "item": [ + { + "name": "create attribute by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " pm.expect(response.name).to.eq(iterationData.get('name'))", + " pm.expect(response.createdBy).to.not.eq(null)", + " pm.expect(response.id).to.not.eq(null)", + " pm.expect(response.updatedBy).to.eq(null)", + " pm.environment.set('ATTRIBUTE_ID_FOR_DELETE', response.id)", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"{{name}}\",\n\t\"attributeGroupId\":\"{{attribute_group_id}}\"\n}" + }, + "url": { + "raw": "{{URL}}/attributes", + "host": [ + "{{URL}}" + ], + "path": [ + "attributes" + ] + } + }, + "response": [] + }, + { + "name": "create attribute by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " pm.expect(response.name).to.eq(iterationData.get('name'))", + " pm.expect(response.createdBy).to.not.eq(null)", + " pm.expect(response.id).to.not.eq(null)", + " pm.expect(response.updatedBy).to.eq(null)", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\":\"{{name}}\",\n\t\"attributeGroupId\":\"{{attribute_group_id}}\"\n}" + }, + "url": { + "raw": "{{URL}}/attributes", + "host": [ + "{{URL}}" + ], + "path": [ + "attributes" + ] + } + }, + "response": [] + }, + { + "name": "create attribute with all kinds of invalid request body", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.contains(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/attributes", + "host": [ + "{{URL}}" + ], + "path": [ + "attributes" + ] + } + }, + "response": [] + }, + { + "name": "create attribute with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"POSTMANE2E-attribute-validname\"\n}" + }, + "url": { + "raw": "{{URL}}/attributes", + "host": [ + "{{URL}}" + ], + "path": [ + "attributes" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "get attribute", + "item": [ + { + "name": "get attribute with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the id should be in the response body", + " pm.expect(response.id).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/attributes/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "attributes", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "get attribute with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the id should be in the response body", + " pm.expect(response.id).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/attributes/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "attributes", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "get attribute with invalid requests", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/attributes/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "attributes", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "get attribute with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " if (response.message) {", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + " } else {", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/attributes/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "attributes", + "{{id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "head attribute", + "item": [ + { + "name": "head attribute with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/attributes/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "attributes", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "head attribute with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/attributes/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "attributes", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "head attribute with invalid requests", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/attributes/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "attributes", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "head attribute with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/attributes/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "attributes", + "{{id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "update attribute", + "item": [ + { + "name": "patch attribute by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the id should be in the response body", + " pm.expect(response.id).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " if (iterationData.get('expected').name) {", + " pm.expect(response.name).to.eq(iterationData.get('expected').name)", + " }", + " if (iterationData.get('expected').attributeGroupId) {", + " const attributeGroupId = iterationData.get('expected').attributeGroupId", + " if (attributeGroupId.startsWith('{')) {", + " pm.expect(response.attributeGroupId).to.eq(pm.environment.get(attributeGroupId.substr(2, attributeGroupId.length - 4)))", + " } else {", + " pm.expect(response.attributeGroupId).to.eq(attributeGroupId)", + " }", + " }", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/attributes/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "attributes", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "patch attribute by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the id should be in the response body", + " pm.expect(response.id).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " if (iterationData.get('expected').name) {", + " pm.expect(response.name).to.eq(iterationData.get('expected').name)", + " }", + " if (iterationData.get('expected').attributeGroupId) {", + " const attributeGroupId = iterationData.get('expected').attributeGroupId", + " if (attributeGroupId.startsWith('{')) {", + " pm.expect(response.attributeGroupId).to.eq(pm.environment.get(attributeGroupId.substr(2, attributeGroupId.length - 4)))", + " } else {", + " pm.expect(response.attributeGroupId).to.eq(attributeGroupId)", + " }", + " }", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/attributes/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "attributes", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "patch attribute with invalid request body", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/attributes/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "attributes", + "{{id}}" + ] + } + }, + "response": [] + }, + { + "name": "patch attribute with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/attributes/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "attributes", + "{{id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "delete attribute", + "item": [ + { + "name": "delete attribute by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 204`, function () {", + " pm.response.to.have.status(204)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "url": { + "raw": "{{URL}}/attributes/{{ATTRIBUTE_ID_FOR_DELETE}}", + "host": [ + "{{URL}}" + ], + "path": [ + "attributes", + "{{ATTRIBUTE_ID_FOR_DELETE}}" + ] + } + }, + "response": [] + }, + { + "name": "delete attribute with all kinds of invalid request", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " if (response.message) {", + " pm.expect(response.message).to.contains(iterationData.get('message'))", + " } else {", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/attributes/{{id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "attributes", + "{{id}}" + ] + } + }, + "response": [] + } + ] + } + ] + }, + { + "name": "user achievements", + "item": [ + { + "name": "search user achievements", + "item": [ + { + "name": "search user achievements with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.json()", + " pm.expect(response.length).to.gte(0)", + " const iterationData = pm.iterationData", + " if (iterationData.get('idLabel')) {", + " const idLabel = iterationData.get('idLabel')", + " pm.environment.set(idLabel, response[0].id)", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/achievements?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "achievements" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search user achievements with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.json()", + " pm.expect(response.length).to.gte(0)", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/achievements?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "achievements" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search user achievements with invalid parameters", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/achievements?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "achievements" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search user achievements with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/achievements", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "achievements" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "head user achievements", + "item": [ + { + "name": "head user achievements with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/achievements?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "achievements" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head user achievements with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/achievements?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "achievements" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head user achievements with invalid parameters", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/achievements?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "achievements" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head user achievements with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/achievements", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "achievements" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "create user achievement", + "item": [ + { + "name": "create user achievement by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " pm.expect(response.createdBy).to.not.eq(null)", + " pm.expect(response.id).to.not.eq(null)", + " pm.expect(response.updatedBy).to.eq(null)", + " if (iterationData.get('expected').name) {", + " pm.expect(response.name).to.eq(iterationData.get('expected').name)", + " }", + " if (iterationData.get('expected').uri) {", + " pm.expect(response.uri).to.eq(iterationData.get('expected').uri)", + " }", + " if (iterationData.get('expected').certifierId) {", + " pm.expect(response.certifierId).to.eq(iterationData.get('expected').certifierId)", + " }", + " if (iterationData.get('expected').certifiedDate) {", + " pm.expect(response.certifiedDate).to.eq(iterationData.get('expected').certifiedDate)", + " }", + "", + " if (iterationData.get('expected').achievementsProviderId) {", + " const achievementsProviderId = iterationData.get('expected').achievementsProviderId", + " if (achievementsProviderId.startsWith('{')) {", + " pm.expect(response.achievementsProviderId).to.eq(pm.environment.get(achievementsProviderId.substr(2, achievementsProviderId.length - 4)))", + " } else {", + " pm.expect(response.achievementsProviderId).to.eq(achievementsProviderId)", + " }", + " }", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/users/{{user_id}}/achievements", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "achievements" + ] + } + }, + "response": [] + }, + { + "name": "create user achievement by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " pm.expect(response.createdBy).to.not.eq(null)", + " pm.expect(response.id).to.not.eq(null)", + " pm.expect(response.updatedBy).to.eq(null)", + " if (iterationData.get('expected').name) {", + " pm.expect(response.name).to.eq(iterationData.get('expected').name)", + " }", + " if (iterationData.get('expected').uri) {", + " pm.expect(response.uri).to.eq(iterationData.get('expected').uri)", + " }", + " if (iterationData.get('expected').certifierId) {", + " pm.expect(response.certifierId).to.eq(iterationData.get('expected').certifierId)", + " }", + " if (iterationData.get('expected').certifiedDate) {", + " pm.expect(response.certifiedDate).to.eq(iterationData.get('expected').certifiedDate)", + " }", + "", + " if (iterationData.get('expected').achievementsProviderId) {", + " const achievementsProviderId = iterationData.get('expected').achievementsProviderId", + " if (achievementsProviderId.startsWith('{')) {", + " pm.expect(response.achievementsProviderId).to.eq(pm.environment.get(achievementsProviderId.substr(2, achievementsProviderId.length - 4)))", + " } else {", + " pm.expect(response.achievementsProviderId).to.eq(achievementsProviderId)", + " }", + " }", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/users/{{user_id}}/achievements", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "achievements" + ] + } + }, + "response": [] + }, + { + "name": "create user achievement with all kinds of invalid request body", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.contains(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/users/{{user_id}}/achievements", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "achievements" + ] + } + }, + "response": [] + }, + { + "name": "create user achievement with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"achievementsProviderId\": \"{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}\",\n \"name\": \"POSTMANE2E-Topcoder-by-ADMIN-009\",\n \"uri\": \"http://some.uri\",\n \"certifierId\": \"certifier id 001\",\n \"certifiedDate\": \"2020-05-04T07:36:28.036Z\"\n}" + }, + "url": { + "raw": "{{URL}}/users/{{user_id}}/achievements", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "achievements" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "get user achievement", + "item": [ + { + "name": "get user achievement with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the achievements provider id should be in the response body", + " pm.expect(response.achievementsProviderId).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " // the user id should be in the response body", + " pm.expect(response.userId).to.eq(pm.request.url.path[pm.request.url.path.length - 3])", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/achievements/{{achievement_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "achievements", + "{{achievement_id}}" + ] + } + }, + "response": [] + }, + { + "name": "get user achievement with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the achievements provider id should be in the response body", + " pm.expect(response.achievementsProviderId).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " // the user id should be in the response body", + " pm.expect(response.userId).to.eq(pm.request.url.path[pm.request.url.path.length - 3])", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/achievements/{{achievement_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "achievements", + "{{achievement_id}}" + ] + } + }, + "response": [] + }, + { + "name": "get user achievement with invalid requests", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.contains(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/achievements/{{achievement_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "achievements", + "{{achievement_id}}" + ] + } + }, + "response": [] + }, + { + "name": "get user achievement with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " if (response.message) {", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + " } else {", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/achievements/{{achievement_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "achievements", + "{{achievement_id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "head user achievement", + "item": [ + { + "name": "head user achievement with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/achievements/{{achievement_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "achievements", + "{{achievement_id}}" + ] + } + }, + "response": [] + }, + { + "name": "head user achievement with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/achievements/{{achievement_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "achievements", + "{{achievement_id}}" + ] + } + }, + "response": [] + }, + { + "name": "head user achievement with invalid requests", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/achievements/{{achievement_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "achievements", + "{{achievement_id}}" + ] + } + }, + "response": [] + }, + { + "name": "head user achievement with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/achievements/{{achievement_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "achievements", + "{{achievement_id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "update user achievement", + "item": [ + { + "name": "patch user achievement by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " pm.expect(response.createdBy).to.not.eq(null)", + " pm.expect(response.id).to.not.eq(null)", + " pm.expect(response.updatedBy).to.not.eq(null)", + " if (iterationData.get('expected').name) {", + " pm.expect(response.name).to.eq(iterationData.get('expected').name)", + " }", + " if (iterationData.get('expected').uri) {", + " pm.expect(response.uri).to.eq(iterationData.get('expected').uri)", + " }", + " if (iterationData.get('expected').certifierId) {", + " pm.expect(response.certifierId).to.eq(iterationData.get('expected').certifierId)", + " }", + " if (iterationData.get('expected').certifiedDate) {", + " pm.expect(response.certifiedDate).to.eq(iterationData.get('expected').certifiedDate)", + " }", + "", + " if (iterationData.get('expected').achievementsProviderId) {", + " const achievementsProviderId = iterationData.get('expected').achievementsProviderId", + " if (achievementsProviderId.startsWith('{')) {", + " pm.expect(response.achievementsProviderId).to.eq(pm.environment.get(achievementsProviderId.substr(2, achievementsProviderId.length - 4)))", + " } else {", + " pm.expect(response.achievementsProviderId).to.eq(achievementsProviderId)", + " }", + " }", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/users/{{user_id}}/achievements/{{achievement_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "achievements", + "{{achievement_id}}" + ] + } + }, + "response": [] + }, + { + "name": "patch user achievement by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " pm.expect(response.createdBy).to.not.eq(null)", + " pm.expect(response.id).to.not.eq(null)", + " pm.expect(response.updatedBy).to.not.eq(null)", + " if (iterationData.get('expected').name) {", + " pm.expect(response.name).to.eq(iterationData.get('expected').name)", + " }", + " if (iterationData.get('expected').uri) {", + " pm.expect(response.uri).to.eq(iterationData.get('expected').uri)", + " }", + " if (iterationData.get('expected').certifierId) {", + " pm.expect(response.certifierId).to.eq(iterationData.get('expected').certifierId)", + " }", + " if (iterationData.get('expected').certifiedDate) {", + " pm.expect(response.certifiedDate).to.eq(iterationData.get('expected').certifiedDate)", + " }", + "", + " if (iterationData.get('expected').achievementsProviderId) {", + " const achievementsProviderId = iterationData.get('expected').achievementsProviderId", + " if (achievementsProviderId.startsWith('{')) {", + " pm.expect(response.achievementsProviderId).to.eq(pm.environment.get(achievementsProviderId.substr(2, achievementsProviderId.length - 4)))", + " } else {", + " pm.expect(response.achievementsProviderId).to.eq(achievementsProviderId)", + " }", + " }", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/users/{{user_id}}/achievements/{{achievement_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "achievements", + "{{achievement_id}}" + ] + } + }, + "response": [] + }, + { + "name": "patch user achievement with invalid request body", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/users/{{user_id}}/achievements/{{achievement_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "achievements", + "{{achievement_id}}" + ] + } + }, + "response": [] + }, + { + "name": "patch user achievement with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/achievements/{{achievement_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "achievements", + "{{achievement_id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "delete user achievement", + "item": [ + { + "name": "delete user achievement by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 204`, function () {", + " pm.response.to.have.status(204)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/achievements/{{achievement_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "achievements", + "{{achievement_id}}" + ] + } + }, + "response": [] + }, + { + "name": "delete user achievement with all kinds of invalid request", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " if (response.message) {", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + " } else {", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/achievements/{{achievement_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "achievements", + "{{achievement_id}}" + ] + } + }, + "response": [] + } + ] + } + ] + }, + { + "name": "organization skill providers", + "item": [ + { + "name": "search organization skillProviders", + "item": [ + { + "name": "search organization skillProviders with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.json()", + " pm.expect(response.length).to.gte(0)", + " const iterationData = pm.iterationData", + " if (iterationData.get('idLabel')) {", + " const idLabel = iterationData.get('idLabel')", + " pm.environment.set(idLabel, response[0].id)", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/organizations/{{organization_id}}/skillProviders?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations", + "{{organization_id}}", + "skillProviders" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search organization skillProviders with various parameters by organization", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.json()", + " pm.expect(response.length).to.gte(0)", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/organizations/{{organization_id}}/skillProviders?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations", + "{{organization_id}}", + "skillProviders" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search organization skillProviders with invalid parameters", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/organizations/{{organization_id}}/skillProviders?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations", + "{{organization_id}}", + "skillProviders" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search organization skillProviders with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/organizations/{{organization_id}}/skillProviders", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations", + "{{organization_id}}", + "skillProviders" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "head organization skillProviders", + "item": [ + { + "name": "head organization skillProviders with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/organizations/{{organization_id}}/skillProviders?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations", + "{{organization_id}}", + "skillProviders" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head organization skillProviders with various parameters by organization", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/organizations/{{organization_id}}/skillProviders?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations", + "{{organization_id}}", + "skillProviders" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head organization skillProviders with invalid parameters", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/organizations/{{organization_id}}/skillProviders?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations", + "{{organization_id}}", + "skillProviders" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head organization skillProviders with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/organizations/{{organization_id}}/skillProviders", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations", + "{{organization_id}}", + "skillProviders" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "create organization skillProvider", + "item": [ + { + "name": "create organization skillProvider by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " pm.expect(response.createdBy).to.not.eq(null)", + " pm.expect(response.id).to.not.eq(null)", + " pm.expect(response.updatedBy).to.eq(null)", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/organizations/{{organization_id}}/skillProviders", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations", + "{{organization_id}}", + "skillProviders" + ] + } + }, + "response": [] + }, + { + "name": "create organization skillProvider by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " pm.expect(response.createdBy).to.not.eq(null)", + " pm.expect(response.id).to.not.eq(null)", + " pm.expect(response.updatedBy).to.eq(null)", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/organizations/{{organization_id}}/skillProviders", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations", + "{{organization_id}}", + "skillProviders" + ] + } + }, + "response": [] + }, + { + "name": "create organization skillProvider with all kinds of invalid request body", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.contains(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/organizations/{{organization_id}}/skillProviders", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations", + "{{organization_id}}", + "skillProviders" + ] + } + }, + "response": [] + }, + { + "name": "create organization skillProvider with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"skillProviderId\":\"{{PROVIDER_ID_BY_ADMIN}}\"\n}" + }, + "url": { + "raw": "{{URL}}/organizations/{{organization_id}}/skillProviders", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations", + "{{organization_id}}", + "skillProviders" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "get organization skillProvider", + "item": [ + { + "name": "get organization skillProvider with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " pm.expect(response.id).to.not.eq(null)", + " // the skillProvider id should be in the response body", + " pm.expect(response.skillProviderId).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " // the organization id should be in the response body", + " pm.expect(response.organizationId).to.eq(pm.request.url.path[pm.request.url.path.length - 3])", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/organizations/{{organization_id}}/skillProviders/{{skillProvider_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations", + "{{organization_id}}", + "skillProviders", + "{{skillProvider_id}}" + ] + } + }, + "response": [] + }, + { + "name": "get organization skillProvider with various parameters by organization", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the id should be in the response body", + " pm.expect(response.id).to.not.eq(null)", + " // the skillProvider id should be in the response body", + " pm.expect(response.skillProviderId).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " // the organization id should be in the response body", + " pm.expect(response.organizationId).to.eq(pm.request.url.path[pm.request.url.path.length - 3])", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/organizations/{{organization_id}}/skillProviders/{{skillProvider_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations", + "{{organization_id}}", + "skillProviders", + "{{skillProvider_id}}" + ] + } + }, + "response": [] + }, + { + "name": "get organization skillProvider with invalid requests", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.contains(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/organizations/{{organization_id}}/skillProviders/{{skillProvider_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations", + "{{organization_id}}", + "skillProviders", + "{{skillProvider_id}}" + ] + } + }, + "response": [] + }, + { + "name": "get organization skillProvider with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " if (response.message) {", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + " } else {", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/organizations/{{organization_id}}/skillProviders/{{skillProvider_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations", + "{{organization_id}}", + "skillProviders", + "{{skillProvider_id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "head organization skillProvider", + "item": [ + { + "name": "head organization skillProvider with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/organizations/{{organization_id}}/skillProviders/{{skillProvider_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations", + "{{organization_id}}", + "skillProviders", + "{{skillProvider_id}}" + ] + } + }, + "response": [] + }, + { + "name": "head organization skillProvider with various parameters by organization", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/organizations/{{organization_id}}/skillProviders/{{skillProvider_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations", + "{{organization_id}}", + "skillProviders", + "{{skillProvider_id}}" + ] + } + }, + "response": [] + }, + { + "name": "head organization skillProvider with invalid requests", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/organizations/{{organization_id}}/skillProviders/{{skillProvider_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations", + "{{organization_id}}", + "skillProviders", + "{{skillProvider_id}}" + ] + } + }, + "response": [] + }, + { + "name": "head organization skillProvider with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/organizations/{{organization_id}}/skillProviders/{{skillProvider_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations", + "{{organization_id}}", + "skillProviders", + "{{skillProvider_id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "delete organization skillProvider", + "item": [ + { + "name": "delete organization skillProvider by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 204`, function () {", + " pm.response.to.have.status(204)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "url": { + "raw": "{{URL}}/organizations/{{organization_id}}/skillProviders/{{skillProvider_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations", + "{{organization_id}}", + "skillProviders", + "{{skillProvider_id}}" + ] + } + }, + "response": [] + }, + { + "name": "delete organization skillProvider with all kinds of invalid request", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " if (response.message) {", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + " } else {", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/organizations/{{organization_id}}/skillProviders/{{skillProvider_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "organizations", + "{{organization_id}}", + "skillProviders", + "{{skillProvider_id}}" + ] + } + }, + "response": [] + } + ] + } + ] + }, + { + "name": "external profiles", + "item": [ + { + "name": "search user externalProfiles", + "item": [ + { + "name": "search user externalProfiles with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.json()", + " pm.expect(response.length).to.gte(0)", + " const iterationData = pm.iterationData", + " if (iterationData.get('idLabel')) {", + " const idLabel = iterationData.get('idLabel')", + " pm.environment.set(idLabel, response[0].id)", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/externalProfiles?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "externalProfiles" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search user externalProfiles with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.json()", + " pm.expect(response.length).to.gte(0)", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/externalProfiles?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "externalProfiles" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search user externalProfiles with invalid parameters", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/externalProfiles?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "externalProfiles" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search user externalProfiles with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/externalProfiles", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "externalProfiles" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "head user externalProfiles", + "item": [ + { + "name": "head user externalProfiles with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/externalProfiles?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "externalProfiles" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head user externalProfiles with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/externalProfiles?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "externalProfiles" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head user externalProfiles with invalid parameters", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/externalProfiles?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "externalProfiles" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head user externalProfiles with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/externalProfiles", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "externalProfiles" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "create user externalProfile", + "item": [ + { + "name": "create user externalProfile by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " pm.expect(response.createdBy).to.not.eq(null)", + " pm.expect(response.id).to.not.eq(null)", + " pm.expect(response.updatedBy).to.eq(null)", + " if (iterationData.get('expected').externalId) {", + " pm.expect(response.externalId).to.eq(iterationData.get('expected').externalId)", + " }", + " if (iterationData.get('expected').uri) {", + " pm.expect(response.uri).to.eq(iterationData.get('expected').uri)", + " }", + " if (iterationData.get('expected').isInactive) {", + " pm.expect(response.isInactive).to.eq(iterationData.get('expected').isInactive)", + " }", + "", + " if (iterationData.get('expected').organizationId) {", + " const organizationId = iterationData.get('expected').organizationId", + " if (organizationId.startsWith('{')) {", + " pm.expect(response.organizationId).to.eq(pm.environment.get(organizationId.substr(2, organizationId.length - 4)))", + " } else {", + " pm.expect(response.organizationId).to.eq(organizationId)", + " }", + " }", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/users/{{user_id}}/externalProfiles", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "externalProfiles" + ] + } + }, + "response": [] + }, + { + "name": "create user externalProfile by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " pm.expect(response.createdBy).to.not.eq(null)", + " pm.expect(response.id).to.not.eq(null)", + " pm.expect(response.updatedBy).to.eq(null)", + " if (iterationData.get('expected').externalId) {", + " pm.expect(response.externalId).to.eq(iterationData.get('expected').externalId)", + " }", + " if (iterationData.get('expected').uri) {", + " pm.expect(response.uri).to.eq(iterationData.get('expected').uri)", + " }", + " if (iterationData.get('expected').isInactive) {", + " pm.expect(response.isInactive).to.eq(iterationData.get('expected').isInactive)", + " }", + "", + " if (iterationData.get('expected').organizationId) {", + " const organizationId = iterationData.get('expected').organizationId", + " if (organizationId.startsWith('{')) {", + " pm.expect(response.organizationId).to.eq(pm.environment.get(organizationId.substr(2, organizationId.length - 4)))", + " } else {", + " pm.expect(response.organizationId).to.eq(organizationId)", + " }", + " }", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/users/{{user_id}}/externalProfiles", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "externalProfiles" + ] + } + }, + "response": [] + }, + { + "name": "create user externalProfile with all kinds of invalid request body", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.contains(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/users/{{user_id}}/externalProfiles", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "externalProfiles" + ] + } + }, + "response": [] + }, + { + "name": "create user externalProfile with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"organizationId\": \"{{ORGANIZATION_ID_BY_ADMIN}}\",\n \"externalId\": \"POSTMANE2E-Topcoder-by-ADMIN-009\"\n}" + }, + "url": { + "raw": "{{URL}}/users/{{user_id}}/externalProfiles", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "externalProfiles" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "get user externalProfile", + "item": [ + { + "name": "get user externalProfile with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the organizationId should be in the response body", + " pm.expect(response.organizationId).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " // the user id should be in the response body", + " pm.expect(response.userId).to.eq(pm.request.url.path[pm.request.url.path.length - 3])", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/externalProfiles/{{organization_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "externalProfiles", + "{{organization_id}}" + ] + } + }, + "response": [] + }, + { + "name": "get user externalProfile with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the organizationId should be in the response body", + " pm.expect(response.organizationId).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " // the user id should be in the response body", + " pm.expect(response.userId).to.eq(pm.request.url.path[pm.request.url.path.length - 3])", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/externalProfiles/{{organization_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "externalProfiles", + "{{organization_id}}" + ] + } + }, + "response": [] + }, + { + "name": "get user externalProfile with invalid requests", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.contains(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/externalProfiles/{{organization_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "externalProfiles", + "{{organization_id}}" + ] + } + }, + "response": [] + }, + { + "name": "get user externalProfile with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " if (response.message) {", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + " } else {", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/externalProfiles/{{organization_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "externalProfiles", + "{{organization_id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "head user externalProfile", + "item": [ + { + "name": "head user externalProfile with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/externalProfiles/{{organization_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "externalProfiles", + "{{organization_id}}" + ] + } + }, + "response": [] + }, + { + "name": "head user externalProfile with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/externalProfiles/{{organization_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "externalProfiles", + "{{organization_id}}" + ] + } + }, + "response": [] + }, + { + "name": "head user externalProfile with invalid requests", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/externalProfiles/{{organization_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "externalProfiles", + "{{organization_id}}" + ] + } + }, + "response": [] + }, + { + "name": "head user externalProfile with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/externalProfiles/{{organization_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "externalProfiles", + "{{organization_id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "update user externalProfile", + "item": [ + { + "name": "patch user externalProfile by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " pm.expect(response.createdBy).to.not.eq(null)", + " pm.expect(response.id).to.not.eq(null)", + " pm.expect(response.updatedBy).to.not.eq(null)", + " if (iterationData.get('expected').externalId) {", + " pm.expect(response.externalId).to.eq(iterationData.get('expected').externalId)", + " }", + " if (iterationData.get('expected').uri) {", + " pm.expect(response.uri).to.eq(iterationData.get('expected').uri)", + " }", + " if (iterationData.get('expected').isInactive) {", + " pm.expect(response.isInactive).to.eq(iterationData.get('expected').isInactive)", + " }", + "", + " if (iterationData.get('expected').organizationId) {", + " const organizationId = iterationData.get('expected').organizationId", + " if (organizationId.startsWith('{')) {", + " pm.expect(response.organizationId).to.eq(pm.environment.get(organizationId.substr(2, organizationId.length - 4)))", + " } else {", + " pm.expect(response.organizationId).to.eq(organizationId)", + " }", + " }", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/users/{{user_id}}/externalProfiles/{{organization_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "externalProfiles", + "{{organization_id}}" + ] + } + }, + "response": [] + }, + { + "name": "patch user externalProfile by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " pm.expect(response.createdBy).to.not.eq(null)", + " pm.expect(response.id).to.not.eq(null)", + " pm.expect(response.updatedBy).to.not.eq(null)", + " if (iterationData.get('expected').externalId) {", + " pm.expect(response.externalId).to.eq(iterationData.get('expected').externalId)", + " }", + " if (iterationData.get('expected').uri) {", + " pm.expect(response.uri).to.eq(iterationData.get('expected').uri)", + " }", + " if (iterationData.get('expected').isInactive) {", + " pm.expect(response.isInactive).to.eq(iterationData.get('expected').isInactive)", + " }", + "", + " if (iterationData.get('expected').organizationId) {", + " const organizationId = iterationData.get('expected').organizationId", + " if (organizationId.startsWith('{')) {", + " pm.expect(response.organizationId).to.eq(pm.environment.get(organizationId.substr(2, organizationId.length - 4)))", + " } else {", + " pm.expect(response.organizationId).to.eq(organizationId)", + " }", + " }", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/users/{{user_id}}/externalProfiles/{{organization_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "externalProfiles", + "{{organization_id}}" + ] + } + }, + "response": [] + }, + { + "name": "patch user externalProfile with invalid request body", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/users/{{user_id}}/externalProfiles/{{organization_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "externalProfiles", + "{{organization_id}}" + ] + } + }, + "response": [] + }, + { + "name": "patch user externalProfile with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/externalProfiles/{{organization_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "externalProfiles", + "{{organization_id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "delete user externalProfile", + "item": [ + { + "name": "delete user externalProfile by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 204`, function () {", + " pm.response.to.have.status(204)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/externalProfiles/{{organization_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "externalProfiles", + "{{organization_id}}" + ] + } + }, + "response": [] + }, + { + "name": "delete user externalProfile with all kinds of invalid request", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " if (response.message) {", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + " } else {", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/externalProfiles/{{organization_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "externalProfiles", + "{{organization_id}}" + ] + } + }, + "response": [] + } + ] + } + ] + }, + { + "name": "user attributes", + "item": [ + { + "name": "search user attributes", + "item": [ + { + "name": "search user attributes with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.json()", + " pm.expect(response.length).to.gte(0)", + " const iterationData = pm.iterationData", + " if (iterationData.get('idLabel')) {", + " const idLabel = iterationData.get('idLabel')", + " pm.environment.set(idLabel, response[0].id)", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/attributes?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "attributes" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search user attributes with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.json()", + " pm.expect(response.length).to.gte(0)", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/attributes?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "attributes" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search user attributes with invalid parameters", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/attributes?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "attributes" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "search user attributes with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/attributes", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "attributes" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "head user attributes", + "item": [ + { + "name": "head user attributes with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/attributes?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "attributes" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head user attributes with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/attributes?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "attributes" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head user attributes with invalid parameters", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/attributes?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "attributes" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "head user attributes with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/attributes", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "attributes" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "create user attribute", + "item": [ + { + "name": "create user attribute by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " pm.expect(response.createdBy).to.not.eq(null)", + " pm.expect(response.id).to.not.eq(null)", + " pm.expect(response.updatedBy).to.eq(null)", + " if (iterationData.get('expected').value) {", + " pm.expect(response.value).to.eq(iterationData.get('expected').value)", + " }", + "", + " if (iterationData.get('expected').attributeId) {", + " const attributeId = iterationData.get('expected').attributeId", + " if (attributeId.startsWith('{')) {", + " pm.expect(response.attributeId).to.eq(pm.environment.get(attributeId.substr(2, attributeId.length - 4)))", + " } else {", + " pm.expect(response.attributeId).to.eq(attributeId)", + " }", + " }", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/users/{{user_id}}/attributes", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "attributes" + ] + } + }, + "response": [] + }, + { + "name": "create user attribute by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " pm.expect(response.createdBy).to.not.eq(null)", + " pm.expect(response.id).to.not.eq(null)", + " pm.expect(response.updatedBy).to.eq(null)", + " if (iterationData.get('expected').value) {", + " pm.expect(response.value).to.eq(iterationData.get('expected').value)", + " }", + "", + " if (iterationData.get('expected').attributeId) {", + " const attributeId = iterationData.get('expected').attributeId", + " if (attributeId.startsWith('{')) {", + " pm.expect(response.attributeId).to.eq(pm.environment.get(attributeId.substr(2, attributeId.length - 4)))", + " } else {", + " pm.expect(response.attributeId).to.eq(attributeId)", + " }", + " }", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/users/{{user_id}}/attributes", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "attributes" + ] + } + }, + "response": [] + }, + { + "name": "create user attribute with all kinds of invalid request body", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.contains(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/users/{{user_id}}/attributes", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "attributes" + ] + } + }, + "response": [] + }, + { + "name": "create user attribute with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"attributeId\": \"{{ATTRIBUTE_ID_BY_ADMIN}}\",\n \"value\": \"POSTMANE2E-Attribute-by-ADMIN-009\"\n}" + }, + "url": { + "raw": "{{URL}}/users/{{user_id}}/attributes", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "attributes" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "get user attribute", + "item": [ + { + "name": "get user attribute with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the attributeId should be in the response body", + " pm.expect(response.attributeId).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " // the user id should be in the response body", + " pm.expect(response.userId).to.eq(pm.request.url.path[pm.request.url.path.length - 3])", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/attributes/{{attribute_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "attributes", + "{{attribute_id}}" + ] + } + }, + "response": [] + }, + { + "name": "get user attribute with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " // the attributeId should be in the response body", + " pm.expect(response.attributeId).to.eq(pm.request.url.path[pm.request.url.path.length - 1])", + " // the user id should be in the response body", + " pm.expect(response.userId).to.eq(pm.request.url.path[pm.request.url.path.length - 3])", + " }", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/attributes/{{attribute_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "attributes", + "{{attribute_id}}" + ] + } + }, + "response": [] + }, + { + "name": "get user attribute with invalid requests", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.contains(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/attributes/{{attribute_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "attributes", + "{{attribute_id}}" + ] + } + }, + "response": [] + }, + { + "name": "get user attribute with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " if (response.message) {", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + " } else {", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/attributes/{{attribute_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "attributes", + "{{attribute_id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "head user attribute", + "item": [ + { + "name": "head user attribute with various parameters by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/attributes/{{attribute_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "attributes", + "{{attribute_id}}" + ] + } + }, + "response": [] + }, + { + "name": "head user attribute with various parameters by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/attributes/{{attribute_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "attributes", + "{{attribute_id}}" + ] + } + }, + "response": [] + }, + { + "name": "head user attribute with invalid requests", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/attributes/{{attribute_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "attributes", + "{{attribute_id}}" + ] + } + }, + "response": [] + }, + { + "name": "head user attribute with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/attributes/{{attribute_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "attributes", + "{{attribute_id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "update user attribute", + "item": [ + { + "name": "patch user attribute by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " pm.expect(response.createdBy).to.not.eq(null)", + " pm.expect(response.id).to.not.eq(null)", + " pm.expect(response.updatedBy).to.not.eq(null)", + " if (iterationData.get('expected').value) {", + " pm.expect(response.value).to.eq(iterationData.get('expected').value)", + " }", + "", + " if (iterationData.get('expected').attributeId) {", + " const attributeId = iterationData.get('expected').attributeId", + " if (attributeId.startsWith('{')) {", + " pm.expect(response.attributeId).to.eq(pm.environment.get(attributeId.substr(2, attributeId.length - 4)))", + " } else {", + " pm.expect(response.attributeId).to.eq(attributeId)", + " }", + " }", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/users/{{user_id}}/attributes/{{attribute_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "attributes", + "{{attribute_id}}" + ] + } + }, + "response": [] + }, + { + "name": "patch user attribute by user", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " if(httpCode === 200){", + " const response = pm.response.json()", + " pm.expect(response.createdBy).to.not.eq(null)", + " pm.expect(response.id).to.not.eq(null)", + " pm.expect(response.updatedBy).to.not.eq(null)", + " if (iterationData.get('expected').value) {", + " pm.expect(response.value).to.eq(iterationData.get('expected').value)", + " }", + "", + " if (iterationData.get('expected').attributeId) {", + " const attributeId = iterationData.get('expected').attributeId", + " if (attributeId.startsWith('{')) {", + " pm.expect(response.attributeId).to.eq(pm.environment.get(attributeId.substr(2, attributeId.length - 4)))", + " } else {", + " pm.expect(response.attributeId).to.eq(attributeId)", + " }", + " }", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{user_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/users/{{user_id}}/attributes/{{attribute_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "attributes", + "{{attribute_id}}" + ] + } + }, + "response": [] + }, + { + "name": "patch user attribute with invalid request body", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/users/{{user_id}}/attributes/{{attribute_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "attributes", + "{{attribute_id}}" + ] + } + }, + "response": [] + }, + { + "name": "patch user attribute with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/attributes/{{attribute_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "attributes", + "{{attribute_id}}" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "delete user attribute", + "item": [ + { + "name": "delete user attribute by admin", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 204`, function () {", + " pm.response.to.have.status(204)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + }, + { + "key": "Content-Type", + "name": "Content-Type", + "type": "text", + "value": "application/json" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/attributes/{{attribute_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "attributes", + "{{attribute_id}}" + ] + } + }, + "response": [] + }, + { + "name": "delete user attribute with all kinds of invalid request", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " if (response.message) {", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + " } else {", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + " }", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/users/{{user_id}}/attributes/{{attribute_id}}", + "host": [ + "{{URL}}" + ], + "path": [ + "users", + "{{user_id}}", + "attributes", + "{{attribute_id}}" + ] + } + }, + "response": [] + } + ] + } + ] + }, + { + "name": "skill search", + "item": [ + { + "name": "skill search users", + "item": [ + { + "name": "skill search users with various parameters", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.json()", + " pm.expect(response.length).to.gte(0)", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/skill-search/users?{{params}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skill-search", + "users" + ], + "query": [ + { + "key": "{{params}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "skill search users with invalid request data", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/skill-search/users?{{params}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skill-search", + "users" + ], + "query": [ + { + "key": "{{params}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "skill search users with invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var inputJSONdata = pm.iterationData.get(\"input\");", + "pm.variables.set(\"input_body\",JSON.stringify(inputJSONdata));" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "body": { + "mode": "raw", + "raw": "{{input_body}}" + }, + "url": { + "raw": "{{URL}}/skill-search/users?{{params}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skill-search", + "users" + ], + "query": [ + { + "key": "{{params}}", + "value": null + } + ] + } + }, + "response": [] + } + ] + }, + { + "name": "skill search user attributes", + "item": [ + { + "name": "skill search user attributes with various parameters", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.json()", + " pm.expect(response.length).to.gte(0)", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/skill-search/userAttributes?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skill-search", + "userAttributes" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "skill search user attributes with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " if (response.message) {", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + " } else {", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + " }", + " ", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/skill-search/userAttributes", + "host": [ + "{{URL}}" + ], + "path": [ + "skill-search", + "userAttributes" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "skill head user attributes", + "item": [ + { + "name": "skill search head user attributes with various parameters", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "value": "Bearer {{admin_token}}", + "type": "text" + } + ], + "url": { + "raw": "{{URL}}/skill-search/userAttributes?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skill-search", + "userAttributes" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "skill search head user attributes with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/skill-search/userAttributes", + "host": [ + "{{URL}}" + ], + "path": [ + "skill-search", + "userAttributes" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "skill search user achievements", + "item": [ + { + "name": "skill search user achievements with various parameters", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.json()", + " pm.expect(response.length).to.gte(0)", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/skill-search/userAttributes?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skill-search", + "userAttributes" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "skill search user achievements with invalid request data", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/skill-search/userAchievements?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skill-search", + "userAchievements" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "skill search user achievements with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " if (response.message) {", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + " } else {", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + " }", + " ", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/skill-search/userAchievements?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skill-search", + "userAchievements" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + } + ] + }, + { + "name": "skill head user achievements", + "item": [ + { + "name": "skill head user achievements with various parameters", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/skill-search/userAttributes?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skill-search", + "userAttributes" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "skill head user achievements with invalid request data", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/skill-search/userAchievements?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skill-search", + "userAchievements" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "skill head user achievements with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/skill-search/userAchievements?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skill-search", + "userAchievements" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + } + ] + }, + { + "name": "skill search user skills", + "item": [ + { + "name": "skill search user skills with various parameters", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.json()", + " pm.expect(response.length).to.gte(0)", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/skill-search/skills?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skill-search", + "skills" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "skill search user skills with invalid request data", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/skill-search/skills?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skill-search", + "skills" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "skill search user skills with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.json()", + " if (response.message) {", + " pm.expect(response.message).to.eq(iterationData.get('message'))", + " } else {", + " pm.expect(response.result.content.message).to.eq(iterationData.get('message'))", + " }", + " ", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/skill-search/skills?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skill-search", + "skills" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + } + ] + }, + { + "name": "skill head user skills", + "item": [ + { + "name": "skill head user skills with various parameters", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/skill-search/skills?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skill-search", + "skills" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "skill head user skills with invalid request data", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode);", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "Bearer {{admin_token}}" + } + ], + "url": { + "raw": "{{URL}}/skill-search/skills?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skill-search", + "skills" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + }, + { + "name": "skill head user skills with all kinds of invalid token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const iterationData = pm.iterationData", + "const httpCode = iterationData.get('httpCode')", + "pm.test(`Status code is ${httpCode}`, function () {", + " pm.response.to.have.status(httpCode)", + " const response = pm.response.text()", + " pm.expect(response).to.eq('')", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "HEAD", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Authorization", + "type": "text", + "value": "{{jwtToken}}" + } + ], + "url": { + "raw": "{{URL}}/skill-search/skills?{{input}}", + "host": [ + "{{URL}}" + ], + "path": [ + "skill-search", + "skills" + ], + "query": [ + { + "key": "{{input}}", + "value": null + } + ] + } + }, + "response": [] + } + ] + } + ] + }, + { + "name": "health", + "item": [ + { + "name": "health", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(`Status code is 200`, function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{URL}}/ubahnapi/health", + "host": [ + "{{URL}}" + ], + "path": [ + "ubahnapi", + "health" + ] + } + }, + "response": [] + } + ] + } + ] +} \ No newline at end of file diff --git a/test/postman/Ubahn-api.postman_environment.json b/test/postman/Ubahn-api.postman_environment.json new file mode 100644 index 0000000..91d26fd --- /dev/null +++ b/test/postman/Ubahn-api.postman_environment.json @@ -0,0 +1,334 @@ +{ + "_": { + "postman_variable_scope": "environment", + "postman_exported_at": "2021-07-29T20:44:55.697Z", + "postman_exported_using": "Newman/5.2.4" + }, + "id": "565af534-d6c4-48d9-8132-eaec6e818fde", + "name": "Ubahn-api", + "values": [ + { + "type": "any", + "value": "http://127.0.0.1:3001/api/1.0", + "key": "URL" + }, + { + "type": "any", + "value": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Ik5VSkZORGd4UlRVME5EWTBOVVkzTlRkR05qTXlRamxETmpOQk5UYzVRVUV3UlRFeU56TTJRUSJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZ1o2anQ1MEhZSExCZjR2aHhqVWhYUFpPUjdRNWxrNGtAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNjI3NTkxMzUyLCJleHAiOjE2Mjc2Nzc3NTIsImF6cCI6ImdaNmp0NTBIWUhMQmY0dmh4alVoWFBaT1I3UTVsazRrIiwic2NvcGUiOiJyZWFkOnVzZXJfaWRwX3Rva2VucyByZWFkOmNoYWxsZW5nZXMgd3JpdGU6Y2hhbGxlbmdlcyBhbGw6Z3JvdXBzIHdyaXRlOmdyb3VwcyByZWFkOmdyb3VwcyByZWFkOnJldmlld190eXBlIHJlYWQ6cmV2aWV3IHdyaXRlOnByb2plY3QgcmVhZDpwcm9qZWN0IHJlYWQ6YnVzX3RvcGljcyB3cml0ZTpidXNfYXBpIHJlYWQ6ZW1haWxfdGVtcGxhdGVzIHJlYWQ6dXNlcl9wcm9maWxlcyByZWFkOnJvbGVzIHJlYWQ6cHJlZmVyZW5jZXMgcmVhZDpwcm9qZWN0LXVzZXIgcmVhZDpwcm9qZWN0LXBlcm1pc3Npb24gcmVhZDpsb29rdXBzIHJlYWQ6cmVzb3VyY2VzIHdyaXRlOnJlc291cmNlcyB1cGRhdGU6cmVzb3VyY2VzIHJlYWQ6dGVybXMgcmVhZDpwcm9qZWN0cyB3cml0ZTpwcm9qZWN0cyByZWFkOnByb2plY3QtbWVtYmVycyB3cml0ZTpwcm9qZWN0LW1lbWJlcnMgcmVhZDphY2hpZXZlbWVudCByZWFkOmFjaGlldmVtZW50c1Byb3ZpZGVyIHJlYWQ6YXR0cmlidXRlIHJlYWQ6YXR0cmlidXRlR3JvdXAgYWxsOmF0dHJpYnV0ZUdyb3VwIGNyZWF0ZTphdHRyaWJ1dGVHcm91cCB1cGRhdGU6YXR0cmlidXRlR3JvdXAgcmVhZDpvcmdhbml6YXRpb24gcmVhZDpyb2xlIHJlYWQ6c2tpbGwgcmVhZDpza2lsbHNQcm92aWRlciByZWFkOnVzZXJBdHRyaWJ1dGUgcmVhZDp1c2Vyc1JvbGUgcmVhZDp1c2Vyc1NraWxsIHJlYWQ6Z3JvdXAgYWxsOmdyb3VwIHVwZGF0ZTpncm91cCBjcmVhdGU6Z3JvdXAgY3JlYXRlOmNoYWxsZW5nZXMgY3JlYXRlOnJlc291cmNlcyByZWFkOnVzZXIgcmVhZDp0YWFzLXRlYW1zIHJlYWQ6dGFhcy1qb2JzIGFsbDp0YWFzLWpvYnMgcmVhZDp0YWFzLWpvYkNhbmRpZGF0ZXMgYWxsOnRhYXMtam9iQ2FuZGlkYXRlcyBhbGw6dGFhcy1yZXNvdXJjZUJvb2tpbmdzIHJlYWQ6cHJvamVjdC1pbnZpdGVzIHdyaXRlOnByb2plY3QtaW52aXRlcyB1cGRhdGU6Y2hhbGxlbmdlcyByZWFkOnRhYXMtd29ya1BlcmlvZFBheW1lbnRzIGNyZWF0ZTp0YWFzLXdvcmtQZXJpb2RQYXltZW50cyB1cGRhdGU6dGFhcy13b3JrUGVyaW9kUGF5bWVudHMgYWxsOnRhYXMtd29ya1BlcmlvZFBheW1lbnRzIHJlYWQ6dGFhcy1pbnRlcnZpZXdzIGNyZWF0ZTp0YWFzLWludGVydmlld3MgdXBkYXRlOnRhYXMtaW50ZXJ2aWV3cyBhbGw6dGFhcy1pbnRlcnZpZXdzIHJlYWQ6dGFhcy13b3JrUGVyaW9kcyBjcmVhdGU6dGFhcy13b3JrUGVyaW9kcyB1cGRhdGU6dGFhcy13b3JrUGVyaW9kcyBhbGw6dGFhcy13b3JrUGVyaW9kcyIsImd0eSI6ImNsaWVudC1jcmVkZW50aWFscyJ9.CWkQnPEZ0fT5QGH3fPJ0dG0UY_kKZcmiEOSZgMZeDcCdAahKFHrUq_E8JyPKvTqLkLdlVj__S_8PfTvvhiJlz7X_6HLge9c_K5xnLpsqkajNOEUgfz4jliKVuDVXwNDUXV0kpguEjB--mUvEj5i93gA96oFybvrrqFPcUi2TzVRnixLyElBX8W7nxBgxXd_xJZPB-GcJWTGJHUR6golb-5HAuj8dKsLOOuk2UdiYeAUFjj6A_BoFRZnAjLTeRoO78kBPr-sjLbIZnHNpN00DH4mcxJQAFu9tUzWyVW0g_Rj4bzJEQiV4BIUhRHuI0X7T9C7hjBTAZoT2kXy5Cc8SIQ", + "key": "m2m_token" + }, + { + "type": "any", + "value": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Ik5VSkZORGd4UlRVME5EWTBOVVkzTlRkR05qTXlRamxETmpOQk5UYzVRVUV3UlRFeU56TTJRUSJ9.eyJpc3MiOiJodHRwczovL3RvcGNvZGVyLWRldi5hdXRoMC5jb20vIiwic3ViIjoiZ1o2anQ1MEhZSExCZjR2aHhqVWhYUFpPUjdRNWxrNGtAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbTJtLnRvcGNvZGVyLWRldi5jb20vIiwiaWF0IjoxNjI3NTkxMzUyLCJleHAiOjE2Mjc2Nzc3NTIsImF6cCI6ImdaNmp0NTBIWUhMQmY0dmh4alVoWFBaT1I3UTVsazRrIiwic2NvcGUiOiJyZWFkOnVzZXJfaWRwX3Rva2VucyByZWFkOmNoYWxsZW5nZXMgd3JpdGU6Y2hhbGxlbmdlcyBhbGw6Z3JvdXBzIHdyaXRlOmdyb3VwcyByZWFkOmdyb3VwcyByZWFkOnJldmlld190eXBlIHJlYWQ6cmV2aWV3IHdyaXRlOnByb2plY3QgcmVhZDpwcm9qZWN0IHJlYWQ6YnVzX3RvcGljcyB3cml0ZTpidXNfYXBpIHJlYWQ6ZW1haWxfdGVtcGxhdGVzIHJlYWQ6dXNlcl9wcm9maWxlcyByZWFkOnJvbGVzIHJlYWQ6cHJlZmVyZW5jZXMgcmVhZDpwcm9qZWN0LXVzZXIgcmVhZDpwcm9qZWN0LXBlcm1pc3Npb24gcmVhZDpsb29rdXBzIHJlYWQ6cmVzb3VyY2VzIHdyaXRlOnJlc291cmNlcyB1cGRhdGU6cmVzb3VyY2VzIHJlYWQ6dGVybXMgcmVhZDpwcm9qZWN0cyB3cml0ZTpwcm9qZWN0cyByZWFkOnByb2plY3QtbWVtYmVycyB3cml0ZTpwcm9qZWN0LW1lbWJlcnMgcmVhZDphY2hpZXZlbWVudCByZWFkOmFjaGlldmVtZW50c1Byb3ZpZGVyIHJlYWQ6YXR0cmlidXRlIHJlYWQ6YXR0cmlidXRlR3JvdXAgYWxsOmF0dHJpYnV0ZUdyb3VwIGNyZWF0ZTphdHRyaWJ1dGVHcm91cCB1cGRhdGU6YXR0cmlidXRlR3JvdXAgcmVhZDpvcmdhbml6YXRpb24gcmVhZDpyb2xlIHJlYWQ6c2tpbGwgcmVhZDpza2lsbHNQcm92aWRlciByZWFkOnVzZXJBdHRyaWJ1dGUgcmVhZDp1c2Vyc1JvbGUgcmVhZDp1c2Vyc1NraWxsIHJlYWQ6Z3JvdXAgYWxsOmdyb3VwIHVwZGF0ZTpncm91cCBjcmVhdGU6Z3JvdXAgY3JlYXRlOmNoYWxsZW5nZXMgY3JlYXRlOnJlc291cmNlcyByZWFkOnVzZXIgcmVhZDp0YWFzLXRlYW1zIHJlYWQ6dGFhcy1qb2JzIGFsbDp0YWFzLWpvYnMgcmVhZDp0YWFzLWpvYkNhbmRpZGF0ZXMgYWxsOnRhYXMtam9iQ2FuZGlkYXRlcyBhbGw6dGFhcy1yZXNvdXJjZUJvb2tpbmdzIHJlYWQ6cHJvamVjdC1pbnZpdGVzIHdyaXRlOnByb2plY3QtaW52aXRlcyB1cGRhdGU6Y2hhbGxlbmdlcyByZWFkOnRhYXMtd29ya1BlcmlvZFBheW1lbnRzIGNyZWF0ZTp0YWFzLXdvcmtQZXJpb2RQYXltZW50cyB1cGRhdGU6dGFhcy13b3JrUGVyaW9kUGF5bWVudHMgYWxsOnRhYXMtd29ya1BlcmlvZFBheW1lbnRzIHJlYWQ6dGFhcy1pbnRlcnZpZXdzIGNyZWF0ZTp0YWFzLWludGVydmlld3MgdXBkYXRlOnRhYXMtaW50ZXJ2aWV3cyBhbGw6dGFhcy1pbnRlcnZpZXdzIHJlYWQ6dGFhcy13b3JrUGVyaW9kcyBjcmVhdGU6dGFhcy13b3JrUGVyaW9kcyB1cGRhdGU6dGFhcy13b3JrUGVyaW9kcyBhbGw6dGFhcy13b3JrUGVyaW9kcyIsImd0eSI6ImNsaWVudC1jcmVkZW50aWFscyJ9.CWkQnPEZ0fT5QGH3fPJ0dG0UY_kKZcmiEOSZgMZeDcCdAahKFHrUq_E8JyPKvTqLkLdlVj__S_8PfTvvhiJlz7X_6HLge9c_K5xnLpsqkajNOEUgfz4jliKVuDVXwNDUXV0kpguEjB--mUvEj5i93gA96oFybvrrqFPcUi2TzVRnixLyElBX8W7nxBgxXd_xJZPB-GcJWTGJHUR6golb-5HAuj8dKsLOOuk2UdiYeAUFjj6A_BoFRZnAjLTeRoO78kBPr-sjLbIZnHNpN00DH4mcxJQAFu9tUzWyVW0g_Rj4bzJEQiV4BIUhRHuI0X7T9C7hjBTAZoT2kXy5Cc8SIQ", + "key": "M2M_TOKEN" + }, + { + "type": "any", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJDb25uZWN0IFN1cHBvcnQiLCJ0ZXN0Um9sZSIsImFhYSIsInRvbnlfdGVzdF8xIiwiQ29ubmVjdCBNYW5hZ2VyIiwiQ29ubmVjdCBBZG1pbiIsImNvcGlsb3QiLCJDb25uZWN0IENvcGlsb3QgTWFuYWdlciIsIlRvcGNvZGVyIFVzZXIiLCJhZG1pbmlzdHJhdG9yIiwidS1iYWhuIiwiYm9va2luZ21hbmFnZXIiXSwiaXNzIjoiaHR0cHM6Ly9hcGkudG9wY29kZXItZGV2LmNvbSIsImhhbmRsZSI6IlRvbnlKIiwiZXhwIjoxNjI3NTkxOTU5LCJ1c2VySWQiOiI4NTQ3ODk5IiwiaWF0IjoxNjI3NTkxMzU5LCJlbWFpbCI6ImFqZWZ0c0B0b3Bjb2Rlci5jb20iLCJqdGkiOiIxMzRhMGRmOC0zODdkLTQ4NzQtODQ3Zi0yZjRmNDYxZTdkNzgifQ.VS-z-IevAB_SmzcTsfayKjZgvGA2d_NNIuow9OABA0I", + "key": "admin_token" + }, + { + "type": "any", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJDb25uZWN0IENvcGlsb3QiLCJjb3BpbG90IiwiVG9wY29kZXIgVXNlciJdLCJpc3MiOiJodHRwczovL2FwaS50b3Bjb2Rlci1kZXYuY29tIiwiaGFuZGxlIjoiVENDb25uQ29waWxvdCIsImV4cCI6MTYyNzU5MTk2NSwidXNlcklkIjoiNDAxNTg5OTQiLCJpYXQiOjE2Mjc1OTEzNjUsImVtYWlsIjoidG9wY29kZXJjb25uZWN0K0NvcGlsb3RAZ21haWwuY29tIiwianRpIjoiMTA0OGYxOWYtMjBiMS00ZDIzLWIyYzAtNmM1NjJkNGM4YjI5In0.HtjKN9g4PfjopsabhSbEz3ZyQBA6TdQ2qlA0adBJmvM", + "key": "manager_token" + }, + { + "type": "any", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJDb25uZWN0IENvcGlsb3QiLCJjb3BpbG90IiwiVG9wY29kZXIgVXNlciJdLCJpc3MiOiJodHRwczovL2FwaS50b3Bjb2Rlci1kZXYuY29tIiwiaGFuZGxlIjoiVENDb25uQ29waWxvdCIsImV4cCI6MTYyNzU5MTk3MCwidXNlcklkIjoiNDAxNTg5OTQiLCJpYXQiOjE2Mjc1OTEzNzAsImVtYWlsIjoidG9wY29kZXJjb25uZWN0K0NvcGlsb3RAZ21haWwuY29tIiwianRpIjoiMGFhY2ZlNDItY2M2NC00N2RiLTlhZmQtMzQyNDQ1YmM5NGI4In0.XU191fqHPEwB3nah5qCS0U7F3THt4oHaxWBD2UmmQqU", + "key": "copilot_token" + }, + { + "type": "any", + "value": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJCdXNpbmVzcyBVc2VyIiwiVG9wY29kZXIgVXNlciJdLCJpc3MiOiJodHRwczovL2FwaS50b3Bjb2Rlci1kZXYuY29tIiwiaGFuZGxlIjoidGNfdGVzdGVyNzc3IiwiZXhwIjoxNjI3NTkxOTc1LCJ1c2VySWQiOiI4ODc3NDYxNSIsImlhdCI6MTYyNzU5MTM3NSwiZW1haWwiOiJ6Ym5vb2JAZ21haWwuY29tIiwianRpIjoiY2EwMWQ1MjgtMWMyOC00ODNiLWEwNjItNjRlZTJiN2YyZThiIn0.dVc5-Ru58ZlyoKhqEP6y9gTPbykzFdh_9TVhPJgDPnI", + "key": "user_token" + }, + { + "type": "any", + "value": { + "user_id": "{{USER_ID_2}}", + "input": { + "handle": "POSTMANE2E-handle02-updated" + }, + "expected": { + "handle": "POSTMANE2E-handle02-updated" + }, + "httpCode": 200 + }, + "key": "0" + }, + { + "type": "any", + "value": { + "user_id": "{{USER_ID_2}}", + "input": { + "firstName": "POSTMANE2E-firstName02-updated" + }, + "expected": { + "firstName": "POSTMANE2E-firstName02-updated" + }, + "httpCode": 200 + }, + "key": "1" + }, + { + "type": "any", + "value": { + "user_id": "{{USER_ID_2}}", + "input": { + "lastName": "POSTMANE2E-lastName02-updated" + }, + "expected": { + "lastName": "POSTMANE2E-lastName02-updated" + }, + "httpCode": 200 + }, + "key": "2" + }, + { + "type": "any", + "value": { + "user_id": "{{USER_ID_2}}", + "input": { + "handle": "POSTMANE2E-handle02-updated1", + "firstName": "POSTMANE2E-firstName02-updated1" + }, + "expected": { + "handle": "POSTMANE2E-handle02-updated1", + "firstName": "POSTMANE2E-firstName02-updated1" + }, + "httpCode": 200 + }, + "key": "3" + }, + { + "type": "any", + "value": { + "user_id": "{{USER_ID_2}}", + "input": { + "handle": "POSTMANE2E-handle02-updated2", + "lastName": "POSTMANE2E-lastName02-updated2" + }, + "expected": { + "handle": "POSTMANE2E-handle02-updated2", + "lastName": "POSTMANE2E-lastName02-updated2" + }, + "httpCode": 200 + }, + "key": "4" + }, + { + "type": "any", + "value": { + "user_id": "{{USER_ID_2}}", + "input": { + "firstName": "POSTMANE2E-firstName02-updated3", + "lastName": "POSTMANE2E-lastName02-updated3" + }, + "expected": { + "firstName": "POSTMANE2E-firstName02-updated3", + "lastName": "POSTMANE2E-lastName02-updated3" + }, + "httpCode": 200 + }, + "key": "5" + }, + { + "type": "any", + "value": { + "user_id": "{{USER_ID_2}}", + "input": { + "handle": "POSTMANE2E-handle02-updated4", + "firstName": "POSTMANE2E-firstName02-updated4", + "lastName": "POSTMANE2E-lastName02-updated4" + }, + "expected": { + "handle": "POSTMANE2E-handle02-updated4", + "firstName": "POSTMANE2E-firstName02-updated4", + "lastName": "POSTMANE2E-lastName02-updated4" + }, + "httpCode": 200 + }, + "key": "6" + }, + { + "type": "any", + "value": { + "input": { + "handle": "POSTMANE2E-valid-handle", + "firstName": "POSTMANE2E-firstName", + "lastName": "POSTMANE2E-lastName", + "aaa": "ccc" + }, + "httpCode": 400, + "message": "\"entity.aaa\" is not allowed" + }, + "key": "7" + }, + { + "type": "any", + "value": { + "input": "handle=POSTMANE2E-Dana_Paucek6", + "idLabel": "USER_ID_3" + }, + "key": "8" + }, + { + "type": "any", + "value": "0bcb0d86-09bb-410a-b2b1-fba90d1a7699", + "key": "USER_ID_1" + }, + { + "type": "any", + "value": "28df7acf-d7b1-467c-8ee5-594c7bace8dc", + "key": "USER_ID_2" + }, + { + "type": "any", + "value": "ef2498f9-7046-4fad-ad85-fc5e4675e693", + "key": "USER_ID_3" + }, + { + "type": "any", + "value": "0bcb0d86-09bb-410a-b2b1-fba90d1a7699", + "key": "USER_ID_BY_ADMIN" + }, + { + "type": "any", + "value": "bdcb113f-6715-40fd-8dab-14aa01327ae9", + "key": "USER_ID_BY_TESTER" + }, + { + "type": "any", + "value": "7637ae1a-3b7c-44eb-a5ed-10ea02f1885d", + "key": "PROVIDER_ID_BY_ADMIN" + }, + { + "type": "any", + "value": "4df1f70b-52e8-4e55-b79b-15ffc2c6a4f6", + "key": "PROVIDER_ID_BY_TESTER" + }, + { + "type": "any", + "value": "0aec2956-cbcb-4c80-8c00-25cc02a71611", + "key": "SKILL_ID_BY_ADMIN" + }, + { + "type": "any", + "value": "9ad4eb94-4029-49ff-b01a-9ac0a964dd35", + "key": "SKILL_ID_BY_TESTER" + }, + { + "type": "any", + "value": "8607ddb3-abf6-4512-a618-c60d4771174b", + "key": "ROLE_ID_BY_ADMIN" + }, + { + "type": "any", + "value": "58fffc97-db2a-48a7-9066-cfc83bbde7b5", + "key": "ROLE_ID_BY_TESTER" + }, + { + "type": "any", + "value": "a866fd95-c2d5-4fa8-b341-a367138c9911", + "key": "ORGANIZATION_ID_BY_ADMIN" + }, + { + "type": "any", + "value": "f1e7cf4d-e688-4037-980e-820f12c822d9", + "key": "ORGANIZATION_ID_BY_TESTER" + }, + { + "type": "any", + "value": "b1b22eba-ba1b-4740-8f70-da607de52ce7", + "key": "ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN" + }, + { + "type": "any", + "value": "1ad72e52-4b44-4634-9c02-4e792c156b43", + "key": "ACHIEVEMENTS_PROVIDER_ID_BY_TESTER" + }, + { + "type": "any", + "value": "03df695f-0b97-4fe3-ae29-17f1aa0addc4", + "key": "ATTRIBUTE_GROUP_ID_BY_ADMIN" + }, + { + "type": "any", + "value": "8599dbcb-7301-46a1-ab23-7b3dfd610f26", + "key": "ATTRIBUTE_GROUP_ID_BY_TESTER" + }, + { + "type": "any", + "value": "5c22a53f-6530-4f92-b934-64cc9b05f1d0", + "key": "ATTRIBUTE_ID_BY_ADMIN" + }, + { + "type": "any", + "value": "a15f160c-5634-4af5-9967-cc4b28bdc94c", + "key": "ATTRIBUTE_ID_BY_TESTER" + }, + { + "type": "any", + "value": "9a771c88-1e57-4a47-bf20-a9a62c118237", + "key": "ACHIEVEMENT_ID_BY_ADMIN" + }, + { + "type": "any", + "value": "6499865c-6cb6-49c1-991f-be95fb03ed56", + "key": "ACHIEVEMENT_ID_BY_TESTER" + }, + { + "type": "any", + "value": "7637ae1a-3b7c-44eb-a5ed-10ea02f1885d", + "key": "SKILL_PROVIDER_ID_1" + }, + { + "type": "any", + "value": "1edf3f25-435d-4d19-ac09-9467a8e6858c", + "key": "SKILL_PROVIDER_ID_2" + }, + { + "type": "any", + "value": "4df1f70b-52e8-4e55-b79b-15ffc2c6a4f6", + "key": "SKILL_PROVIDER_ID_3" + }, + { + "type": "any", + "value": "0de5cb8b-d217-4133-8483-a3a09db9ab3d", + "key": "SKILL_ID_1" + }, + { + "type": "any", + "value": "ab8f01fc-9686-4cc1-9b59-c412b4bae3f2", + "key": "SKILL_ID_2" + }, + { + "type": "any", + "value": "6df99fc1-3115-4b0c-bf2b-21ecd52fa64b", + "key": "SKILL_ID_3" + }, + { + "type": "any", + "value": "8607ddb3-abf6-4512-a618-c60d4771174b", + "key": "ROLE_ID_1" + }, + { + "type": "any", + "value": "e2a52b94-7d59-473c-b0ba-4e2c8f78f3d9", + "key": "ROLE_ID_2" + }, + { + "type": "any", + "value": "58fffc97-db2a-48a7-9066-cfc83bbde7b5", + "key": "ROLE_ID_3" + }, + { + "type": "any", + "value": "3c2fa6d1-c1b8-4550-afb2-cf44e0ab08d9", + "key": "ROLE_ID_FOR_DELETE" + } + ], + "_postman_variable_scope": "environment", + "_postman_exported_at": "2021-07-29T20:45:01.790Z", + "_postman_exported_using": "Newman/5.2.4" +} \ No newline at end of file diff --git a/test/postman/clearTestData.js b/test/postman/clearTestData.js new file mode 100644 index 0000000..3808b5e --- /dev/null +++ b/test/postman/clearTestData.js @@ -0,0 +1,28 @@ +/** + * Clear the postman test data. All data created by postman e2e tests will be cleared. + */ +const logger = require('../../src/common/logger') +const config = require('config') +const envHelper = require('./envHelper') + +logger.info('Clear the Postman test data.') + +/** + * Clear the postman test data. The main function of this class. + * @returns {Promise} + */ +const clearTestData = async () => { + await envHelper.postRequest(`${config.API_BASE_URL}/ubahn/internal/jobs/clean`) +} + +clearTestData().then(() => { + logger.info('Completed!') + process.exit() +}).catch((e) => { + logger.logFullError(e) + process.exit(1) +}) + +module.exports = { + clearTestData +} diff --git a/test/postman/envHelper.js b/test/postman/envHelper.js new file mode 100644 index 0000000..e87a583 --- /dev/null +++ b/test/postman/envHelper.js @@ -0,0 +1,107 @@ +/** + * This file defines methods for getting access tokens + */ + +const _ = require('lodash') +const axios = require('axios') +const config = require('config') +/** + * Get user tokens from V2 API + * @param {String} userName the user name + * @param {String} userPassword the user password + * @returns {Object} the user tokens + */ +async function getUserTokenV2 (userName, userPassword) { + const { data } = await axios({ + method: 'post', + url: config.AUTH_V2_URL, + data: { + username: userName, + password: userPassword, + client_id: config.AUTH_V2_CLIENT_ID, + sso: false, + scope: 'openid profile offline_access', + response_type: 'token', + connection: 'TC-User-Database', + grant_type: 'password', + device: 'Browser' + }, + headers: { + 'cache-control': 'no-cache', + 'content-type': 'application/json' + } + }) + return data +} + +/** + * Get user token from V3 API + * @param {String} idToken the id_token + * @param {String} refreshToken the refresh_token + * @returns {String} the user token + */ +async function getUserTokenV3 (idToken, refreshToken) { + const { data } = await axios({ + method: 'post', + url: config.AUTH_V3_URL, + data: { + param: { + externalToken: idToken, + refreshToken: refreshToken + } + }, + headers: { + 'cache-control': 'no-cache', + authorization: `Bearer ${this.v2_token}`, + 'content-type': 'application/json;charset=UTF-8' + } + }) + return data +} + +/** + * Get admin token from V3 API + * @returns {String} The admin token + */ +async function getAdminToken () { + const v2 = await getUserTokenV2(config.ADMIN_CREDENTIALS_USERNAME, config.ADMIN_CREDENTIALS_PASSWORD) + const v3 = await getUserTokenV3(v2.id_token, v2.refresh_token) + return _.get(v3, 'result.content.token') +} + +/** + * Get regular user token from V3 API + * @returns {String} The user token + */ +async function getUserToken () { + const v2 = await getUserTokenV2(config.USER_CREDENTIALS_USERNAME, config.USER_CREDENTIALS_PASSWORD) + const v3 = await getUserTokenV3(v2.id_token, v2.refresh_token) + return _.get(v3, 'result.content.token') +} + +/** + * Uses axios to proxy post request + * @param {String} url the url + * @param {Object} data the query parameters, optional + * @returns {Object} the response + */ +async function postRequest (url, data) { + const adminToken = await getAdminToken() + const { data: response } = await axios({ + method: 'post', + url, + data, + headers: { + 'cache-control': 'no-cache', + authorization: `Bearer ${adminToken}`, + 'content-type': 'application/json;charset=UTF-8' + } + }) + return response +} + +module.exports = { + getAdminToken, + getUserToken, + postRequest +} diff --git a/test/postman/importData/Achievement.json b/test/postman/importData/Achievement.json new file mode 100644 index 0000000..2435f97 --- /dev/null +++ b/test/postman/importData/Achievement.json @@ -0,0 +1,28 @@ +[ + { + "id": "6499865c-6cb6-49c1-991f-be95fb03ed56", + "created": "2020-05-13T08:44:27.244Z", + "updated": null, + "createdBy": "tc_tester777", + "updatedBy": null, + "achievementsProviderId": "b1b22eba-ba1b-4740-8f70-da607de52ce7", + "name": "POSTMANE2E-Topcoder-by-TESTER", + "uri": "http://www.tc.com", + "certifierId": "certifierId", + "certifiedDate": "2020-05-04T07:36:28.036Z", + "userId": "0bcb0d86-09bb-410a-b2b1-fba90d1a7699" + }, + { + "id": "9a771c88-1e57-4a47-bf20-a9a62c118237", + "created": "2020-05-13T08:44:27.244Z", + "updated": null, + "createdBy": "POSTMANE2E-tc-user", + "updatedBy": null, + "achievementsProviderId": "b1b22eba-ba1b-4740-8f70-da607de52ce7", + "name": "POSTMANE2E-Topcoder-by-ADMIN", + "uri": "http://www.tc.com", + "certifierId": "certifierId", + "certifiedDate": "2020-05-04T07:36:28.036Z", + "userId": "6910d2f4-a50a-4494-8f46-6de1f3d032c2" + } +] diff --git a/test/postman/importData/AchievementsProvider.json b/test/postman/importData/AchievementsProvider.json new file mode 100644 index 0000000..85cd440 --- /dev/null +++ b/test/postman/importData/AchievementsProvider.json @@ -0,0 +1,42 @@ +[ + { + "id": "edd852be-70c8-45d6-9c38-63188d868d67", + "created": "2020-05-13T06:23:54.712Z", + "updated": null, + "createdBy": "POSTMANE2E-tc-Admin", + "updatedBy": null, + "name": "POSTMANE2E-achievementsProviders_01" + }, + { + "id": "ce05133f-129e-484d-9ef9-72bf51ff81f9", + "created": "2020-05-13T08:42:41.877Z", + "updated": null, + "createdBy": "POSTMANE2E-tc-user", + "updatedBy": null, + "name": "POSTMANE2E-achievementsProviders_02" + }, + { + "id": "eb327c00-0090-45af-96d2-593408c96397", + "created": "2020-05-13T06:25:17.458Z", + "updated": "2020-05-13T06:26:56.374Z", + "createdBy": "POSTMANE2E-tc-Admin", + "updatedBy": "tc-Admin", + "name": "POSTMANE2E-achievementsProviders_update" + }, + { + "id": "b1b22eba-ba1b-4740-8f70-da607de52ce7", + "created": "2020-05-13T06:25:17.458Z", + "updated": "2020-05-13T06:26:56.374Z", + "createdBy": "POSTMANE2E-tc-Admin", + "updatedBy": "tc-Admin", + "name": "POSTMANE2E-achievementsProviders_admin" + }, + { + "id": "1ad72e52-4b44-4634-9c02-4e792c156b43", + "created": "2020-05-13T06:25:17.458Z", + "updated": "2020-05-13T06:26:56.374Z", + "createdBy": "tc_tester777", + "updatedBy": "tc-Admin", + "name": "POSTMANE2E-achievementsProviders_tester" + } +] \ No newline at end of file diff --git a/test/postman/importData/Attribute.json b/test/postman/importData/Attribute.json new file mode 100644 index 0000000..c3672f7 --- /dev/null +++ b/test/postman/importData/Attribute.json @@ -0,0 +1,92 @@ +[ + { + "id": "89b3c78f-d71b-4fc6-88cb-701c25e54dac", + "created": "2020-05-13T08:46:39.030Z", + "updated": null, + "createdBy": "POSTMANE2E-tc-user", + "updatedBy": null, + "attributeGroupId": "84634bbd-8191-40cf-a03e-9962d7e39fda", + "name": "POSTMANE2E-isAvailable" + }, + { + "id": "f3fd623f-a613-4e3c-bf2f-9df529ff4317", + "created": "2020-05-13T08:35:45.512Z", + "updated": null, + "createdBy": "POSTMANE2E-tc-Admin", + "updatedBy": null, + "attributeGroupId": "84634bbd-8191-40cf-a03e-9962d7e39fda", + "name": "POSTMANE2E-company" + }, + { + "id": "ed1c98da-1876-49b9-a565-583fafd9cd4c", + "created": "2020-05-13T07:32:03.128Z", + "updated": null, + "createdBy": "POSTMANE2E-tc-Admin", + "updatedBy": null, + "attributeGroupId": "84634bbd-8191-40cf-a03e-9962d7e39fda", + "name": "POSTMANE2E-location" + }, + { + "id": "c44d4bee-1356-46d6-9f1f-991936dec297", + "created": "2020-05-13T07:32:03.128Z", + "updated": null, + "createdBy": "POSTMANE2E-tc-Admin", + "updatedBy": null, + "attributeGroupId": "84634bbd-8191-40cf-a03e-9962d7e39fda", + "name": "POSTMANE2E-title" + }, + { + "id": "d709276a-80c3-491c-9b29-a4f065b2a56f", + "created": "2020-05-13T07:32:03.128Z", + "updated": null, + "createdBy": "POSTMANE2E-tc-Admin", + "updatedBy": null, + "attributeGroupId": "84634bbd-8191-40cf-a03e-9962d7e39fda", + "name": "POSTMANE2E-Billing Account" + }, + { + "id": "09a51576-91ab-4f8e-ac34-36c19d8f4390", + "created": "2020-05-13T07:32:03.128Z", + "updated": null, + "createdBy": "POSTMANE2E-tc-Admin", + "updatedBy": null, + "attributeGroupId": "84634bbd-8191-40cf-a03e-9962d7e39fda", + "name": "POSTMANE2E-Gender" + }, + { + "id": "7b524afa-69ac-49d5-a624-701e4cdc4e92", + "created": "2020-05-13T07:32:03.128Z", + "updated": null, + "createdBy": "POSTMANE2E-tc-Admin", + "updatedBy": null, + "attributeGroupId": "84634bbd-8191-40cf-a03e-9962d7e39fda", + "name": "POSTMANE2E-Experience (in months)" + }, + { + "id": "7bfbf2a8-42bc-4ac0-a90e-ab4b13658d32", + "created": "2020-05-13T07:32:03.128Z", + "updated": null, + "createdBy": "POSTMANE2E-tc-Admin", + "updatedBy": null, + "attributeGroupId": "84634bbd-8191-40cf-a03e-9962d7e39fda", + "name": "POSTMANE2E-On internship" + }, + { + "id": "5c22a53f-6530-4f92-b934-64cc9b05f1d0", + "created": "2020-05-13T07:32:03.128Z", + "updated": null, + "createdBy": "POSTMANE2E-tc-Admin", + "updatedBy": null, + "attributeGroupId": "03df695f-0b97-4fe3-ae29-17f1aa0addc4", + "name": "POSTMANE2E-Group01-by-admin" + }, + { + "id": "a15f160c-5634-4af5-9967-cc4b28bdc94c", + "created": "2020-05-13T07:32:03.128Z", + "updated": null, + "createdBy": "tc_tester777", + "updatedBy": null, + "attributeGroupId": "03df695f-0b97-4fe3-ae29-17f1aa0addc4", + "name": "POSTMANE2E-Group02-by-tester" + } +] diff --git a/test/postman/importData/AttributeGroup.json b/test/postman/importData/AttributeGroup.json new file mode 100644 index 0000000..c8a8001 --- /dev/null +++ b/test/postman/importData/AttributeGroup.json @@ -0,0 +1,38 @@ +[ + { + "id": "7ce54e9c-5a2a-4c63-9f53-b854234f6bb2", + "created": "2020-05-13T08:45:33.291Z", + "updated": null, + "createdBy": "POSTMANE2E-tc-user", + "updatedBy": null, + "organizationId": "6a21394e-1278-4835-9e4d-cb4ff151fcd3", + "name": "POSTMANE2E-attributeGroup_03" + }, + { + "id": "84634bbd-8191-40cf-a03e-9962d7e39fda", + "created": "2020-05-13T07:15:01.215Z", + "updated": "2020-05-13T07:16:20.636Z", + "createdBy": "POSTMANE2E-tc-Admin", + "updatedBy": "tc-Admin", + "organizationId": "36ed815b-3da1-49f1-a043-aaed0a4e81ad", + "name": "POSTMANE2E-group 03" + }, + { + "id": "8599dbcb-7301-46a1-ab23-7b3dfd610f26", + "created": "2020-05-13T07:15:01.215Z", + "updated": "2020-05-13T07:16:20.636Z", + "createdBy": "tc_tester777", + "updatedBy": "tc-Admin", + "organizationId": "a866fd95-c2d5-4fa8-b341-a367138c9911", + "name": "POSTMANE2E-group tester" + }, + { + "id": "03df695f-0b97-4fe3-ae29-17f1aa0addc4", + "created": "2020-05-13T07:15:01.215Z", + "updated": "2020-05-13T07:16:20.636Z", + "createdBy": "POSTMANE2E-tc-Admin", + "updatedBy": "tc-Admin", + "organizationId": "a866fd95-c2d5-4fa8-b341-a367138c9911", + "name": "POSTMANE2E-group admin" + } +] \ No newline at end of file diff --git a/test/postman/importData/ExternalProfile.json b/test/postman/importData/ExternalProfile.json new file mode 100644 index 0000000..fb51a21 --- /dev/null +++ b/test/postman/importData/ExternalProfile.json @@ -0,0 +1,62 @@ +[ + { + "id": "9febace8-b5c7-4fdc-b966-ecb27bca3337", + "created": "2020-05-13T06:11:21.361Z", + "updated": "2020-05-13T06:46:15.893Z", + "createdBy": "POSTMANE2E-tc-Admin", + "updatedBy": "tc-Admin", + "isInactive": false, + "userId": "ce348067-e73f-49d7-af72-fcf11a6c88bf", + "organizationId": "36ed815b-3da1-49f1-a043-aaed0a4e81ad", + "externalId": "1234567", + "uri": "http://www.new.com/new-uri" + }, + { + "id": "f2d1b567-8ea3-4eec-93b0-32378a19edb7", + "created": "2020-05-13T06:11:21.361Z", + "updated": "2020-05-13T06:46:15.893Z", + "createdBy": "POSTMANE2E-tc-Admin", + "updatedBy": "tc-Admin", + "isInactive": false, + "userId": "3f64739e-10bf-42ca-8314-8aea0245cd0f", + "organizationId": "36ed815b-3da1-49f1-a043-aaed0a4e81ad", + "externalId": "8547899", + "uri": "http://www.new.com/new-uri" + }, + { + "id": "f2d1b567-8eb3-4eec-93b0-32378a19edb7", + "created": "2020-05-13T06:11:21.361Z", + "updated": "2020-05-13T06:46:15.893Z", + "createdBy": "POSTMANE2E-tc-Admin", + "updatedBy": "tc-Admin", + "isInactive": false, + "userId": "3f64739e-10bf-42ca-8314-8aea0245cd0f", + "organizationId": "6a21394e-1278-4835-9e4d-cb4ff151fcd3", + "externalId": "23124329", + "uri": "http://www.new.com/new-uri" + }, + { + "id": "906aec65-e9b4-4840-8be8-3c7f4f5f35ff", + "created": "2020-05-13T06:11:21.361Z", + "updated": "2020-05-13T06:46:15.893Z", + "createdBy": "tc_tester777", + "updatedBy": "tc-Admin", + "isInactive": false, + "userId": "0bcb0d86-09bb-410a-b2b1-fba90d1a7699", + "organizationId": "36ed815b-3da1-49f1-a043-aaed0a4e81ad", + "externalId": "7219520", + "uri": "https://janae.name" + }, + { + "id": "116b21c4-cc87-4f61-8510-ebdef7522250", + "created": "2020-05-13T06:11:21.361Z", + "updated": "2020-05-13T06:46:15.893Z", + "createdBy": "POSTMANE2E-tc-Admin", + "updatedBy": "tc-Admin", + "isInactive": false, + "userId": "bdcb113f-6715-40fd-8dab-14aa01327ae9", + "organizationId": "36ed815b-3da1-49f1-a043-aaed0a4e81ad", + "externalId": "8819322", + "uri": "http://jaden.net" + } +] diff --git a/test/postman/importData/Organization.json b/test/postman/importData/Organization.json new file mode 100644 index 0000000..5a209c5 --- /dev/null +++ b/test/postman/importData/Organization.json @@ -0,0 +1,34 @@ +[ + { + "id": "36ed815b-3da1-49f1-a043-aaed0a4e81ad", + "created": "2020-05-05T11:01:31.334Z", + "updated": "2020-05-05T11:02:10.574Z", + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": "tc-Copilot", + "name": "POSTMANE2E-Topcoder" + }, + { + "id": "6a21394e-1278-4835-9e4d-cb4ff151fcd3", + "created": "2020-05-05T11:01:31.334Z", + "updated": "2020-05-05T11:02:10.574Z", + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": "tc-Copilot", + "name": "POSTMANE2E-Cool Party" + }, + { + "id": "a866fd95-c2d5-4fa8-b341-a367138c9911", + "created": "2020-05-05T11:01:31.334Z", + "updated": "2020-05-05T11:02:10.574Z", + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": "tc-Copilot", + "name": "POSTMANE2E-FIFA" + }, + { + "id": "f1e7cf4d-e688-4037-980e-820f12c822d9", + "created": "2020-05-05T11:01:31.334Z", + "updated": "2020-05-05T11:02:10.574Z", + "createdBy": "tc_tester777", + "updatedBy": "tc-Copilot", + "name": "POSTMANE2E-NBA" + } +] diff --git a/test/postman/importData/OrganizationSkillsProvider.json b/test/postman/importData/OrganizationSkillsProvider.json new file mode 100644 index 0000000..7768a2d --- /dev/null +++ b/test/postman/importData/OrganizationSkillsProvider.json @@ -0,0 +1,29 @@ +[ + { + "id": "909da0a2-3c46-4ec9-9a6d-f6f3829fa07a", + "created": "2020-05-05T11:01:31.334Z", + "updated": "2020-05-05T11:02:10.574Z", + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": "tc-Copilot", + "organizationId": "36ed815b-3da1-49f1-a043-aaed0a4e81ad", + "skillProviderId": "7637ae1a-3b7c-44eb-a5ed-10ea02f1885d" + }, + { + "id": "f28f208e-b521-4789-ae63-e1ff11815e8e", + "created": "2020-05-05T11:01:31.334Z", + "updated": "2020-05-05T11:02:10.574Z", + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": "tc-Copilot", + "organizationId": "36ed815b-3da1-49f1-a043-aaed0a4e81ad", + "skillProviderId": "1edf3f25-435d-4d19-ac09-9467a8e6858c" + }, + { + "id": "0b982553-f26c-4596-a5df-6ac37fe0393f", + "created": "2020-05-05T11:01:31.334Z", + "updated": "2020-05-05T11:02:10.574Z", + "createdBy": "tc_tester777", + "updatedBy": "tc-Copilot", + "organizationId": "36ed815b-3da1-49f1-a043-aaed0a4e81ad", + "skillProviderId": "4df1f70b-52e8-4e55-b79b-15ffc2c6a4f6" + } +] diff --git a/test/postman/importData/Role.json b/test/postman/importData/Role.json new file mode 100644 index 0000000..19c271d --- /dev/null +++ b/test/postman/importData/Role.json @@ -0,0 +1,34 @@ +[ + { + "id": "8607ddb3-abf6-4512-a618-c60d4771174b", + "created": "2020-05-05T10:55:53.914Z", + "updated": null, + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": null, + "name": "POSTMANE2E-Admin" + }, + { + "id": "e2a52b94-7d59-473c-b0ba-4e2c8f78f3d9", + "created": "2020-05-05T10:42:37.002Z", + "updated": "2020-05-05T10:45:12.100Z", + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": "tc-Copilot", + "name": "POSTMANE2E-Admin02" + }, + { + "id": "58fffc97-db2a-48a7-9066-cfc83bbde7b5", + "created": "2020-05-05T10:42:37.002Z", + "updated": "2020-05-05T10:45:12.100Z", + "createdBy": "tc_tester777", + "updatedBy": "tc-Copilot", + "name": "POSTMANE2E-User01" + }, + { + "id": "525e2dd9-a2c8-4d91-8daf-3cdbf0d1a188", + "created": "2020-05-05T10:42:37.002Z", + "updated": "2020-05-05T10:45:12.100Z", + "createdBy": "tc_tester777", + "updatedBy": "tc-Copilot", + "name": "POSTMANE2E-User02" + } +] \ No newline at end of file diff --git a/test/postman/importData/Skill.json b/test/postman/importData/Skill.json new file mode 100644 index 0000000..b1e8f09 --- /dev/null +++ b/test/postman/importData/Skill.json @@ -0,0 +1,68 @@ +[ + { + "id": "0de5cb8b-d217-4133-8483-a3a09db9ab3d", + "created": "2020-05-05T11:03:56.711Z", + "updated": "2020-05-05T11:04:25.798Z", + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": "tc-Copilot", + "skillProviderId": "7637ae1a-3b7c-44eb-a5ed-10ea02f1885d", + "name": "POSTMANE2E-.NET Framework 4", + "externalId": "KS126XR63RKYVCKYDNBN", + "uri": "http://www.google.com" + }, + { + "id": "0aec2956-cbcb-4c80-8c00-25cc02a71611", + "created": "2020-05-05T11:03:56.711Z", + "updated": "2020-05-05T11:04:25.798Z", + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": "tc-Copilot", + "skillProviderId": "7637ae1a-3b7c-44eb-a5ed-10ea02f1885d", + "name": "POSTMANE2E-C++ (Programming Language)", + "externalId": "KS1219W70LY1GXZDSKW5", + "uri": "http://www.google.com" + }, + { + "id": "ab8f01fc-9686-4cc1-9b59-c412b4bae3f2", + "created": "2020-05-05T11:03:56.711Z", + "updated": "2020-05-05T11:04:25.798Z", + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": "tc-Copilot", + "skillProviderId": "7637ae1a-3b7c-44eb-a5ed-10ea02f1885d", + "name": "POSTMANE2E-Angular (Web Framework)", + "externalId": "KS120H6772VQ0MQ5RLVD", + "uri": "http://www.google.com" + }, + { + "id": "6df99fc1-3115-4b0c-bf2b-21ecd52fa64b", + "created": "2020-05-05T11:03:56.711Z", + "updated": "2020-05-05T11:04:25.798Z", + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": "tc-Copilot", + "skillProviderId": "7637ae1a-3b7c-44eb-a5ed-10ea02f1885d", + "name": "POSTMANE2E-Python (Programming Language)", + "externalId": "KS125LS6N7WP4S6SFTCK", + "uri": "http://www.google.com" + }, + { + "id": "9ad4eb94-4029-49ff-b01a-9ac0a964dd35", + "created": "2020-05-05T11:03:56.711Z", + "updated": "2020-05-05T11:04:25.798Z", + "createdBy": "tc_tester777", + "updatedBy": "tc-Copilot", + "skillProviderId": "7637ae1a-3b7c-44eb-a5ed-10ea02f1885d", + "name": "POSTMANE2E-Skill-test", + "externalId": "POSTMANE2E", + "uri": "http://www.google.com" + }, + { + "id": "c8f94001-2c3e-4008-b706-97db74b4369b", + "created": "2020-05-05T11:03:56.711Z", + "updated": "2020-05-05T11:04:25.798Z", + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": "tc-Copilot", + "skillProviderId": "7637ae1a-3b7c-44eb-a5ed-10ea02f1885d", + "name": "POSTMANE2E-TOBEDELETED", + "externalId": "abcddeleted", + "uri": "http://www.google.com" + } +] diff --git a/test/postman/importData/SkillsProvider.json b/test/postman/importData/SkillsProvider.json new file mode 100644 index 0000000..3377d2e --- /dev/null +++ b/test/postman/importData/SkillsProvider.json @@ -0,0 +1,34 @@ +[ + { + "id": "7637ae1a-3b7c-44eb-a5ed-10ea02f1885d", + "created": "2020-05-05T11:02:49.718Z", + "updated": null, + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": null, + "name": "POSTMANE2E-Skill-1" + }, + { + "id": "1edf3f25-435d-4d19-ac09-9467a8e6858c", + "created": "2020-05-05T11:02:49.718Z", + "updated": null, + "createdBy": "tc_tester777", + "updatedBy": null, + "name": "POSTMANE2E-Skill-2" + }, + { + "id": "4df1f70b-52e8-4e55-b79b-15ffc2c6a4f6", + "created": "2020-05-05T11:02:49.718Z", + "updated": null, + "createdBy": "tc_tester777", + "updatedBy": null, + "name": "POSTMANE2E-Skill-3" + }, + { + "id": "1a9e404b-e9ad-4d88-a5d7-16b06c8ce749", + "created": "2020-05-05T11:02:49.718Z", + "updated": null, + "createdBy": "tc_tester777", + "updatedBy": null, + "name": "POSTMANE2E-Sk" + } +] diff --git a/test/postman/importData/User.json b/test/postman/importData/User.json new file mode 100644 index 0000000..6e2624c --- /dev/null +++ b/test/postman/importData/User.json @@ -0,0 +1,255 @@ +[ + { + "id": "ce348067-e73f-49d7-af72-fcf11a6c88bf", + "created": "2020-05-05T10:33:03.470Z", + "updated": "2020-05-05T10:40:48.900Z", + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": "tc-Copilot", + "handle": "POSTMANE2E-tc-Admin", + "firstName": "John", + "lastName": "Doe" + }, { + "id": "0bcb0d86-09bb-410a-b2b1-fba90d1a7699", + "created": "2020-05-05T10:18:03.882Z", + "updated": null, + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": null, + "handle": "POSTMANE2E-lazybaer", + "firstName": "Christopher", + "lastName": "DeLaurentis" + }, { + "id": "3f64739e-10bf-42ca-8314-8aea0245cd0f", + "created": "2020-05-05T10:18:03.882Z", + "updated": null, + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": null, + "handle": "POSTMANE2E-TonyJ", + "firstName": "Tony", + "lastName": "J" + }, { + "id": "ecec4ad8-3a1d-4646-8641-25054e8f2d33", + "created": "2020-05-05T10:33:03.470Z", + "updated": "2020-05-05T10:40:48.900Z", + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": "tc-Copilot", + "handle": "POSTMANE2E-Bernadine17", + "firstName": "Elmore", + "lastName": "Sanford" + }, { + "id": "7d93ee11-b4e9-415e-9a6f-aff458d6f975", + "created": "2020-05-05T10:33:03.470Z", + "updated": "2020-05-05T10:40:48.900Z", + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": "tc-Copilot", + "handle": "POSTMANE2E-Drew54", + "firstName": "Jonathan", + "lastName": "Lueilwitz" + }, { + "id": "df2f0027-f74f-45fa-85cd-84c9fdc2faf4", + "created": "2020-05-05T10:33:03.470Z", + "updated": "2020-05-05T10:40:48.900Z", + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": "tc-Copilot", + "handle": "POSTMANE2E-Marvin_Weimann68", + "firstName": "Naomie", + "lastName": "Rogahn" + }, { + "id": "e043286d-ab55-44e3-b2c2-7f7a4f375dcf", + "created": "2020-05-05T10:33:03.470Z", + "updated": "2020-05-05T10:40:48.900Z", + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": "tc-Copilot", + "handle": "POSTMANE2E-Olga4", + "firstName": "Fernando", + "lastName": "Weimann" + }, { + "id": "0f8e52c1-33fd-48f2-b160-415c2bb371f2", + "created": "2020-05-05T10:33:03.470Z", + "updated": "2020-05-05T10:40:48.900Z", + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": "tc-Copilot", + "handle": "POSTMANE2E-Theresia.Ledner29", + "firstName": "Katelynn", + "lastName": "Casper" + }, { + "id": "06f130d0-0764-4894-bcd8-67e2758b15d9", + "created": "2020-05-05T10:33:03.470Z", + "updated": "2020-05-05T10:40:48.900Z", + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": "tc-Copilot", + "handle": "POSTMANE2E-America6", + "firstName": "Garrett", + "lastName": "Boyle" + }, { + "id": "e02d66c9-01d6-4cd8-9f8c-30e40315adcc", + "created": "2020-05-05T10:33:03.470Z", + "updated": "2020-05-05T10:40:48.900Z", + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": "tc-Copilot", + "handle": "POSTMANE2E-Rollin_Stiedemann45", + "firstName": "Jakob", + "lastName": "Kris" + }, { + "id": "35ec01c0-d650-4cd9-8a05-848c9019873d", + "created": "2020-05-05T10:33:03.470Z", + "updated": "2020-05-05T10:40:48.900Z", + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": "tc-Copilot", + "handle": "POSTMANE2E-Verna.Stracke", + "firstName": "Sandy", + "lastName": "Davis" + }, { + "id": "4f2dc463-e24b-4b4a-8cde-c0122fbfb8ac", + "created": "2020-05-05T10:33:03.470Z", + "updated": "2020-05-05T10:40:48.900Z", + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": "tc-Copilot", + "handle": "POSTMANE2E-Demond39", + "firstName": "Domenic", + "lastName": "Casper" + }, { + "id": "28df7acf-d7b1-467c-8ee5-594c7bace8dc", + "created": "2020-05-05T10:33:03.470Z", + "updated": "2020-05-05T10:40:48.900Z", + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": "tc-Copilot", + "handle": "POSTMANE2E-Sylvan_Gorczany", + "firstName": "Samara", + "lastName": "Schultz" + }, { + "id": "ef2498f9-7046-4fad-ad85-fc5e4675e693", + "created": "2020-05-05T10:33:03.470Z", + "updated": "2020-05-05T10:40:48.900Z", + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": "tc-Copilot", + "handle": "POSTMANE2E-Dana_Paucek6", + "firstName": "Carroll", + "lastName": "Vandervort" + }, { + "id": "f0df47fc-2b1f-44ad-bd38-1ada036ba4d9", + "created": "2020-05-05T10:33:03.470Z", + "updated": "2020-05-05T10:40:48.900Z", + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": "tc-Copilot", + "handle": "POSTMANE2E-Pauline_Bernier", + "firstName": "Sandra", + "lastName": "Fay" + }, { + "id": "3f8d1ed0-531a-4695-bfc9-f7beda034a66", + "created": "2020-05-05T10:33:03.470Z", + "updated": "2020-05-05T10:40:48.900Z", + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": "tc-Copilot", + "handle": "POSTMANE2E-Tavares_Bechtelar95", + "firstName": "Brady", + "lastName": "Swift" + }, { + "id": "05301625-4a45-4cf9-b93c-cd6b55ed9f74", + "created": "2020-05-05T10:33:03.470Z", + "updated": "2020-05-05T10:40:48.900Z", + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": "tc-Copilot", + "handle": "POSTMANE2E-Adrian.Stehr23", + "firstName": "Reymundo", + "lastName": "Armstrong" + }, { + "id": "460bddcd-3580-4f2a-bfe8-5ba6d8f6f6af", + "created": "2020-05-05T10:33:03.470Z", + "updated": "2020-05-05T10:40:48.900Z", + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": "tc-Copilot", + "handle": "POSTMANE2E-Lourdes0", + "firstName": "Larissa", + "lastName": "Sporer" + }, { + "id": "cdaeb417-e400-4df1-b484-f99ae10b4800", + "created": "2020-05-05T10:33:03.470Z", + "updated": "2020-05-05T10:40:48.900Z", + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": "tc-Copilot", + "handle": "POSTMANE2E-Leilani_Fahey35", + "firstName": "Godfrey", + "lastName": "Morar" + }, { + "id": "e283eb2e-bfb7-43a6-a06d-ed89af338a4f", + "created": "2020-05-05T10:33:03.470Z", + "updated": "2020-05-05T10:40:48.900Z", + "createdBy": "tc-Copilot", + "updatedBy": "tc-Copilot", + "handle": "POSTMANE2E-Jaclyn47", + "firstName": "Braeden", + "lastName": "Kuhic" + }, { + "id": "6fa6d708-68a6-47be-9591-4b5100921b3a", + "created": "2020-05-05T10:33:03.470Z", + "updated": "2020-05-05T10:40:48.900Z", + "createdBy": "tc-Copilot", + "updatedBy": "tc-Copilot", + "handle": "POSTMANE2E-Kian.DuBuque", + "firstName": "Myles", + "lastName": "Connelly" + }, { + "id": "f8bf2ba2-0e21-47c7-9410-4596b61c6403", + "created": "2020-05-05T10:33:03.470Z", + "updated": "2020-05-05T10:40:48.900Z", + "createdBy": "tc-Copilot", + "updatedBy": "tc-Copilot", + "handle": "POSTMANE2E-Adrain26", + "firstName": "Maryam", + "lastName": "Satterfield" + }, { + "id": "5bd69a82-c2cb-476f-9462-0883d3b28b90", + "created": "2020-05-05T10:33:03.470Z", + "updated": "2020-05-05T10:40:48.900Z", + "createdBy": "tc-Copilot", + "updatedBy": "tc-Copilot", + "handle": "POSTMANE2E-Sandrine_Kuvalis98", + "firstName": "Mekhi", + "lastName": "Tremblay" + }, { + "id": "428a5d57-558c-4387-bada-6c966eb3b4bd", + "created": "2020-05-05T10:33:03.470Z", + "updated": "2020-05-05T10:40:48.900Z", + "createdBy": "tc-Copilot", + "updatedBy": "tc-Copilot", + "handle": "POSTMANE2E-Rebeka75", + "firstName": "Bud", + "lastName": "Kihn" + }, { + "id": "6910d2f4-a50a-4494-8f46-6de1f3d032c2", + "created": "2020-05-05T10:33:03.470Z", + "updated": "2020-05-05T10:40:48.900Z", + "createdBy": "tc-Copilot", + "updatedBy": "tc-Copilot", + "handle": "POSTMANE2E-Aditya65", + "firstName": "Clemens", + "lastName": "Rodriguez" + }, { + "id": "7e3f962a-378a-4f18-9cc7-ffbcff7f9b35", + "created": "2020-05-05T10:33:03.470Z", + "updated": "2020-05-05T10:40:48.900Z", + "createdBy": "tc-Copilot", + "updatedBy": "tc-Copilot", + "handle": "POSTMANE2E-Alexandra_Mertz85", + "firstName": "Chadrick", + "lastName": "Shields" + }, { + "id": "60166f39-6652-4366-a1b7-7eeb72860637", + "created": "2020-05-05T10:33:03.470Z", + "updated": "2020-05-05T10:40:48.900Z", + "createdBy": "tc-Copilot", + "updatedBy": "tc-Copilot", + "handle": "POSTMANE2E-Laisha_Terry86", + "firstName": "Augusta", + "lastName": "Torp" + }, { + "id": "bdcb113f-6715-40fd-8dab-14aa01327ae9", + "created": "2020-05-05T10:33:03.470Z", + "updated": "2020-05-05T10:40:48.900Z", + "createdBy": "tc_tester777", + "updatedBy": "tc_tester777", + "handle": "POSTMANE2E-Ida.Ankunding", + "firstName": "Mckenna", + "lastName": "Collier" + } +] diff --git a/test/postman/importData/UserAttribute.json b/test/postman/importData/UserAttribute.json new file mode 100644 index 0000000..373ca92 --- /dev/null +++ b/test/postman/importData/UserAttribute.json @@ -0,0 +1,32 @@ +[ + { + "id": "20721207-c868-4ee4-8ac4-59db683b7bce", + "created": "2020-05-13T08:48:30.541Z", + "updated": null, + "createdBy": "tc_tester777", + "updatedBy": null, + "attributeId": "89b3c78f-d71b-4fc6-88cb-701c25e54dac", + "value": "false", + "userId": "0bcb0d86-09bb-410a-b2b1-fba90d1a7699" + }, + { + "id": "efcbd4a7-4e1c-4109-8fac-50a1d6d5b7df", + "created": "2020-05-13T08:19:13.709Z", + "updated": null, + "createdBy": "tc_tester777", + "updatedBy": null, + "attributeId": "ed1c98da-1876-49b9-a565-583fafd9cd4c", + "value": "London", + "userId": "0bcb0d86-09bb-410a-b2b1-fba90d1a7699" + }, + { + "id": "cd28194f-c3a9-4445-bef0-ea411996cc93", + "created": "2020-05-13T08:19:13.709Z", + "updated": null, + "createdBy": "tc_tester777", + "updatedBy": null, + "attributeId": "f3fd623f-a613-4e3c-bf2f-9df529ff4317", + "value": "Bulwark International Inc", + "userId": "0bcb0d86-09bb-410a-b2b1-fba90d1a7699" + } +] diff --git a/test/postman/importData/UsersRole.json b/test/postman/importData/UsersRole.json new file mode 100644 index 0000000..9f7aa1a --- /dev/null +++ b/test/postman/importData/UsersRole.json @@ -0,0 +1,20 @@ +[ + { + "id": "977d66bb-112f-49b1-8b20-2ef7a17f4943", + "created": "2020-05-05T11:00:05.664Z", + "updated": "2020-05-05T11:00:38.750Z", + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": "tc-Copilot", + "userId": "ce348067-e73f-49d7-af72-fcf11a6c88bf", + "roleId": "8607ddb3-abf6-4512-a618-c60d4771174b" + }, + { + "id": "75b30af0-46df-4cf6-97ed-3a5608516f4a", + "created": "2020-05-05T11:00:05.664Z", + "updated": "2020-05-05T11:00:38.750Z", + "createdBy": "tc_tester777", + "updatedBy": "tc-Copilot", + "userId": "df2f0027-f74f-45fa-85cd-84c9fdc2faf4", + "roleId": "8607ddb3-abf6-4512-a618-c60d4771174b" + } +] \ No newline at end of file diff --git a/test/postman/importData/UsersSkill.json b/test/postman/importData/UsersSkill.json new file mode 100644 index 0000000..50aa3ad --- /dev/null +++ b/test/postman/importData/UsersSkill.json @@ -0,0 +1,134 @@ +[ + { + "id": "952d5f60-153c-466e-b4e9-8d5b91cc78c4", + "created": "2020-05-05T11:04:51.134Z", + "updated": "2020-05-05T11:05:13.574Z", + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": "tc-Copilot", + "skillId": "0de5cb8b-d217-4133-8483-a3a09db9ab3d", + "metricValue": "4.5L", + "certifierId": "POSTMANE2E-certifier_id", + "certifiedDate": "2020-05-04T07:36:28.036Z", + "userId": "0bcb0d86-09bb-410a-b2b1-fba90d1a7699" + }, + { + "id": "dab98c8c-8bdc-4946-9a47-4f972540f88f", + "created": "2020-05-05T11:04:51.134Z", + "updated": "2020-05-05T11:05:13.574Z", + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": "tc-Copilot", + "skillId": "0aec2956-cbcb-4c80-8c00-25cc02a71611", + "metricValue": "4.5L", + "certifierId": "POSTMANE2E-certifier_id", + "certifiedDate": "2020-05-04T07:36:28.036Z", + "userId": "0bcb0d86-09bb-410a-b2b1-fba90d1a7699" + }, + { + "id": "9027f0ed-0fcf-415b-8c18-a9d22acaa83f", + "created": "2020-05-05T11:04:51.134Z", + "updated": "2020-05-05T11:05:13.574Z", + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": "tc-Copilot", + "skillId": "ab8f01fc-9686-4cc1-9b59-c412b4bae3f2", + "metricValue": "4.5L", + "certifierId": "POSTMANE2E-certifier_id", + "certifiedDate": "2020-05-04T07:36:28.036Z", + "userId": "0bcb0d86-09bb-410a-b2b1-fba90d1a7699" + }, + { + "id": "35ec5d07-81c8-4087-9ab1-ac5d56ae9685", + "created": "2020-05-05T11:04:51.134Z", + "updated": "2020-05-05T11:05:13.574Z", + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": "tc-Copilot", + "skillId": "ab8f01fc-9686-4cc1-9b59-c412b4bae3f2", + "metricValue": "4.5L", + "certifierId": "POSTMANE2E-certifier_id", + "certifiedDate": "2020-05-04T07:36:28.036Z", + "userId": "ce348067-e73f-49d7-af72-fcf11a6c88bf" + }, + { + "id": "0253fe94-5436-4235-b630-8b04038da58b", + "created": "2020-05-05T11:04:51.134Z", + "updated": "2020-05-05T11:05:13.574Z", + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": "tc-Copilot", + "skillId": "6df99fc1-3115-4b0c-bf2b-21ecd52fa64b", + "metricValue": "4.5L", + "certifierId": "POSTMANE2E-certifier_id", + "certifiedDate": "2020-05-04T07:36:28.036Z", + "userId": "ce348067-e73f-49d7-af72-fcf11a6c88bf" + }, + { + "id": "f7a1348c-2b66-45e2-9754-63174f73ef54", + "created": "2020-05-05T11:04:51.134Z", + "updated": "2020-05-05T11:05:13.574Z", + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": "tc-Copilot", + "skillId": "0de5cb8b-d217-4133-8483-a3a09db9ab3d", + "metricValue": "4.5L", + "certifierId": "POSTMANE2E-certifier_id", + "certifiedDate": "2020-05-04T07:36:28.036Z", + "userId": "ecec4ad8-3a1d-4646-8641-25054e8f2d33" + }, + { + "id": "f5a04415-d077-480d-b07a-b34411000f6b", + "created": "2020-05-05T11:04:51.134Z", + "updated": "2020-05-05T11:05:13.574Z", + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": "tc-Copilot", + "skillId": "0de5cb8b-d217-4133-8483-a3a09db9ab3d", + "metricValue": "4.5L", + "certifierId": "POSTMANE2E-certifier_id", + "certifiedDate": "2020-05-04T07:36:28.036Z", + "userId": "7d93ee11-b4e9-415e-9a6f-aff458d6f975" + }, + { + "id": "5fc0e9b5-9c59-4a52-9c35-c40843e700a3", + "created": "2020-05-05T11:04:51.134Z", + "updated": "2020-05-05T11:05:13.574Z", + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": "tc-Copilot", + "skillId": "0aec2956-cbcb-4c80-8c00-25cc02a71611", + "metricValue": "4.5L", + "certifierId": "POSTMANE2E-certifier_id", + "certifiedDate": "2020-05-04T07:36:28.036Z", + "userId": "7d93ee11-b4e9-415e-9a6f-aff458d6f975" + }, + { + "id": "ff3f1cb6-41d9-4442-ad60-fa8a691d5157", + "created": "2020-05-05T11:04:51.134Z", + "updated": "2020-05-05T11:05:13.574Z", + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": "tc-Copilot", + "skillId": "0de5cb8b-d217-4133-8483-a3a09db9ab3d", + "metricValue": "4.5L", + "certifierId": "POSTMANE2E-certifier_id", + "certifiedDate": "2020-05-04T07:36:28.036Z", + "userId": "df2f0027-f74f-45fa-85cd-84c9fdc2faf4" + }, + { + "id": "e8d8c734-9a69-47ed-a4d8-2512ab5e6ad2", + "created": "2020-05-05T11:04:51.134Z", + "updated": "2020-05-05T11:05:13.574Z", + "createdBy": "POSTMANE2E-tc-Copilot", + "updatedBy": "tc-Copilot", + "skillId": "0aec2956-cbcb-4c80-8c00-25cc02a71611", + "metricValue": "4.5L", + "certifierId": "POSTMANE2E-certifier_id", + "certifiedDate": "2020-05-04T07:36:28.036Z", + "userId": "7e3f962a-378a-4f18-9cc7-ffbcff7f9b35" + }, + { + "id": "487bf55b-1bc5-4533-bedf-9af70f1622f6", + "created": "2020-05-05T11:04:51.134Z", + "updated": "2020-05-05T11:05:13.574Z", + "createdBy": "tc_tester777", + "updatedBy": "tc-Copilot", + "skillId": "0de5cb8b-d217-4133-8483-a3a09db9ab3d", + "metricValue": "4.5L", + "certifierId": "POSTMANE2E-certifier_id", + "certifiedDate": "2020-05-04T07:36:28.036Z", + "userId": "60166f39-6652-4366-a1b7-7eeb72860637" + } +] diff --git a/test/postman/insert-postman-data.js b/test/postman/insert-postman-data.js new file mode 100644 index 0000000..fe4f240 --- /dev/null +++ b/test/postman/insert-postman-data.js @@ -0,0 +1,31 @@ +const sequelize = require('../../src/models/index') +const logger = require('../../src/common/logger') + +const models = sequelize.models + +const dataKeys = ['User', 'Organization', 'AchievementsProvider', 'Achievement', + 'AttributeGroup', 'Attribute', 'ExternalProfile', 'SkillsProvider', + 'OrganizationSkillsProvider', 'Role', 'Skill', 'UserAttribute', 'UsersRole', 'UsersSkill'] + +/** + * import seed importData + */ +async function main () { + for (const key of dataKeys) { + try { + const records = require(`./importData/${key}.json`) + await models[key].bulkCreate(records) + logger.info(`import data for ${key} done, record count: ${records.length}`) + } catch (e) { + logger.error(e) + logger.warn(`import data for ${key} failed`) + throw e + } + } + logger.info('all done') + process.exit(0) +} + +(async () => { + main().catch(err => console.error(err)) +})() diff --git a/test/postman/newman.js b/test/postman/newman.js new file mode 100644 index 0000000..25aa50a --- /dev/null +++ b/test/postman/newman.js @@ -0,0 +1,1543 @@ +const config = require('config') +const apiTestLib = require('tc-api-testing-lib') +const envHelper = require('./envHelper') +const logger = require('../../src/common/logger') + +const requests = [ + { + folder: 'search users with various parameters by admin', + iterationData: require('./testData/user/search-users-with-various-parameters.json') + }, + { + folder: 'search users with various parameters by user', + iterationData: require('./testData/user/search-users-with-various-parameters.json') + }, + { + folder: 'search users with invalid parameters', + iterationData: require('./testData/user/search-users-with-invalid-parameters.json') + }, + { + folder: 'search users with all kinds of invalid token', + iterationData: require('./testData/user/search-users-with-invalid-tokens.json') + }, + { + folder: 'head users with various parameters by admin', + iterationData: require('./testData/user/search-users-with-various-parameters.json') + }, + { + folder: 'head users with various parameters by user', + iterationData: require('./testData/user/search-users-with-various-parameters.json') + }, + { + folder: 'head users with invalid parameters', + iterationData: require('./testData/user/search-users-with-invalid-parameters.json') + }, + { + folder: 'head users with all kinds of invalid token', + iterationData: require('./testData/user/search-users-with-invalid-tokens.json') + }, + { + folder: 'create user by admin', + iterationData: require('./testData/user/create-user-by-admin.json') + }, + { + folder: 'create user by user', + iterationData: require('./testData/user/create-user-by-user.json') + }, + { + folder: 'create user with all kinds of invalid request body', + iterationData: require('./testData/user/create-user-with-invalid-data.json') + }, + { + folder: 'create user with all kinds of invalid token', + iterationData: require('./testData/user/create-user-with-invalid-tokens.json') + }, + { + folder: 'get user with various parameters by admin', + iterationData: require('./testData/user/get-user-by-admin.json') + }, + { + folder: 'get user with various parameters by user', + iterationData: require('./testData/user/get-user-by-user.json') + }, + { + folder: 'get user with invalid requests', + iterationData: require('./testData/user/get-user-with-invalid-parameters.json') + }, + { + folder: 'get user with all kinds of invalid token', + iterationData: require('./testData/user/get-user-with-invalid-tokens.json') + }, + { + folder: 'head user with various parameters by admin', + iterationData: require('./testData/user/get-user-by-admin.json') + }, + { + folder: 'head user with various parameters by user', + iterationData: require('./testData/user/get-user-by-user.json') + }, + { + folder: 'head user with invalid requests', + iterationData: require('./testData/user/get-user-with-invalid-parameters.json') + }, + { + folder: 'head user with all kinds of invalid token', + iterationData: require('./testData/user/get-user-with-invalid-tokens.json') + }, + { + folder: 'patch user by admin', + iterationData: require('./testData/user/patch-user-with-any-fields-by-admin.json') + }, + { + folder: 'patch user by user', + iterationData: require('./testData/user/patch-user-with-any-fields-by-user.json') + }, + { + folder: 'patch user with invalid request body', + iterationData: require('./testData/user/patch-user-with-invalid-data.json') + }, + { + folder: 'patch user with all kinds of invalid token', + iterationData: require('./testData/user/patch-user-with-invalid-tokens.json') + }, + { + folder: 'delete user by admin', + iterationData: require('./testData/user/delete-user-by-admin.json') + }, + { + folder: 'delete user with all kinds of invalid token', + iterationData: require('./testData/user/delete-user-with-invalid-tokens.json') + }, + + { + folder: 'search skill providers with various parameters by admin', + iterationData: require('./testData/skill-provider/search-skill-providers-with-various-parameters.json') + }, + { + folder: 'search skill providers with various parameters by user', + iterationData: require('./testData/skill-provider/search-skill-providers-with-various-parameters.json') + }, + { + folder: 'search skill providers with invalid parameters', + iterationData: require('./testData/skill-provider/search-skill-providers-with-invalid-parameters.json') + }, + { + folder: 'search skill providers with all kinds of invalid token', + iterationData: require('./testData/skill-provider/search-skill-providers-with-invalid-tokens.json') + }, + { + folder: 'head skill providers with various parameters by admin', + iterationData: require('./testData/skill-provider/search-skill-providers-with-various-parameters.json') + }, + { + folder: 'head skill providers with various parameters by user', + iterationData: require('./testData/skill-provider/search-skill-providers-with-various-parameters.json') + }, + { + folder: 'head skill providers with invalid parameters', + iterationData: require('./testData/skill-provider/search-skill-providers-with-invalid-parameters.json') + }, + { + folder: 'head skill providers with all kinds of invalid token', + iterationData: require('./testData/skill-provider/search-skill-providers-with-invalid-tokens.json') + }, + { + folder: 'create skill provider by admin', + iterationData: require('./testData/skill-provider/create-skill-provider-by-admin.json') + }, + { + folder: 'create skill provider by user', + iterationData: require('./testData/skill-provider/create-skill-provider-by-user.json') + }, + { + folder: 'create skill provider with all kinds of invalid request body', + iterationData: require('./testData/skill-provider/create-skill-provider-with-invalid-data.json') + }, + { + folder: 'create skill provider with all kinds of invalid token', + iterationData: require('./testData/skill-provider/create-skill-provider-with-invalid-tokens.json') + }, + { + folder: 'get skill provider with various parameters by admin', + iterationData: require('./testData/skill-provider/get-skill-provider-by-admin.json') + }, + { + folder: 'get skill provider with various parameters by user', + iterationData: require('./testData/skill-provider/get-skill-provider-by-user.json') + }, + { + folder: 'get skill provider with invalid requests', + iterationData: require('./testData/skill-provider/get-skill-provider-with-invalid-parameters.json') + }, + { + folder: 'get skill provider with all kinds of invalid token', + iterationData: require('./testData/skill-provider/get-skill-provider-with-invalid-tokens.json') + }, + { + folder: 'head skill provider with various parameters by admin', + iterationData: require('./testData/skill-provider/get-skill-provider-by-admin.json') + }, + { + folder: 'head skill provider with various parameters by user', + iterationData: require('./testData/skill-provider/get-skill-provider-by-user.json') + }, + { + folder: 'head skill provider with invalid requests', + iterationData: require('./testData/skill-provider/get-skill-provider-with-invalid-parameters.json') + }, + { + folder: 'head skill provider with all kinds of invalid token', + iterationData: require('./testData/skill-provider/get-skill-provider-with-invalid-tokens.json') + }, + { + folder: 'patch skill provider by admin', + iterationData: require('./testData/skill-provider/patch-skill-provider-with-any-fields-by-admin.json') + }, + { + folder: 'patch skill provider by user', + iterationData: require('./testData/skill-provider/patch-skill-provider-with-any-fields-by-user.json') + }, + { + folder: 'patch skill provider with invalid request body', + iterationData: require('./testData/skill-provider/patch-skill-provider-with-invalid-data.json') + }, + { + folder: 'patch skill provider with all kinds of invalid token', + iterationData: require('./testData/skill-provider/patch-skill-provider-with-invalid-tokens.json') + }, + { + folder: 'delete skill provider by admin', + iterationData: require('./testData/skill-provider/delete-skill-provider-by-admin.json') + }, + { + folder: 'delete skill provider with all kinds of invalid request', + iterationData: require('./testData/skill-provider/delete-skill-provider-with-invalid-request.json') + }, + + { + folder: 'search skills with various parameters by admin', + iterationData: require('./testData/skill/search-skills-with-various-parameters.json') + }, + { + folder: 'search skills with various parameters by user', + iterationData: require('./testData/skill/search-skills-with-various-parameters.json') + }, + { + folder: 'search skills with invalid parameters', + iterationData: require('./testData/skill/search-skills-with-invalid-parameters.json') + }, + { + folder: 'search skills with all kinds of invalid token', + iterationData: require('./testData/skill/search-skills-with-invalid-tokens.json') + }, + { + folder: 'head skills with various parameters by admin', + iterationData: require('./testData/skill/search-skills-with-various-parameters.json') + }, + { + folder: 'head skills with various parameters by user', + iterationData: require('./testData/skill/search-skills-with-various-parameters.json') + }, + { + folder: 'head skills with invalid parameters', + iterationData: require('./testData/skill/search-skills-with-invalid-parameters.json') + }, + { + folder: 'head skills with all kinds of invalid token', + iterationData: require('./testData/skill/search-skills-with-invalid-tokens.json') + }, + { + folder: 'create skill by admin', + iterationData: require('./testData/skill/create-skill-by-admin.json') + }, + { + folder: 'create skill by user', + iterationData: require('./testData/skill/create-skill-by-user.json') + }, + { + folder: 'create skill with all kinds of invalid request body', + iterationData: require('./testData/skill/create-skill-with-invalid-data.json') + }, + { + folder: 'create skill with all kinds of invalid token', + iterationData: require('./testData/skill/create-skill-with-invalid-tokens.json') + }, + { + folder: 'get skill with various parameters by admin', + iterationData: require('./testData/skill/get-skill-by-admin.json') + }, + { + folder: 'get skill with various parameters by user', + iterationData: require('./testData/skill/get-skill-by-user.json') + }, + { + folder: 'get skill with invalid requests', + iterationData: require('./testData/skill/get-skill-with-invalid-parameters.json') + }, + { + folder: 'get skill with all kinds of invalid token', + iterationData: require('./testData/skill/get-skill-with-invalid-tokens.json') + }, + { + folder: 'head skill with various parameters by admin', + iterationData: require('./testData/skill/get-skill-by-admin.json') + }, + { + folder: 'head skill with various parameters by user', + iterationData: require('./testData/skill/get-skill-by-user.json') + }, + { + folder: 'head skill with invalid requests', + iterationData: require('./testData/skill/get-skill-with-invalid-parameters.json') + }, + { + folder: 'head skill with all kinds of invalid token', + iterationData: require('./testData/skill/get-skill-with-invalid-tokens.json') + }, + { + folder: 'patch skill by admin', + iterationData: require('./testData/skill/patch-skill-with-any-fields-by-admin.json') + }, + { + folder: 'patch skill by user', + iterationData: require('./testData/skill/patch-skill-with-any-fields-by-user.json') + }, + { + folder: 'patch skill with invalid request body', + iterationData: require('./testData/skill/patch-skill-with-invalid-data.json') + }, + { + folder: 'patch skill with all kinds of invalid token', + iterationData: require('./testData/skill/patch-skill-with-invalid-tokens.json') + }, + { + folder: 'delete skill by admin', + iterationData: require('./testData/skill/delete-skill-by-admin.json') + }, + { + folder: 'delete skill with all kinds of invalid request', + iterationData: require('./testData/skill/delete-skill-with-invalid-request.json') + }, + + { + folder: 'search user skills with various parameters by admin', + iterationData: require('./testData/user-skill/search-user-skills-with-various-parameters.json') + }, + { + folder: 'search user skills with various parameters by user', + iterationData: require('./testData/user-skill/search-user-skills-with-various-parameters.json') + }, + { + folder: 'search user skills with invalid parameters', + iterationData: require('./testData/user-skill/search-user-skills-with-invalid-parameters.json') + }, + { + folder: 'search user skills with all kinds of invalid token', + iterationData: require('./testData/user-skill/search-user-skills-with-invalid-tokens.json') + }, + { + folder: 'head user skills with various parameters by admin', + iterationData: require('./testData/user-skill/search-user-skills-with-various-parameters.json') + }, + { + folder: 'head user skills with various parameters by user', + iterationData: require('./testData/user-skill/search-user-skills-with-various-parameters.json') + }, + { + folder: 'head user skills with invalid parameters', + iterationData: require('./testData/user-skill/search-user-skills-with-invalid-parameters.json') + }, + { + folder: 'head user skills with all kinds of invalid token', + iterationData: require('./testData/user-skill/search-user-skills-with-invalid-tokens.json') + }, + { + folder: 'create user skill by admin', + iterationData: require('./testData/user-skill/create-user-skill-by-admin.json') + }, + { + folder: 'create user skill by user', + iterationData: require('./testData/user-skill/create-user-skill-by-user.json') + }, + { + folder: 'create user skill with all kinds of invalid request body', + iterationData: require('./testData/user-skill/create-user-skill-with-invalid-data.json') + }, + { + folder: 'create user skill with all kinds of invalid token', + iterationData: require('./testData/user-skill/create-user-skill-with-invalid-tokens.json') + }, + { + folder: 'get user skill with various parameters by admin', + iterationData: require('./testData/user-skill/get-user-skill-by-admin.json') + }, + { + folder: 'get user skill with various parameters by user', + iterationData: require('./testData/user-skill/get-user-skill-by-user.json') + }, + { + folder: 'get user skill with invalid requests', + iterationData: require('./testData/user-skill/get-user-skill-with-invalid-parameters.json') + }, + { + folder: 'get user skill with all kinds of invalid token', + iterationData: require('./testData/user-skill/get-user-skill-with-invalid-tokens.json') + }, + { + folder: 'head user skill with various parameters by admin', + iterationData: require('./testData/user-skill/get-user-skill-by-admin.json') + }, + { + folder: 'head user skill with various parameters by user', + iterationData: require('./testData/user-skill/get-user-skill-by-user.json') + }, + { + folder: 'head user skill with invalid requests', + iterationData: require('./testData/user-skill/get-user-skill-with-invalid-parameters.json') + }, + { + folder: 'head user skill with all kinds of invalid token', + iterationData: require('./testData/user-skill/get-user-skill-with-invalid-tokens.json') + }, + { + folder: 'patch user skill by admin', + iterationData: require('./testData/user-skill/patch-user-skill-with-any-fields-by-admin.json') + }, + { + folder: 'patch user skill by user', + iterationData: require('./testData/user-skill/patch-user-skill-with-any-fields-by-user.json') + }, + { + folder: 'patch user skill with invalid request body', + iterationData: require('./testData/user-skill/patch-user-skill-with-invalid-data.json') + }, + { + folder: 'patch user skill with all kinds of invalid token', + iterationData: require('./testData/user-skill/patch-user-skill-with-invalid-tokens.json') + }, + { + folder: 'delete user skill by admin' + }, + { + folder: 'delete user skill with all kinds of invalid request', + iterationData: require('./testData/user-skill/delete-user-skill-with-invalid-request.json') + }, + + { + folder: 'search roles with various parameters by admin', + iterationData: require('./testData/role/search-roles-with-various-parameters.json') + }, + { + folder: 'search roles with various parameters by user', + iterationData: require('./testData/role/search-roles-with-various-parameters.json') + }, + { + folder: 'search roles with invalid parameters', + iterationData: require('./testData/role/search-roles-with-invalid-parameters.json') + }, + { + folder: 'search roles with all kinds of invalid token', + iterationData: require('./testData/role/search-roles-with-invalid-tokens.json') + }, + { + folder: 'head roles with various parameters by admin', + iterationData: require('./testData/role/search-roles-with-various-parameters.json') + }, + { + folder: 'head roles with various parameters by user', + iterationData: require('./testData/role/search-roles-with-various-parameters.json') + }, + { + folder: 'head roles with invalid parameters', + iterationData: require('./testData/role/search-roles-with-invalid-parameters.json') + }, + { + folder: 'head roles with all kinds of invalid token', + iterationData: require('./testData/role/search-roles-with-invalid-tokens.json') + }, + { + folder: 'create role by admin', + iterationData: require('./testData/role/create-role-by-admin.json') + }, + { + folder: 'create role by user', + iterationData: require('./testData/role/create-role-by-user.json') + }, + { + folder: 'create role with all kinds of invalid request body', + iterationData: require('./testData/role/create-role-with-invalid-data.json') + }, + { + folder: 'create role with all kinds of invalid token', + iterationData: require('./testData/role/create-role-with-invalid-tokens.json') + }, + { + folder: 'get role with various parameters by admin', + iterationData: require('./testData/role/get-role-by-admin.json') + }, + { + folder: 'get role with various parameters by user', + iterationData: require('./testData/role/get-role-by-user.json') + }, + { + folder: 'get role with invalid requests', + iterationData: require('./testData/role/get-role-with-invalid-parameters.json') + }, + { + folder: 'get role with all kinds of invalid token', + iterationData: require('./testData/role/get-role-with-invalid-tokens.json') + }, + { + folder: 'head role with various parameters by admin', + iterationData: require('./testData/role/get-role-by-admin.json') + }, + { + folder: 'head role with various parameters by user', + iterationData: require('./testData/role/get-role-by-user.json') + }, + { + folder: 'head role with invalid requests', + iterationData: require('./testData/role/get-role-with-invalid-parameters.json') + }, + { + folder: 'head role with all kinds of invalid token', + iterationData: require('./testData/role/get-role-with-invalid-tokens.json') + }, + { + folder: 'patch role by admin', + iterationData: require('./testData/role/patch-role-with-any-fields-by-admin.json') + }, + { + folder: 'patch role by user', + iterationData: require('./testData/role/patch-role-with-any-fields-by-user.json') + }, + { + folder: 'patch role with invalid request body', + iterationData: require('./testData/role/patch-role-with-invalid-data.json') + }, + { + folder: 'patch role with all kinds of invalid token', + iterationData: require('./testData/role/patch-role-with-invalid-tokens.json') + }, + { + folder: 'delete role by admin', + iterationData: require('./testData/role/delete-role-by-admin.json') + }, + { + folder: 'delete role with all kinds of invalid request', + iterationData: require('./testData/role/delete-role-with-invalid-request.json') + }, + + { + folder: 'search user roles with various parameters by admin', + iterationData: require('./testData/user-role/search-user-roles-with-various-parameters.json') + }, + { + folder: 'search user roles with various parameters by user', + iterationData: require('./testData/user-role/search-user-roles-with-various-parameters.json') + }, + { + folder: 'search user roles with invalid parameters', + iterationData: require('./testData/user-role/search-user-roles-with-invalid-parameters.json') + }, + { + folder: 'search user roles with all kinds of invalid token', + iterationData: require('./testData/user-role/search-user-roles-with-invalid-tokens.json') + }, + { + folder: 'head user roles with various parameters by admin', + iterationData: require('./testData/user-role/search-user-roles-with-various-parameters.json') + }, + { + folder: 'head user roles with various parameters by user', + iterationData: require('./testData/user-role/search-user-roles-with-various-parameters.json') + }, + { + folder: 'head user roles with invalid parameters', + iterationData: require('./testData/user-role/search-user-roles-with-invalid-parameters.json') + }, + { + folder: 'head user roles with all kinds of invalid token', + iterationData: require('./testData/user-role/search-user-roles-with-invalid-tokens.json') + }, + { + folder: 'create user role by admin', + iterationData: require('./testData/user-role/create-user-role-by-admin.json') + }, + { + folder: 'create user role by user', + iterationData: require('./testData/user-role/create-user-role-by-user.json') + }, + { + folder: 'create user role with all kinds of invalid request body', + iterationData: require('./testData/user-role/create-user-role-with-invalid-data.json') + }, + { + folder: 'create user role with all kinds of invalid token', + iterationData: require('./testData/user-role/create-user-role-with-invalid-tokens.json') + }, + { + folder: 'get user role with various parameters by admin', + iterationData: require('./testData/user-role/get-user-role-by-admin.json') + }, + { + folder: 'get user role with various parameters by user', + iterationData: require('./testData/user-role/get-user-role-by-user.json') + }, + { + folder: 'get user role with invalid requests', + iterationData: require('./testData/user-role/get-user-role-with-invalid-parameters.json') + }, + { + folder: 'get user role with all kinds of invalid token', + iterationData: require('./testData/user-role/get-user-role-with-invalid-tokens.json') + }, + { + folder: 'head user role with various parameters by admin', + iterationData: require('./testData/user-role/get-user-role-by-admin.json') + }, + { + folder: 'head user role with various parameters by user', + iterationData: require('./testData/user-role/get-user-role-by-user.json') + }, + { + folder: 'head user role with invalid requests', + iterationData: require('./testData/user-role/get-user-role-with-invalid-parameters.json') + }, + { + folder: 'head user role with all kinds of invalid token', + iterationData: require('./testData/user-role/get-user-role-with-invalid-tokens.json') + }, + { + folder: 'delete user role by admin' + }, + { + folder: 'delete user role with all kinds of invalid request', + iterationData: require('./testData/user-role/delete-user-role-with-invalid-request.json') + }, + + { + folder: 'search organizations with various parameters by admin', + iterationData: require('./testData/organization/search-organizations-with-various-parameters.json') + }, + { + folder: 'search organizations with various parameters by user', + iterationData: require('./testData/organization/search-organizations-with-various-parameters.json') + }, + { + folder: 'search organizations with invalid parameters', + iterationData: require('./testData/organization/search-organizations-with-invalid-parameters.json') + }, + { + folder: 'search organizations with all kinds of invalid token', + iterationData: require('./testData/organization/search-organizations-with-invalid-tokens.json') + }, + { + folder: 'head organizations with various parameters by admin', + iterationData: require('./testData/organization/search-organizations-with-various-parameters.json') + }, + { + folder: 'head organizations with various parameters by user', + iterationData: require('./testData/organization/search-organizations-with-various-parameters.json') + }, + { + folder: 'head organizations with invalid parameters', + iterationData: require('./testData/organization/search-organizations-with-invalid-parameters.json') + }, + { + folder: 'head organizations with all kinds of invalid token', + iterationData: require('./testData/organization/search-organizations-with-invalid-tokens.json') + }, + { + folder: 'create organization by admin', + iterationData: require('./testData/organization/create-organization-by-admin.json') + }, + { + folder: 'create organization by user', + iterationData: require('./testData/organization/create-organization-by-user.json') + }, + { + folder: 'create organization with all kinds of invalid request body', + iterationData: require('./testData/organization/create-organization-with-invalid-data.json') + }, + { + folder: 'create organization with all kinds of invalid token', + iterationData: require('./testData/organization/create-organization-with-invalid-tokens.json') + }, + { + folder: 'get organization with various parameters by admin', + iterationData: require('./testData/organization/get-organization-by-admin.json') + }, + { + folder: 'get organization with various parameters by user', + iterationData: require('./testData/organization/get-organization-by-user.json') + }, + { + folder: 'get organization with invalid requests', + iterationData: require('./testData/organization/get-organization-with-invalid-parameters.json') + }, + { + folder: 'get organization with all kinds of invalid token', + iterationData: require('./testData/organization/get-organization-with-invalid-tokens.json') + }, + { + folder: 'head organization with various parameters by admin', + iterationData: require('./testData/organization/get-organization-by-admin.json') + }, + { + folder: 'head organization with various parameters by user', + iterationData: require('./testData/organization/get-organization-by-user.json') + }, + { + folder: 'head organization with invalid requests', + iterationData: require('./testData/organization/get-organization-with-invalid-parameters.json') + }, + { + folder: 'head organization with all kinds of invalid token', + iterationData: require('./testData/organization/get-organization-with-invalid-tokens.json') + }, + { + folder: 'patch organization by admin', + iterationData: require('./testData/organization/patch-organization-with-any-fields-by-admin.json') + }, + { + folder: 'patch organization by user', + iterationData: require('./testData/organization/patch-organization-with-any-fields-by-user.json') + }, + { + folder: 'patch organization with invalid request body', + iterationData: require('./testData/organization/patch-organization-with-invalid-data.json') + }, + { + folder: 'patch organization with all kinds of invalid token', + iterationData: require('./testData/organization/patch-organization-with-invalid-tokens.json') + }, + { + folder: 'delete organization by admin' + }, + { + folder: 'delete organization with all kinds of invalid request', + iterationData: require('./testData/organization/delete-organization-with-invalid-request.json') + }, + + { + folder: 'search achievementsProviders with various parameters by admin', + iterationData: require('./testData/achievements-provider/search-achievements-providers-with-various-parameters.json') + }, + { + folder: 'search achievementsProviders with various parameters by user', + iterationData: require('./testData/achievements-provider/search-achievements-providers-with-various-parameters.json') + }, + { + folder: 'search achievementsProviders with invalid parameters', + iterationData: require('./testData/achievements-provider/search-achievements-providers-with-invalid-parameters.json') + }, + { + folder: 'search achievementsProviders with all kinds of invalid token', + iterationData: require('./testData/achievements-provider/search-achievements-providers-with-invalid-tokens.json') + }, + { + folder: 'head achievementsProviders with various parameters by admin', + iterationData: require('./testData/achievements-provider/search-achievements-providers-with-various-parameters.json') + }, + { + folder: 'head achievementsProviders with various parameters by user', + iterationData: require('./testData/achievements-provider/search-achievements-providers-with-various-parameters.json') + }, + { + folder: 'head achievementsProviders with invalid parameters', + iterationData: require('./testData/achievements-provider/search-achievements-providers-with-invalid-parameters.json') + }, + { + folder: 'head achievementsProviders with all kinds of invalid token', + iterationData: require('./testData/achievements-provider/search-achievements-providers-with-invalid-tokens.json') + }, + { + folder: 'create achievementsProvider by admin', + iterationData: require('./testData/achievements-provider/create-achievements-provider-by-admin.json') + }, + { + folder: 'create achievementsProvider by user', + iterationData: require('./testData/achievements-provider/create-achievements-provider-by-user.json') + }, + { + folder: 'create achievementsProvider with all kinds of invalid request body', + iterationData: require('./testData/achievements-provider/create-achievements-provider-with-invalid-data.json') + }, + { + folder: 'create achievementsProvider with all kinds of invalid token', + iterationData: require('./testData/achievements-provider/create-achievements-provider-with-invalid-tokens.json') + }, + { + folder: 'get achievementsProvider with various parameters by admin', + iterationData: require('./testData/achievements-provider/get-achievements-provider-by-admin.json') + }, + { + folder: 'get achievementsProvider with various parameters by user', + iterationData: require('./testData/achievements-provider/get-achievements-provider-by-user.json') + }, + { + folder: 'get achievementsProvider with invalid requests', + iterationData: require('./testData/achievements-provider/get-achievements-provider-with-invalid-parameters.json') + }, + { + folder: 'get achievementsProvider with all kinds of invalid token', + iterationData: require('./testData/achievements-provider/get-achievements-provider-with-invalid-tokens.json') + }, + { + folder: 'head achievementsProvider with various parameters by admin', + iterationData: require('./testData/achievements-provider/get-achievements-provider-by-admin.json') + }, + { + folder: 'head achievementsProvider with various parameters by user', + iterationData: require('./testData/achievements-provider/get-achievements-provider-by-user.json') + }, + { + folder: 'head achievementsProvider with invalid requests', + iterationData: require('./testData/achievements-provider/get-achievements-provider-with-invalid-parameters.json') + }, + { + folder: 'head achievementsProvider with all kinds of invalid token', + iterationData: require('./testData/achievements-provider/get-achievements-provider-with-invalid-tokens.json') + }, + { + folder: 'patch achievementsProvider by admin', + iterationData: require('./testData/achievements-provider/patch-achievements-provider-with-any-fields-by-admin.json') + }, + { + folder: 'patch achievementsProvider by user', + iterationData: require('./testData/achievements-provider/patch-achievements-provider-with-any-fields-by-user.json') + }, + { + folder: 'patch achievementsProvider with invalid request body', + iterationData: require('./testData/achievements-provider/patch-achievements-provider-with-invalid-data.json') + }, + { + folder: 'patch achievementsProvider with all kinds of invalid token', + iterationData: require('./testData/achievements-provider/patch-achievements-provider-with-invalid-tokens.json') + }, + { + folder: 'delete achievementsProvider by admin' + }, + { + folder: 'delete achievementsProvider with all kinds of invalid request', + iterationData: require('./testData/achievements-provider/delete-achievements-provider-with-invalid-request.json') + }, + + { + folder: 'search attributeGroups with various parameters by admin', + iterationData: require('./testData/attribute-group/search-attribute-groups-with-various-parameters.json') + }, + { + folder: 'search attributeGroups with various parameters by user', + iterationData: require('./testData/attribute-group/search-attribute-groups-with-various-parameters.json') + }, + { + folder: 'search attributeGroups with invalid parameters', + iterationData: require('./testData/attribute-group/search-attribute-groups-with-invalid-parameters.json') + }, + { + folder: 'search attributeGroups with all kinds of invalid token', + iterationData: require('./testData/attribute-group/search-attribute-groups-with-invalid-tokens.json') + }, + { + folder: 'head attributeGroups with various parameters by admin', + iterationData: require('./testData/attribute-group/search-attribute-groups-with-various-parameters.json') + }, + { + folder: 'head attributeGroups with various parameters by user', + iterationData: require('./testData/attribute-group/search-attribute-groups-with-various-parameters.json') + }, + { + folder: 'head attributeGroups with invalid parameters', + iterationData: require('./testData/attribute-group/search-attribute-groups-with-invalid-parameters.json') + }, + { + folder: 'head attributeGroups with all kinds of invalid token', + iterationData: require('./testData/attribute-group/search-attribute-groups-with-invalid-tokens.json') + }, + { + folder: 'create attributeGroup by admin', + iterationData: require('./testData/attribute-group/create-attribute-group-by-admin.json') + }, + { + folder: 'create attributeGroup by user', + iterationData: require('./testData/attribute-group/create-attribute-group-by-user.json') + }, + { + folder: 'create attributeGroup with all kinds of invalid request body', + iterationData: require('./testData/attribute-group/create-attribute-group-with-invalid-data.json') + }, + { + folder: 'create attributeGroup with all kinds of invalid token', + iterationData: require('./testData/attribute-group/create-attribute-group-with-invalid-tokens.json') + }, + { + folder: 'get attributeGroup with various parameters by admin', + iterationData: require('./testData/attribute-group/get-attribute-group-by-admin.json') + }, + { + folder: 'get attributeGroup with various parameters by user', + iterationData: require('./testData/attribute-group/get-attribute-group-by-user.json') + }, + { + folder: 'get attributeGroup with invalid requests', + iterationData: require('./testData/attribute-group/get-attribute-group-with-invalid-parameters.json') + }, + { + folder: 'get attributeGroup with all kinds of invalid token', + iterationData: require('./testData/attribute-group/get-attribute-group-with-invalid-tokens.json') + }, + { + folder: 'head attributeGroup with various parameters by admin', + iterationData: require('./testData/attribute-group/get-attribute-group-by-admin.json') + }, + { + folder: 'head attributeGroup with various parameters by user', + iterationData: require('./testData/attribute-group/get-attribute-group-by-user.json') + }, + { + folder: 'head attributeGroup with invalid requests', + iterationData: require('./testData/attribute-group/get-attribute-group-with-invalid-parameters.json') + }, + { + folder: 'head attributeGroup with all kinds of invalid token', + iterationData: require('./testData/attribute-group/get-attribute-group-with-invalid-tokens.json') + }, + { + folder: 'patch attributeGroup by admin', + iterationData: require('./testData/attribute-group/patch-attribute-group-with-any-fields-by-admin.json') + }, + { + folder: 'patch attributeGroup by user', + iterationData: require('./testData/attribute-group/patch-attribute-group-with-any-fields-by-user.json') + }, + { + folder: 'patch attributeGroup with invalid request body', + iterationData: require('./testData/attribute-group/patch-attribute-group-with-invalid-data.json') + }, + { + folder: 'patch attributeGroup with all kinds of invalid token', + iterationData: require('./testData/attribute-group/patch-attribute-group-with-invalid-tokens.json') + }, + { + folder: 'delete attributeGroup by admin' + }, + { + folder: 'delete attributeGroup with all kinds of invalid request', + iterationData: require('./testData/attribute-group/delete-attribute-group-with-invalid-request.json') + }, + + { + folder: 'search attributes with various parameters by admin', + iterationData: require('./testData/attribute/search-attributes-with-various-parameters.json') + }, + { + folder: 'search attributes with various parameters by user', + iterationData: require('./testData/attribute/search-attributes-with-various-parameters.json') + }, + { + folder: 'search attributes with invalid parameters', + iterationData: require('./testData/attribute/search-attributes-with-invalid-parameters.json') + }, + { + folder: 'search attributes with all kinds of invalid token', + iterationData: require('./testData/attribute/search-attributes-with-invalid-tokens.json') + }, + { + folder: 'head attributes with various parameters by admin', + iterationData: require('./testData/attribute/search-attributes-with-various-parameters.json') + }, + { + folder: 'head attributes with various parameters by user', + iterationData: require('./testData/attribute/search-attributes-with-various-parameters.json') + }, + { + folder: 'head attributes with invalid parameters', + iterationData: require('./testData/attribute/search-attributes-with-invalid-parameters.json') + }, + { + folder: 'head attributes with all kinds of invalid token', + iterationData: require('./testData/attribute/search-attributes-with-invalid-tokens.json') + }, + { + folder: 'create attribute by admin', + iterationData: require('./testData/attribute/create-attribute-by-admin.json') + }, + { + folder: 'create attribute by user', + iterationData: require('./testData/attribute/create-attribute-by-user.json') + }, + { + folder: 'create attribute with all kinds of invalid request body', + iterationData: require('./testData/attribute/create-attribute-with-invalid-data.json') + }, + { + folder: 'create attribute with all kinds of invalid token', + iterationData: require('./testData/attribute/create-attribute-with-invalid-tokens.json') + }, + { + folder: 'get attribute with various parameters by admin', + iterationData: require('./testData/attribute/get-attribute-by-admin.json') + }, + { + folder: 'get attribute with various parameters by user', + iterationData: require('./testData/attribute/get-attribute-by-user.json') + }, + { + folder: 'get attribute with invalid requests', + iterationData: require('./testData/attribute/get-attribute-with-invalid-parameters.json') + }, + { + folder: 'get attribute with all kinds of invalid token', + iterationData: require('./testData/attribute/get-attribute-with-invalid-tokens.json') + }, + { + folder: 'head attribute with various parameters by admin', + iterationData: require('./testData/attribute/get-attribute-by-admin.json') + }, + { + folder: 'head attribute with various parameters by user', + iterationData: require('./testData/attribute/get-attribute-by-user.json') + }, + { + folder: 'head attribute with invalid requests', + iterationData: require('./testData/attribute/get-attribute-with-invalid-parameters.json') + }, + { + folder: 'head attribute with all kinds of invalid token', + iterationData: require('./testData/attribute/get-attribute-with-invalid-tokens.json') + }, + { + folder: 'patch attribute by admin', + iterationData: require('./testData/attribute/patch-attribute-with-any-fields-by-admin.json') + }, + { + folder: 'patch attribute by user', + iterationData: require('./testData/attribute/patch-attribute-with-any-fields-by-user.json') + }, + { + folder: 'patch attribute with invalid request body', + iterationData: require('./testData/attribute/patch-attribute-with-invalid-data.json') + }, + { + folder: 'patch attribute with all kinds of invalid token', + iterationData: require('./testData/attribute/patch-attribute-with-invalid-tokens.json') + }, + { + folder: 'delete attribute by admin' + }, + { + folder: 'delete attribute with all kinds of invalid request', + iterationData: require('./testData/attribute/delete-attribute-with-invalid-request.json') + }, + + { + folder: 'search user achievements with various parameters by admin', + iterationData: require('./testData/user-achievement/search-user-achievements-with-various-parameters.json') + }, + { + folder: 'search user achievements with various parameters by user', + iterationData: require('./testData/user-achievement/search-user-achievements-with-various-parameters.json') + }, + { + folder: 'search user achievements with invalid parameters', + iterationData: require('./testData/user-achievement/search-user-achievements-with-invalid-parameters.json') + }, + { + folder: 'search user achievements with all kinds of invalid token', + iterationData: require('./testData/user-achievement/search-user-achievements-with-invalid-tokens.json') + }, + { + folder: 'head user achievements with various parameters by admin', + iterationData: require('./testData/user-achievement/search-user-achievements-with-various-parameters.json') + }, + { + folder: 'head user achievements with various parameters by user', + iterationData: require('./testData/user-achievement/search-user-achievements-with-various-parameters.json') + }, + { + folder: 'head user achievements with invalid parameters', + iterationData: require('./testData/user-achievement/search-user-achievements-with-invalid-parameters.json') + }, + { + folder: 'head user achievements with all kinds of invalid token', + iterationData: require('./testData/user-achievement/search-user-achievements-with-invalid-tokens.json') + }, + { + folder: 'create user achievement by admin', + iterationData: require('./testData/user-achievement/create-user-achievement-by-admin.json') + }, + { + folder: 'create user achievement by user', + iterationData: require('./testData/user-achievement/create-user-achievement-by-user.json') + }, + { + folder: 'create user achievement with all kinds of invalid request body', + iterationData: require('./testData/user-achievement/create-user-achievement-with-invalid-data.json') + }, + { + folder: 'create user achievement with all kinds of invalid token', + iterationData: require('./testData/user-achievement/create-user-achievement-with-invalid-tokens.json') + }, + { + folder: 'get user achievement with various parameters by admin', + iterationData: require('./testData/user-achievement/get-user-achievement-by-admin.json') + }, + { + folder: 'get user achievement with various parameters by user', + iterationData: require('./testData/user-achievement/get-user-achievement-by-user.json') + }, + { + folder: 'get user achievement with invalid requests', + iterationData: require('./testData/user-achievement/get-user-achievement-with-invalid-parameters.json') + }, + { + folder: 'get user achievement with all kinds of invalid token', + iterationData: require('./testData/user-achievement/get-user-achievement-with-invalid-tokens.json') + }, + { + folder: 'head user achievement with various parameters by admin', + iterationData: require('./testData/user-achievement/get-user-achievement-by-admin.json') + }, + { + folder: 'head user achievement with various parameters by user', + iterationData: require('./testData/user-achievement/get-user-achievement-by-user.json') + }, + { + folder: 'head user achievement with invalid requests', + iterationData: require('./testData/user-achievement/get-user-achievement-with-invalid-parameters.json') + }, + { + folder: 'head user achievement with all kinds of invalid token', + iterationData: require('./testData/user-achievement/get-user-achievement-with-invalid-tokens.json') + }, + { + folder: 'patch user achievement by admin', + iterationData: require('./testData/user-achievement/patch-user-achievement-with-any-fields-by-admin.json') + }, + { + folder: 'patch user achievement by user', + iterationData: require('./testData/user-achievement/patch-user-achievement-with-any-fields-by-user.json') + }, + { + folder: 'patch user achievement with invalid request body', + iterationData: require('./testData/user-achievement/patch-user-achievement-with-invalid-data.json') + }, + { + folder: 'patch user achievement with all kinds of invalid token', + iterationData: require('./testData/user-achievement/patch-user-achievement-with-invalid-tokens.json') + }, + { + folder: 'delete user achievement by admin', + iterationData: require('./testData/user-achievement/delete-user-achievement-by-admin.json') + }, + { + folder: 'delete user achievement with all kinds of invalid request', + iterationData: require('./testData/user-achievement/delete-user-achievement-with-invalid-request.json') + }, + + { + folder: 'search organization skillProviders with various parameters by admin', + iterationData: require('./testData/organization-skill-provider/search-organization-skill-providers-with-various-parameters.json') + }, + { + folder: 'search organization skillProviders with various parameters by user', + iterationData: require('./testData/organization-skill-provider/search-organization-skill-providers-with-various-parameters.json') + }, + { + folder: 'search organization skillProviders with invalid parameters', + iterationData: require('./testData/organization-skill-provider/search-organization-skill-providers-with-invalid-parameters.json') + }, + { + folder: 'search organization skillProviders with all kinds of invalid token', + iterationData: require('./testData/organization-skill-provider/search-organization-skill-providers-with-invalid-tokens.json') + }, + { + folder: 'head organization skillProviders with various parameters by admin', + iterationData: require('./testData/organization-skill-provider/search-organization-skill-providers-with-various-parameters.json') + }, + { + folder: 'head organization skillProviders with various parameters by user', + iterationData: require('./testData/organization-skill-provider/search-organization-skill-providers-with-various-parameters.json') + }, + { + folder: 'head organization skillProviders with invalid parameters', + iterationData: require('./testData/organization-skill-provider/search-organization-skill-providers-with-invalid-parameters.json') + }, + { + folder: 'head organization skillProviders with all kinds of invalid token', + iterationData: require('./testData/organization-skill-provider/search-organization-skill-providers-with-invalid-tokens.json') + }, + { + folder: 'create organization skillProvider by admin', + iterationData: require('./testData/organization-skill-provider/create-organization-skill-provider-by-admin.json') + }, + { + folder: 'create organization skillProvider by user', + iterationData: require('./testData/organization-skill-provider/create-organization-skill-provider-by-user.json') + }, + { + folder: 'create organization skillProvider with all kinds of invalid request body', + iterationData: require('./testData/organization-skill-provider/create-organization-skill-provider-with-invalid-data.json') + }, + { + folder: 'create organization skillProvider with all kinds of invalid token', + iterationData: require('./testData/organization-skill-provider/create-organization-skill-provider-with-invalid-tokens.json') + }, + { + folder: 'get organization skillProvider with various parameters by admin', + iterationData: require('./testData/organization-skill-provider/get-organization-skill-provider-by-admin.json') + }, + { + folder: 'get organization skillProvider with various parameters by user', + iterationData: require('./testData/organization-skill-provider/get-organization-skill-provider-by-user.json') + }, + { + folder: 'get organization skillProvider with invalid requests', + iterationData: require('./testData/organization-skill-provider/get-organization-skill-provider-with-invalid-parameters.json') + }, + { + folder: 'get organization skillProvider with all kinds of invalid token', + iterationData: require('./testData/organization-skill-provider/get-organization-skill-provider-with-invalid-tokens.json') + }, + { + folder: 'head organization skillProvider with various parameters by admin', + iterationData: require('./testData/organization-skill-provider/get-organization-skill-provider-by-admin.json') + }, + { + folder: 'head organization skillProvider with various parameters by user', + iterationData: require('./testData/organization-skill-provider/get-organization-skill-provider-by-user.json') + }, + { + folder: 'head organization skillProvider with invalid requests', + iterationData: require('./testData/organization-skill-provider/get-organization-skill-provider-with-invalid-parameters.json') + }, + { + folder: 'head organization skillProvider with all kinds of invalid token', + iterationData: require('./testData/organization-skill-provider/get-organization-skill-provider-with-invalid-tokens.json') + }, + { + folder: 'delete organization skillProvider by admin', + iterationData: require('./testData/organization-skill-provider/delete-organization-skill-provider-by-admin.json') + }, + { + folder: 'delete organization skillProvider with all kinds of invalid request', + iterationData: require('./testData/organization-skill-provider/delete-organization-skill-provider-with-invalid-request.json') + }, + + { + folder: 'search user externalProfiles with various parameters by admin', + iterationData: require('./testData/external-profile/search-external-profiles-with-various-parameters.json') + }, + { + folder: 'search user externalProfiles with various parameters by user', + iterationData: require('./testData/external-profile/search-external-profiles-with-various-parameters.json') + }, + { + folder: 'search user externalProfiles with invalid parameters', + iterationData: require('./testData/external-profile/search-external-profiles-with-invalid-parameters.json') + }, + { + folder: 'search user externalProfiles with all kinds of invalid token', + iterationData: require('./testData/external-profile/search-external-profiles-with-invalid-tokens.json') + }, + { + folder: 'head user externalProfiles with various parameters by admin', + iterationData: require('./testData/external-profile/search-external-profiles-with-various-parameters.json') + }, + { + folder: 'head user externalProfiles with various parameters by user', + iterationData: require('./testData/external-profile/search-external-profiles-with-various-parameters.json') + }, + { + folder: 'head user externalProfiles with invalid parameters', + iterationData: require('./testData/external-profile/search-external-profiles-with-invalid-parameters.json') + }, + { + folder: 'head user externalProfiles with all kinds of invalid token', + iterationData: require('./testData/external-profile/search-external-profiles-with-invalid-tokens.json') + }, + { + folder: 'create user externalProfile by admin', + iterationData: require('./testData/external-profile/create-external-profile-by-admin.json') + }, + { + folder: 'create user externalProfile by user', + iterationData: require('./testData/external-profile/create-external-profile-by-user.json') + }, + { + folder: 'create user externalProfile with all kinds of invalid request body', + iterationData: require('./testData/external-profile/create-external-profile-with-invalid-data.json') + }, + { + folder: 'create user externalProfile with all kinds of invalid token', + iterationData: require('./testData/external-profile/create-external-profile-with-invalid-tokens.json') + }, + { + folder: 'get user externalProfile with various parameters by admin', + iterationData: require('./testData/external-profile/get-external-profile-by-admin.json') + }, + { + folder: 'get user externalProfile with various parameters by user', + iterationData: require('./testData/external-profile/get-external-profile-by-user.json') + }, + { + folder: 'get user externalProfile with invalid requests', + iterationData: require('./testData/external-profile/get-external-profile-with-invalid-parameters.json') + }, + { + folder: 'get user externalProfile with all kinds of invalid token', + iterationData: require('./testData/external-profile/get-external-profile-with-invalid-tokens.json') + }, + { + folder: 'head user externalProfile with various parameters by admin', + iterationData: require('./testData/external-profile/get-external-profile-by-admin.json') + }, + { + folder: 'head user externalProfile with various parameters by user', + iterationData: require('./testData/external-profile/get-external-profile-by-user.json') + }, + { + folder: 'head user externalProfile with invalid requests', + iterationData: require('./testData/external-profile/get-external-profile-with-invalid-parameters.json') + }, + { + folder: 'head user externalProfile with all kinds of invalid token', + iterationData: require('./testData/external-profile/get-external-profile-with-invalid-tokens.json') + }, + { + folder: 'patch user externalProfile by admin', + iterationData: require('./testData/external-profile/patch-external-profile-with-any-fields-by-admin.json') + }, + { + folder: 'patch user externalProfile by user', + iterationData: require('./testData/external-profile/patch-external-profile-with-any-fields-by-user.json') + }, + { + folder: 'patch user externalProfile with invalid request body', + iterationData: require('./testData/external-profile/patch-external-profile-with-invalid-data.json') + }, + { + folder: 'patch user externalProfile with all kinds of invalid token', + iterationData: require('./testData/external-profile/patch-external-profile-with-invalid-tokens.json') + }, + { + folder: 'delete user externalProfile by admin', + iterationData: require('./testData/external-profile/delete-external-profile-by-admin.json') + }, + { + folder: 'delete user externalProfile with all kinds of invalid request', + iterationData: require('./testData/external-profile/delete-external-profile-with-invalid-request.json') + }, + + { + folder: 'search user attributes with various parameters by admin', + iterationData: require('./testData/user-attribute/search-user-attributes-with-various-parameters.json') + }, + { + folder: 'search user attributes with various parameters by user', + iterationData: require('./testData/user-attribute/search-user-attributes-with-various-parameters.json') + }, + { + folder: 'search user attributes with invalid parameters', + iterationData: require('./testData/user-attribute/search-user-attributes-with-invalid-parameters.json') + }, + { + folder: 'search user attributes with all kinds of invalid token', + iterationData: require('./testData/user-attribute/search-user-attributes-with-invalid-tokens.json') + }, + { + folder: 'head user attributes with various parameters by admin', + iterationData: require('./testData/user-attribute/search-user-attributes-with-various-parameters.json') + }, + { + folder: 'head user attributes with various parameters by user', + iterationData: require('./testData/user-attribute/search-user-attributes-with-various-parameters.json') + }, + { + folder: 'head user attributes with invalid parameters', + iterationData: require('./testData/user-attribute/search-user-attributes-with-invalid-parameters.json') + }, + { + folder: 'head user attributes with all kinds of invalid token', + iterationData: require('./testData/user-attribute/search-user-attributes-with-invalid-tokens.json') + }, + { + folder: 'create user attribute by admin', + iterationData: require('./testData/user-attribute/create-user-attribute-by-admin.json') + }, + { + folder: 'create user attribute by user', + iterationData: require('./testData/user-attribute/create-user-attribute-by-user.json') + }, + { + folder: 'create user attribute with all kinds of invalid request body', + iterationData: require('./testData/user-attribute/create-user-attribute-with-invalid-data.json') + }, + { + folder: 'create user attribute with all kinds of invalid token', + iterationData: require('./testData/user-attribute/create-user-attribute-with-invalid-tokens.json') + }, + { + folder: 'get user attribute with various parameters by admin', + iterationData: require('./testData/user-attribute/get-user-attribute-by-admin.json') + }, + { + folder: 'get user attribute with various parameters by user', + iterationData: require('./testData/user-attribute/get-user-attribute-by-user.json') + }, + { + folder: 'get user attribute with invalid requests', + iterationData: require('./testData/user-attribute/get-user-attribute-with-invalid-parameters.json') + }, + { + folder: 'get user attribute with all kinds of invalid token', + iterationData: require('./testData/user-attribute/get-user-attribute-with-invalid-tokens.json') + }, + { + folder: 'head user attribute with various parameters by admin', + iterationData: require('./testData/user-attribute/get-user-attribute-by-admin.json') + }, + { + folder: 'head user attribute with various parameters by user', + iterationData: require('./testData/user-attribute/get-user-attribute-by-user.json') + }, + { + folder: 'head user attribute with invalid requests', + iterationData: require('./testData/user-attribute/get-user-attribute-with-invalid-parameters.json') + }, + { + folder: 'head user attribute with all kinds of invalid token', + iterationData: require('./testData/user-attribute/get-user-attribute-with-invalid-tokens.json') + }, + { + folder: 'patch user attribute by admin', + iterationData: require('./testData/user-attribute/patch-user-attribute-with-any-fields-by-admin.json') + }, + { + folder: 'patch user attribute by user', + iterationData: require('./testData/user-attribute/patch-user-attribute-with-any-fields-by-user.json') + }, + { + folder: 'patch user attribute with invalid request body', + iterationData: require('./testData/user-attribute/patch-user-attribute-with-invalid-data.json') + }, + { + folder: 'patch user attribute with all kinds of invalid token', + iterationData: require('./testData/user-attribute/patch-user-attribute-with-invalid-tokens.json') + }, + { + folder: 'delete user attribute by admin', + iterationData: require('./testData/user-attribute/delete-user-attribute-by-admin.json') + }, + { + folder: 'delete user attribute with all kinds of invalid request', + iterationData: require('./testData/user-attribute/delete-user-attribute-with-invalid-request.json') + }, + { + folder: 'skill search users with various parameters', + iterationData: require('./testData/skill-search/skill-search-users-with-various-parameters.json') + }, + { + folder: 'skill search users with invalid request data', + iterationData: require('./testData/skill-search/skill-search-users-with-invalid-parameters.json') + }, + { + folder: 'skill search users with invalid token', + iterationData: require('./testData/skill-search/skill-search-users-with-invalid-tokens.json') + }, + { + folder: 'skill search user attributes with various parameters', + iterationData: require('./testData/skill-search/skill-search-user-attributes-with-various-parameters.json') + }, + { + folder: 'skill search user attributes with all kinds of invalid token', + iterationData: require('./testData/skill-search/skill-search-user-attributes-with-invalid-tokens.json') + }, + { + folder: 'skill search head user attributes with various parameters', + iterationData: require('./testData/skill-search/skill-search-user-attributes-with-various-parameters.json') + }, + { + folder: 'skill search head user attributes with all kinds of invalid token', + iterationData: require('./testData/skill-search/skill-search-user-attributes-with-invalid-tokens.json') + }, + { + folder: 'skill search user achievements with various parameters', + iterationData: require('./testData/skill-search/skill-search-user-achievements-with-various-parameters.json') + }, + { + folder: 'skill search user achievements with invalid request data', + iterationData: require('./testData/skill-search/skill-search-user-achievements-with-invalid-parameters.json') + }, + { + folder: 'skill search user achievements with all kinds of invalid token', + iterationData: require('./testData/skill-search/skill-search-user-achievements-with-invalid-tokens.json') + }, + { + folder: 'skill head user achievements with various parameters', + iterationData: require('./testData/skill-search/skill-search-user-achievements-with-various-parameters.json') + }, + { + folder: 'skill head user achievements with invalid request data', + iterationData: require('./testData/skill-search/skill-search-user-achievements-with-invalid-parameters.json') + }, + { + folder: 'skill head user achievements with all kinds of invalid token', + iterationData: require('./testData/skill-search/skill-search-user-achievements-with-invalid-tokens.json') + }, + { + folder: 'skill search user skills with various parameters', + iterationData: require('./testData/skill-search/skill-search-user-skills-with-various-parameters.json') + }, + { + folder: 'skill search user skills with invalid request data', + iterationData: require('./testData/skill-search/skill-search-user-skills-with-invalid-parameters.json') + }, + { + folder: 'skill search user skills with all kinds of invalid token', + iterationData: require('./testData/skill-search/skill-search-user-skills-with-invalid-tokens.json') + }, + { + folder: 'skill head user skills with various parameters', + iterationData: require('./testData/skill-search/skill-search-user-skills-with-various-parameters.json') + }, + { + folder: 'skill head user skills with invalid request data', + iterationData: require('./testData/skill-search/skill-search-user-skills-with-invalid-parameters.json') + }, + { + folder: 'skill head user skills with all kinds of invalid token', + iterationData: require('./testData/skill-search/skill-search-user-skills-with-invalid-tokens.json') + }, + { + folder: 'health' + } +] + +/** + * Clear the test data. + * @return {Promise} + */ +async function clearTestData () { + logger.info('Clear the Postman test data.') + await envHelper.postRequest(`${config.API_BASE_URL}/ubahn/internal/jobs/clean`) + logger.info('Finished clear the Postman test data.') +} + +/** + * Run the postman tests. + */ +apiTestLib.runTests(requests, require.resolve('././Ubahn-api.postman_collection.json'), + require.resolve('./Ubahn-api.postman_environment.json')).then(async () => { + logger.info('newman test completed!') + await clearTestData() +}).catch(async (err) => { + logger.logFullError(err) + + // Only calling the clean up function when it is not validation error. + if (err.name !== 'ValidationError') { + await clearTestData() + } +}) diff --git a/test/postman/testData/achievements-provider/create-achievements-provider-by-admin.json b/test/postman/testData/achievements-provider/create-achievements-provider-by-admin.json new file mode 100644 index 0000000..7b5031b --- /dev/null +++ b/test/postman/testData/achievements-provider/create-achievements-provider-by-admin.json @@ -0,0 +1,14 @@ +[ + { + "name": "POSTMANE2E-Role01-by-admin", + "httpCode": 200 + }, + { + "name": "POSTMANE2E-Role02-by-admin", + "httpCode": 200 + }, + { + "name": "POSTMANE2E-Role03-by-admin", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/achievements-provider/create-achievements-provider-by-user.json b/test/postman/testData/achievements-provider/create-achievements-provider-by-user.json new file mode 100644 index 0000000..33efc0d --- /dev/null +++ b/test/postman/testData/achievements-provider/create-achievements-provider-by-user.json @@ -0,0 +1,14 @@ +[ + { + "name": "POSTMANE2E-Role01-by-user", + "httpCode": 200 + }, + { + "name": "POSTMANE2E-Role02-by-user", + "httpCode": 200 + }, + { + "name": "POSTMANE2E-Role03-by-user", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/achievements-provider/create-achievements-provider-with-invalid-data.json b/test/postman/testData/achievements-provider/create-achievements-provider-with-invalid-data.json new file mode 100644 index 0000000..a172f1f --- /dev/null +++ b/test/postman/testData/achievements-provider/create-achievements-provider-with-invalid-data.json @@ -0,0 +1,30 @@ +[ + { + "input": { + }, + "httpCode": 400, + "message": "\"entity.name\" is required" + }, + { + "input": { + "name": "" + }, + "httpCode": 400, + "message": "\"entity.name\" is not allowed to be empty" + }, + { + "input": { + "name": "POSTMANE2E-skill-validname", + "aaa":"ccc" + }, + "httpCode": 400, + "message": "\"entity.aaa\" is not allowed" + }, + { + "input": { + "name": "POSTMANE2E-Role02-by-admin" + }, + "httpCode": 409, + "message": "AchievementsProvider already exists with name:POSTMANE2E-Role02-by-admin" + } +] \ No newline at end of file diff --git a/test/postman/testData/achievements-provider/create-achievements-provider-with-invalid-tokens.json b/test/postman/testData/achievements-provider/create-achievements-provider-with-invalid-tokens.json new file mode 100644 index 0000000..dc4c631 --- /dev/null +++ b/test/postman/testData/achievements-provider/create-achievements-provider-with-invalid-tokens.json @@ -0,0 +1,16 @@ +[ + { + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/achievements-provider/delete-achievements-provider-with-invalid-request.json b/test/postman/testData/achievements-provider/delete-achievements-provider-with-invalid-request.json new file mode 100644 index 0000000..4993a7d --- /dev/null +++ b/test/postman/testData/achievements-provider/delete-achievements-provider-with-invalid-request.json @@ -0,0 +1,25 @@ +[ + { + "id": "{{ACHIEVEMENTS_PROVIDER_ID_3}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "id": "{{ACHIEVEMENTS_PROVIDER_ID_3}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "id": "{{ACHIEVEMENTS_PROVIDER_ID_3}}", + "httpCode": 403, + "message": "No token provided." + }, + { + "id": "{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "jwtToken": "Bearer {{user_token}}", + "httpCode": 403, + "message": "You are not allowed to perform this action" + } +] \ No newline at end of file diff --git a/test/postman/testData/achievements-provider/get-achievements-provider-by-admin.json b/test/postman/testData/achievements-provider/get-achievements-provider-by-admin.json new file mode 100644 index 0000000..5bd0ff9 --- /dev/null +++ b/test/postman/testData/achievements-provider/get-achievements-provider-by-admin.json @@ -0,0 +1,10 @@ +[ + { + "id": "{{ACHIEVEMENTS_PROVIDER_ID_1}}", + "httpCode": 200 + }, + { + "id": "{{ACHIEVEMENTS_PROVIDER_ID_2}}", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/achievements-provider/get-achievements-provider-by-user.json b/test/postman/testData/achievements-provider/get-achievements-provider-by-user.json new file mode 100644 index 0000000..e916f26 --- /dev/null +++ b/test/postman/testData/achievements-provider/get-achievements-provider-by-user.json @@ -0,0 +1,6 @@ +[ + { + "id": "{{ACHIEVEMENTS_PROVIDER_ID_BY_TESTER}}", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/achievements-provider/get-achievements-provider-with-invalid-parameters.json b/test/postman/testData/achievements-provider/get-achievements-provider-with-invalid-parameters.json new file mode 100644 index 0000000..d7c5776 --- /dev/null +++ b/test/postman/testData/achievements-provider/get-achievements-provider-with-invalid-parameters.json @@ -0,0 +1,12 @@ +[ + { + "id": "123456", + "httpCode": 500, + "message": "invalid input syntax for type uuid: \"123456\"" + }, + { + "id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "httpCode": 404, + "message": "cannot find AchievementsProvider where id = 3cd81b8c-d45e-414e-be66-afb31aa0240c" + } +] \ No newline at end of file diff --git a/test/postman/testData/achievements-provider/get-achievements-provider-with-invalid-tokens.json b/test/postman/testData/achievements-provider/get-achievements-provider-with-invalid-tokens.json new file mode 100644 index 0000000..219e660 --- /dev/null +++ b/test/postman/testData/achievements-provider/get-achievements-provider-with-invalid-tokens.json @@ -0,0 +1,26 @@ +[ + { + "id": "{{ACHIEVEMENTS_PROVIDER_ID_1}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "id": "{{ACHIEVEMENTS_PROVIDER_ID_1}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "id": "{{ACHIEVEMENTS_PROVIDER_ID_1}}", + "httpCode": 403, + "jwtToken": "", + "message": "No token provided." + }, + { + "id": "{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "jwtToken": "Bearer {{user_token}}", + "httpCode": 500, + "message": "You are not allowed to perform this action" + } +] \ No newline at end of file diff --git a/test/postman/testData/achievements-provider/patch-achievements-provider-with-any-fields-by-admin.json b/test/postman/testData/achievements-provider/patch-achievements-provider-with-any-fields-by-admin.json new file mode 100644 index 0000000..251e52a --- /dev/null +++ b/test/postman/testData/achievements-provider/patch-achievements-provider-with-any-fields-by-admin.json @@ -0,0 +1,12 @@ +[ + { + "id": "{{ACHIEVEMENTS_PROVIDER_ID_1}}", + "input": { + "name": "POSTMANE2E-provider02-by-admin-updated" + }, + "expected": { + "name": "POSTMANE2E-provider02-by-admin-updated" + }, + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/achievements-provider/patch-achievements-provider-with-any-fields-by-user.json b/test/postman/testData/achievements-provider/patch-achievements-provider-with-any-fields-by-user.json new file mode 100644 index 0000000..35344bf --- /dev/null +++ b/test/postman/testData/achievements-provider/patch-achievements-provider-with-any-fields-by-user.json @@ -0,0 +1,12 @@ +[ + { + "id": "{{ACHIEVEMENTS_PROVIDER_ID_BY_TESTER}}", + "input": { + "name": "POSTMANE2E-provider01-by-user-updated" + }, + "expected": { + "name": "POSTMANE2E-provider01-by-user-updated" + }, + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/achievements-provider/patch-achievements-provider-with-invalid-data.json b/test/postman/testData/achievements-provider/patch-achievements-provider-with-invalid-data.json new file mode 100644 index 0000000..daa8ae2 --- /dev/null +++ b/test/postman/testData/achievements-provider/patch-achievements-provider-with-invalid-data.json @@ -0,0 +1,42 @@ +[ + { + "id": "{{ACHIEVEMENTS_PROVIDER_ID_2}}", + "input": { + "name": "" + }, + "httpCode": 400, + "message": "\"entity.name\" is not allowed to be empty" + }, + { + "id": "{{ACHIEVEMENTS_PROVIDER_ID_2}}", + "input": { + "ccc": "abc" + }, + "httpCode": 400, + "message": "\"entity.ccc\" is not allowed" + }, + { + "id": "123456", + "input": { + "name": "POSTMANE2E-provider02-by-admin-updated123456" + }, + "httpCode": 500, + "message": "invalid input syntax for type uuid: \"123456\"" + }, + { + "id": "5ba376ee-1151-47df-b695-05a17a28f0ab", + "input": { + "name": "POSTMANE2E-provider02-by-admin-updated123456" + }, + "httpCode": 404, + "message": "cannot find AchievementsProvider where id = 5ba376ee-1151-47df-b695-05a17a28f0ab" + }, + { + "id": "{{ACHIEVEMENTS_PROVIDER_ID_1}}", + "input": { + "name": "POSTMANE2E-provider02-by-admin-updated" + }, + "httpCode": 409, + "message": "AchievementsProvider already exists with name:POSTMANE2E-provider02-by-admin-updated" + } +] \ No newline at end of file diff --git a/test/postman/testData/achievements-provider/patch-achievements-provider-with-invalid-tokens.json b/test/postman/testData/achievements-provider/patch-achievements-provider-with-invalid-tokens.json new file mode 100644 index 0000000..550a829 --- /dev/null +++ b/test/postman/testData/achievements-provider/patch-achievements-provider-with-invalid-tokens.json @@ -0,0 +1,19 @@ +[ + { + "id": "{{ACHIEVEMENTS_PROVIDER_ID_2}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "id": "{{ACHIEVEMENTS_PROVIDER_ID_2}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "id": "{{ACHIEVEMENTS_PROVIDER_ID_2}}", + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/achievements-provider/search-achievements-providers-with-invalid-parameters.json b/test/postman/testData/achievements-provider/search-achievements-providers-with-invalid-parameters.json new file mode 100644 index 0000000..a64c3dc --- /dev/null +++ b/test/postman/testData/achievements-provider/search-achievements-providers-with-invalid-parameters.json @@ -0,0 +1,22 @@ +[ + { + "input": "page=-1&perPage=10", + "httpCode": 400, + "message": "\"query.page\" must be larger than or equal to 1" + }, + { + "input": "page=1&perPage=-10", + "httpCode": 400, + "message": "\"query.perPage\" must be larger than or equal to 1" + }, + { + "input": "name=", + "httpCode": 400, + "message": "\"query.name\" is not allowed to be empty" + }, + { + "input": "aa=", + "httpCode": 400, + "message": "\"query.aa\" is not allowed" + } +] \ No newline at end of file diff --git a/test/postman/testData/achievements-provider/search-achievements-providers-with-invalid-tokens.json b/test/postman/testData/achievements-provider/search-achievements-providers-with-invalid-tokens.json new file mode 100644 index 0000000..f25a81a --- /dev/null +++ b/test/postman/testData/achievements-provider/search-achievements-providers-with-invalid-tokens.json @@ -0,0 +1,17 @@ +[ + { + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "jwtToken": "", + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/achievements-provider/search-achievements-providers-with-various-parameters.json b/test/postman/testData/achievements-provider/search-achievements-providers-with-various-parameters.json new file mode 100644 index 0000000..8363316 --- /dev/null +++ b/test/postman/testData/achievements-provider/search-achievements-providers-with-various-parameters.json @@ -0,0 +1,17 @@ +[ + { + "input": "page=1&perPage=10&name=POSTMANE2E" + }, + { + "input": "page=1&perPage=1&name=POSTMANE2E", + "idLabel": "ACHIEVEMENTS_PROVIDER_ID_1" + }, + { + "input": "page=2&perPage=1", + "idLabel": "ACHIEVEMENTS_PROVIDER_ID_2" + }, + { + "input": "page=3&perPage=1", + "idLabel": "ACHIEVEMENTS_PROVIDER_ID_3" + } +] \ No newline at end of file diff --git a/test/postman/testData/attribute-group/create-attribute-group-by-admin.json b/test/postman/testData/attribute-group/create-attribute-group-by-admin.json new file mode 100644 index 0000000..e13e78f --- /dev/null +++ b/test/postman/testData/attribute-group/create-attribute-group-by-admin.json @@ -0,0 +1,17 @@ +[ + { + "name": "POSTMANE2E-Role01-by-admin", + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "httpCode": 200 + }, + { + "name": "POSTMANE2E-Role02-by-admin", + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "httpCode": 200 + }, + { + "name": "POSTMANE2E-Role03-by-admin", + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/attribute-group/create-attribute-group-by-user.json b/test/postman/testData/attribute-group/create-attribute-group-by-user.json new file mode 100644 index 0000000..a70bf4b --- /dev/null +++ b/test/postman/testData/attribute-group/create-attribute-group-by-user.json @@ -0,0 +1,17 @@ +[ + { + "name": "POSTMANE2E-Role01-by-user", + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "httpCode": 200 + }, + { + "name": "POSTMANE2E-Role02-by-user", + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "httpCode": 200 + }, + { + "name": "POSTMANE2E-Role03-by-user", + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/attribute-group/create-attribute-group-with-invalid-data.json b/test/postman/testData/attribute-group/create-attribute-group-with-invalid-data.json new file mode 100644 index 0000000..4f82339 --- /dev/null +++ b/test/postman/testData/attribute-group/create-attribute-group-with-invalid-data.json @@ -0,0 +1,49 @@ +[ + { + "input": { + "organizationId": "{{ORGANIZATION_ID_BY_ADMIN}}" + }, + "httpCode": 400, + "message": "\"entity.name\" is required" + }, + { + "input": { + "name": "", + "organizationId": "{{ORGANIZATION_ID_BY_ADMIN}}" + }, + "httpCode": 400, + "message": "\"entity.name\" is not allowed to be empty" + }, + { + "input": { + "name": "POSTMANE2E-skill-validname" + }, + "httpCode": 400, + "message": "\"entity.organizationId\" is required" + }, + { + "input": { + "name": "POSTMANE2E-skill-validname", + "organizationId": "" + }, + "httpCode": 400, + "message": "\"entity.organizationId\" is not allowed to be empty" + }, + { + "input": { + "name": "POSTMANE2E-skill-validname", + "organizationId": "{{ORGANIZATION_ID_BY_ADMIN}}", + "aaa":"ccc" + }, + "httpCode": 400, + "message": "\"entity.aaa\" is not allowed" + }, + { + "input": { + "name": "POSTMANE2E-Role02-by-admin", + "organizationId": "{{ORGANIZATION_ID_BY_ADMIN}}" + }, + "httpCode": 409, + "message": "AttributeGroup already exists with name:POSTMANE2E-Role02-by-admin" + } +] \ No newline at end of file diff --git a/test/postman/testData/attribute-group/create-attribute-group-with-invalid-tokens.json b/test/postman/testData/attribute-group/create-attribute-group-with-invalid-tokens.json new file mode 100644 index 0000000..dc4c631 --- /dev/null +++ b/test/postman/testData/attribute-group/create-attribute-group-with-invalid-tokens.json @@ -0,0 +1,16 @@ +[ + { + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/attribute-group/delete-attribute-group-with-invalid-request.json b/test/postman/testData/attribute-group/delete-attribute-group-with-invalid-request.json new file mode 100644 index 0000000..f6ad88c --- /dev/null +++ b/test/postman/testData/attribute-group/delete-attribute-group-with-invalid-request.json @@ -0,0 +1,31 @@ +[ + { + "id": "{{ATTRIBUTE_GROUP_ID_3}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "id": "{{ATTRIBUTE_GROUP_ID_3}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "id": "{{ATTRIBUTE_GROUP_ID_3}}", + "httpCode": 403, + "message": "No token provided." + }, + { + "id": "{{ATTRIBUTE_GROUP_ID_BY_ADMIN}}", + "jwtToken": "Bearer {{user_token}}", + "httpCode": 403, + "message": "You are not allowed to perform this action" + }, + { + "id": "{{ATTRIBUTE_GROUP_ID_BY_TESTER}}", + "jwtToken": "Bearer {{admin_token}}", + "httpCode": 404, + "message": "cannot find AttributeGroup where id = " + } +] \ No newline at end of file diff --git a/test/postman/testData/attribute-group/get-attribute-group-by-admin.json b/test/postman/testData/attribute-group/get-attribute-group-by-admin.json new file mode 100644 index 0000000..5c28462 --- /dev/null +++ b/test/postman/testData/attribute-group/get-attribute-group-by-admin.json @@ -0,0 +1,10 @@ +[ + { + "id": "{{ATTRIBUTE_GROUP_ID_1}}", + "httpCode": 200 + }, + { + "id": "{{ATTRIBUTE_GROUP_ID_2}}", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/attribute-group/get-attribute-group-by-user.json b/test/postman/testData/attribute-group/get-attribute-group-by-user.json new file mode 100644 index 0000000..60da311 --- /dev/null +++ b/test/postman/testData/attribute-group/get-attribute-group-by-user.json @@ -0,0 +1,6 @@ +[ + { + "id": "{{ATTRIBUTE_GROUP_ID_BY_TESTER}}", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/attribute-group/get-attribute-group-with-invalid-parameters.json b/test/postman/testData/attribute-group/get-attribute-group-with-invalid-parameters.json new file mode 100644 index 0000000..d565b46 --- /dev/null +++ b/test/postman/testData/attribute-group/get-attribute-group-with-invalid-parameters.json @@ -0,0 +1,12 @@ +[ + { + "id": "123456", + "httpCode": 500, + "message": "invalid input syntax for type uuid: \"123456\"" + }, + { + "id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "httpCode": 404, + "message": "cannot find AttributeGroup where id = 3cd81b8c-d45e-414e-be66-afb31aa0240c" + } +] \ No newline at end of file diff --git a/test/postman/testData/attribute-group/get-attribute-group-with-invalid-tokens.json b/test/postman/testData/attribute-group/get-attribute-group-with-invalid-tokens.json new file mode 100644 index 0000000..6c34784 --- /dev/null +++ b/test/postman/testData/attribute-group/get-attribute-group-with-invalid-tokens.json @@ -0,0 +1,26 @@ +[ + { + "id": "{{ATTRIBUTE_GROUP_ID_1}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "id": "{{ATTRIBUTE_GROUP_ID_1}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "id": "{{ATTRIBUTE_GROUP_ID_1}}", + "httpCode": 403, + "jwtToken": "", + "message": "No token provided." + }, + { + "id": "{{ATTRIBUTE_GROUP_ID_BY_ADMIN}}", + "jwtToken": "Bearer {{user_token}}", + "httpCode": 500, + "message": "You are not allowed to perform this action" + } +] \ No newline at end of file diff --git a/test/postman/testData/attribute-group/patch-attribute-group-with-any-fields-by-admin.json b/test/postman/testData/attribute-group/patch-attribute-group-with-any-fields-by-admin.json new file mode 100644 index 0000000..e955e7a --- /dev/null +++ b/test/postman/testData/attribute-group/patch-attribute-group-with-any-fields-by-admin.json @@ -0,0 +1,34 @@ +[ + { + "id": "{{ATTRIBUTE_GROUP_ID_1}}", + "input": { + "organizationId": "{{ORGANIZATION_ID_BY_ADMIN}}", + "name": "POSTMANE2E-attributeGroup02-by-admin-updated" + }, + "expected": { + "organizationId": "{{ORGANIZATION_ID_BY_ADMIN}}", + "name": "POSTMANE2E-attributeGroup02-by-admin-updated" + }, + "httpCode": 200 + }, + { + "id": "{{ATTRIBUTE_GROUP_ID_BY_ADMIN}}", + "input": { + "organizationId": "{{ORGANIZATION_ID_1}}" + }, + "expected": { + "organizationId": "{{ORGANIZATION_ID_1}}" + }, + "httpCode": 200 + }, + { + "id": "{{ATTRIBUTE_GROUP_ID_BY_ADMIN}}", + "input": { + "name": "POSTMANE2E-attributeGroup02-by-admin-updated2" + }, + "expected": { + "name": "POSTMANE2E-attributeGroup02-by-admin-updated2" + }, + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/attribute-group/patch-attribute-group-with-any-fields-by-user.json b/test/postman/testData/attribute-group/patch-attribute-group-with-any-fields-by-user.json new file mode 100644 index 0000000..a823f3c --- /dev/null +++ b/test/postman/testData/attribute-group/patch-attribute-group-with-any-fields-by-user.json @@ -0,0 +1,34 @@ +[ + { + "id": "{{ATTRIBUTE_GROUP_ID_BY_TESTER}}", + "input": { + "organizationId": "{{ORGANIZATION_ID_BY_ADMIN}}", + "name": "POSTMANE2E-attributeGroup01-by-user-updated" + }, + "expected": { + "organizationId": "{{ORGANIZATION_ID_BY_ADMIN}}", + "name": "POSTMANE2E-attributeGroup01-by-user-updated" + }, + "httpCode": 200 + }, + { + "id": "{{ATTRIBUTE_GROUP_ID_BY_TESTER}}", + "input": { + "name": "POSTMANE2E-attributeGroup01-by-user-updated2" + }, + "expected": { + "name": "POSTMANE2E-attributeGroup01-by-user-updated2" + }, + "httpCode": 200 + }, + { + "id": "{{ATTRIBUTE_GROUP_ID_BY_TESTER}}", + "input": { + "organizationId": "{{ORGANIZATION_ID_1}}" + }, + "expected": { + "organizationId": "{{ORGANIZATION_ID_1}}" + }, + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/attribute-group/patch-attribute-group-with-invalid-data.json b/test/postman/testData/attribute-group/patch-attribute-group-with-invalid-data.json new file mode 100644 index 0000000..dbcfad6 --- /dev/null +++ b/test/postman/testData/attribute-group/patch-attribute-group-with-invalid-data.json @@ -0,0 +1,50 @@ +[ + { + "id": "{{ATTRIBUTE_GROUP_ID_2}}", + "input": { + "name": "" + }, + "httpCode": 400, + "message": "\"entity.name\" is not allowed to be empty" + }, + { + "id": "{{ATTRIBUTE_GROUP_ID_2}}", + "input": { + "ccc": "abc" + }, + "httpCode": 400, + "message": "\"entity.ccc\" is not allowed" + }, + { + "id": "123456", + "input": { + "name": "POSTMANE2E-attributeGroup02-by-admin-updated123456" + }, + "httpCode": 500, + "message": "invalid input syntax for type uuid: \"123456\"" + }, + { + "id": "5ba376ee-1151-47df-b695-05a17a28f0ab", + "input": { + "name": "POSTMANE2E-attributeGroup02-by-admin-updated123456" + }, + "httpCode": 404, + "message": "cannot find AttributeGroup where id = 5ba376ee-1151-47df-b695-05a17a28f0ab" + }, + { + "id": "{{ATTRIBUTE_GROUP_ID_BY_TESTER}}", + "input": { + "organizationId": "5ba376ee-1151-47df-b695-05a17a28f0ab" + }, + "httpCode": 404, + "message": "cannot find Organization where id = 5ba376ee-1151-47df-b695-05a17a28f0ab" + }, + { + "id": "{{ATTRIBUTE_GROUP_ID_BY_TESTER}}", + "input": { + "organizationId": "123456" + }, + "httpCode": 500, + "message": "invalid input syntax for type uuid: \"123456\"" + } +] \ No newline at end of file diff --git a/test/postman/testData/attribute-group/patch-attribute-group-with-invalid-tokens.json b/test/postman/testData/attribute-group/patch-attribute-group-with-invalid-tokens.json new file mode 100644 index 0000000..20144d2 --- /dev/null +++ b/test/postman/testData/attribute-group/patch-attribute-group-with-invalid-tokens.json @@ -0,0 +1,19 @@ +[ + { + "id": "{{ATTRIBUTE_GROUP_ID_2}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "id": "{{ATTRIBUTE_GROUP_ID_2}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "id": "{{ATTRIBUTE_GROUP_ID_2}}", + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/attribute-group/search-attribute-groups-with-invalid-parameters.json b/test/postman/testData/attribute-group/search-attribute-groups-with-invalid-parameters.json new file mode 100644 index 0000000..7fa530b --- /dev/null +++ b/test/postman/testData/attribute-group/search-attribute-groups-with-invalid-parameters.json @@ -0,0 +1,27 @@ +[ + { + "input": "page=-1&perPage=10", + "httpCode": 400, + "message": "\"query.page\" must be larger than or equal to 1" + }, + { + "input": "page=1&perPage=-10", + "httpCode": 400, + "message": "\"query.perPage\" must be larger than or equal to 1" + }, + { + "input": "name=", + "httpCode": 400, + "message": "\"query.name\" is not allowed to be empty" + }, + { + "input": "organizationId=", + "httpCode": 400, + "message": "\"query.organizationId\" is not allowed to be empty" + }, + { + "input": "aa=", + "httpCode": 400, + "message": "\"query.aa\" is not allowed" + } +] \ No newline at end of file diff --git a/test/postman/testData/attribute-group/search-attribute-groups-with-invalid-tokens.json b/test/postman/testData/attribute-group/search-attribute-groups-with-invalid-tokens.json new file mode 100644 index 0000000..f25a81a --- /dev/null +++ b/test/postman/testData/attribute-group/search-attribute-groups-with-invalid-tokens.json @@ -0,0 +1,17 @@ +[ + { + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "jwtToken": "", + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/attribute-group/search-attribute-groups-with-various-parameters.json b/test/postman/testData/attribute-group/search-attribute-groups-with-various-parameters.json new file mode 100644 index 0000000..4d9f4ee --- /dev/null +++ b/test/postman/testData/attribute-group/search-attribute-groups-with-various-parameters.json @@ -0,0 +1,20 @@ +[ + { + "input": "page=1&perPage=10&name=POSTMANE2E&organizationId={{ATTRIBUTE_GROUP_ID_BY_ADMIN}}" + }, + { + "input": "page=1&perPage=10&organizationId={{ATTRIBUTE_GROUP_ID_BY_ADMIN}}" + }, + { + "input": "page=1&perPage=1&name=POSTMANE2E", + "idLabel": "ATTRIBUTE_GROUP_ID_1" + }, + { + "input": "page=2&perPage=1", + "idLabel": "ATTRIBUTE_GROUP_ID_2" + }, + { + "input": "page=3&perPage=1", + "idLabel": "ATTRIBUTE_GROUP_ID_3" + } +] \ No newline at end of file diff --git a/test/postman/testData/attribute/create-attribute-by-admin.json b/test/postman/testData/attribute/create-attribute-by-admin.json new file mode 100644 index 0000000..dcdac81 --- /dev/null +++ b/test/postman/testData/attribute/create-attribute-by-admin.json @@ -0,0 +1,17 @@ +[ + { + "name": "POSTMANE2E-Role01-by-admin", + "attribute_group_id": "{{ATTRIBUTE_GROUP_ID_BY_ADMIN}}", + "httpCode": 200 + }, + { + "name": "POSTMANE2E-Role02-by-admin", + "attribute_group_id": "{{ATTRIBUTE_GROUP_ID_BY_ADMIN}}", + "httpCode": 200 + }, + { + "name": "POSTMANE2E-Role03-by-admin", + "attribute_group_id": "{{ATTRIBUTE_GROUP_ID_BY_ADMIN}}", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/attribute/create-attribute-by-user.json b/test/postman/testData/attribute/create-attribute-by-user.json new file mode 100644 index 0000000..9213049 --- /dev/null +++ b/test/postman/testData/attribute/create-attribute-by-user.json @@ -0,0 +1,17 @@ +[ + { + "name": "POSTMANE2E-Role01-by-user", + "attribute_group_id": "{{ATTRIBUTE_GROUP_ID_BY_ADMIN}}", + "httpCode": 200 + }, + { + "name": "POSTMANE2E-Role02-by-user", + "attribute_group_id": "{{ATTRIBUTE_GROUP_ID_BY_ADMIN}}", + "httpCode": 200 + }, + { + "name": "POSTMANE2E-Role03-by-user", + "attribute_group_id": "{{ATTRIBUTE_GROUP_ID_BY_ADMIN}}", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/attribute/create-attribute-with-invalid-data.json b/test/postman/testData/attribute/create-attribute-with-invalid-data.json new file mode 100644 index 0000000..c5efae8 --- /dev/null +++ b/test/postman/testData/attribute/create-attribute-with-invalid-data.json @@ -0,0 +1,49 @@ +[ + { + "input": { + "attributeGroupId": "{{ATTRIBUTE_GROUP_ID_BY_ADMIN}}" + }, + "httpCode": 400, + "message": "\"entity.name\" is required" + }, + { + "input": { + "name": "", + "attributeGroupId": "{{ATTRIBUTE_GROUP_ID_BY_ADMIN}}" + }, + "httpCode": 400, + "message": "\"entity.name\" is not allowed to be empty" + }, + { + "input": { + "name": "POSTMANE2E-skill-validname" + }, + "httpCode": 400, + "message": "\"entity.attributeGroupId\" is required" + }, + { + "input": { + "name": "POSTMANE2E-skill-validname", + "attributeGroupId": "" + }, + "httpCode": 400, + "message": "\"entity.attributeGroupId\" is not allowed to be empty" + }, + { + "input": { + "name": "POSTMANE2E-skill-validname", + "attributeGroupId": "{{ATTRIBUTE_GROUP_ID_BY_ADMIN}}", + "aaa":"ccc" + }, + "httpCode": 400, + "message": "\"entity.aaa\" is not allowed" + }, + { + "input": { + "name": "POSTMANE2E-Role02-by-admin", + "attributeGroupId": "{{ATTRIBUTE_GROUP_ID_BY_ADMIN}}" + }, + "httpCode": 409, + "message": "Attribute already exists with name:POSTMANE2E-Role02-by-admin" + } +] \ No newline at end of file diff --git a/test/postman/testData/attribute/create-attribute-with-invalid-tokens.json b/test/postman/testData/attribute/create-attribute-with-invalid-tokens.json new file mode 100644 index 0000000..dc4c631 --- /dev/null +++ b/test/postman/testData/attribute/create-attribute-with-invalid-tokens.json @@ -0,0 +1,16 @@ +[ + { + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/attribute/delete-attribute-with-invalid-request.json b/test/postman/testData/attribute/delete-attribute-with-invalid-request.json new file mode 100644 index 0000000..053e700 --- /dev/null +++ b/test/postman/testData/attribute/delete-attribute-with-invalid-request.json @@ -0,0 +1,31 @@ +[ + { + "id": "{{ATTRIBUTE_GROUP_ID_3}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "id": "{{ATTRIBUTE_GROUP_ID_3}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "id": "{{ATTRIBUTE_GROUP_ID_3}}", + "httpCode": 403, + "message": "No token provided." + }, + { + "id": "{{ATTRIBUTE_GROUP_ID_BY_ADMIN}}", + "jwtToken": "Bearer {{user_token}}", + "httpCode": 403, + "message": "You are not allowed to perform this action" + }, + { + "id": "{{ATTRIBUTE_GROUP_ID_BY_TESTER}}", + "jwtToken": "Bearer {{admin_token}}", + "httpCode": 404, + "message": "cannot find Attribute where id = " + } +] \ No newline at end of file diff --git a/test/postman/testData/attribute/get-attribute-by-admin.json b/test/postman/testData/attribute/get-attribute-by-admin.json new file mode 100644 index 0000000..707d645 --- /dev/null +++ b/test/postman/testData/attribute/get-attribute-by-admin.json @@ -0,0 +1,10 @@ +[ + { + "id": "{{ATTRIBUTE_ID_1}}", + "httpCode": 200 + }, + { + "id": "{{ATTRIBUTE_ID_2}}", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/attribute/get-attribute-by-user.json b/test/postman/testData/attribute/get-attribute-by-user.json new file mode 100644 index 0000000..f1ef77a --- /dev/null +++ b/test/postman/testData/attribute/get-attribute-by-user.json @@ -0,0 +1,6 @@ +[ + { + "id": "{{ATTRIBUTE_ID_BY_TESTER}}", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/attribute/get-attribute-with-invalid-parameters.json b/test/postman/testData/attribute/get-attribute-with-invalid-parameters.json new file mode 100644 index 0000000..8e2b5aa --- /dev/null +++ b/test/postman/testData/attribute/get-attribute-with-invalid-parameters.json @@ -0,0 +1,12 @@ +[ + { + "id": "123456", + "httpCode": 500, + "message": "invalid input syntax for type uuid: \"123456\"" + }, + { + "id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "httpCode": 404, + "message": "cannot find Attribute where id = 3cd81b8c-d45e-414e-be66-afb31aa0240c" + } +] \ No newline at end of file diff --git a/test/postman/testData/attribute/get-attribute-with-invalid-tokens.json b/test/postman/testData/attribute/get-attribute-with-invalid-tokens.json new file mode 100644 index 0000000..1b5b0e6 --- /dev/null +++ b/test/postman/testData/attribute/get-attribute-with-invalid-tokens.json @@ -0,0 +1,26 @@ +[ + { + "id": "{{ATTRIBUTE_ID_1}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "id": "{{ATTRIBUTE_ID_1}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "id": "{{ATTRIBUTE_ID_1}}", + "httpCode": 403, + "jwtToken": "", + "message": "No token provided." + }, + { + "id": "{{ATTRIBUTE_ID_BY_ADMIN}}", + "jwtToken": "Bearer {{user_token}}", + "httpCode": 500, + "message": "You are not allowed to perform this action" + } +] \ No newline at end of file diff --git a/test/postman/testData/attribute/patch-attribute-with-any-fields-by-admin.json b/test/postman/testData/attribute/patch-attribute-with-any-fields-by-admin.json new file mode 100644 index 0000000..a5cb263 --- /dev/null +++ b/test/postman/testData/attribute/patch-attribute-with-any-fields-by-admin.json @@ -0,0 +1,24 @@ +[ + { + "id": "{{ATTRIBUTE_ID_1}}", + "input": { + "attributeGroupId": "{{ATTRIBUTE_GROUP_ID_BY_ADMIN}}", + "name": "POSTMANE2E-attributeGroup02-by-admin-updated111" + }, + "expected": { + "attributeGroupId": "{{ATTRIBUTE_GROUP_ID_BY_ADMIN}}", + "name": "POSTMANE2E-attributeGroup02-by-admin-updated111" + }, + "httpCode": 200 + }, + { + "id": "{{ATTRIBUTE_ID_1}}", + "input": { + "name": "POSTMANE2E-attributeGroup02-by-admin-updated222" + }, + "expected": { + "name": "POSTMANE2E-attributeGroup02-by-admin-updated222" + }, + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/attribute/patch-attribute-with-any-fields-by-user.json b/test/postman/testData/attribute/patch-attribute-with-any-fields-by-user.json new file mode 100644 index 0000000..3f3e401 --- /dev/null +++ b/test/postman/testData/attribute/patch-attribute-with-any-fields-by-user.json @@ -0,0 +1,24 @@ +[ + { + "id": "{{ATTRIBUTE_ID_BY_TESTER}}", + "input": { + "attributeGroupId": "{{ATTRIBUTE_GROUP_ID_BY_ADMIN}}", + "name": "POSTMANE2E-attributeGroup01-by-user-updated111" + }, + "expected": { + "attributeGroupId": "{{ATTRIBUTE_GROUP_ID_BY_ADMIN}}", + "name": "POSTMANE2E-attributeGroup01-by-user-updated111" + }, + "httpCode": 200 + }, + { + "id": "{{ATTRIBUTE_ID_BY_TESTER}}", + "input": { + "name": "POSTMANE2E-attributeGroup01-by-user-updated222" + }, + "expected": { + "name": "POSTMANE2E-attributeGroup01-by-user-updated222" + }, + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/attribute/patch-attribute-with-invalid-data.json b/test/postman/testData/attribute/patch-attribute-with-invalid-data.json new file mode 100644 index 0000000..a685ca6 --- /dev/null +++ b/test/postman/testData/attribute/patch-attribute-with-invalid-data.json @@ -0,0 +1,58 @@ +[ + { + "id": "{{ATTRIBUTE_ID_2}}", + "input": { + "name": "" + }, + "httpCode": 400, + "message": "\"entity.name\" is not allowed to be empty" + }, + { + "id": "{{ATTRIBUTE_ID_2}}", + "input": { + "ccc": "abc" + }, + "httpCode": 400, + "message": "\"entity.ccc\" is not allowed" + }, + { + "id": "123456", + "input": { + "name": "POSTMANE2E-attributeGroup02-by-admin-updated123456" + }, + "httpCode": 500, + "message": "invalid input syntax for type uuid: \"123456\"" + }, + { + "id": "5ba376ee-1151-47df-b695-05a17a28f0ab", + "input": { + "name": "POSTMANE2E-attributeGroup02-by-admin-updated123456" + }, + "httpCode": 404, + "message": "cannot find Attribute where id = 5ba376ee-1151-47df-b695-05a17a28f0ab" + }, + { + "id": "{{ATTRIBUTE_ID_BY_TESTER}}", + "input": { + "attributeGroupId": "5ba376ee-1151-47df-b695-05a17a28f0ab" + }, + "httpCode": 404, + "message": "cannot find AttributeGroup where id = 5ba376ee-1151-47df-b695-05a17a28f0ab" + }, + { + "id": "{{ATTRIBUTE_ID_BY_TESTER}}", + "input": { + "attributeGroupId": "123456" + }, + "httpCode": 500, + "message": "invalid input syntax for type uuid: \"123456\"" + }, + { + "id": "{{ATTRIBUTE_ID_1}}", + "input": { + "name": "POSTMANE2E-attributeGroup02-by-admin-updated222" + }, + "httpCode": 409, + "message": "Attribute already exists with name:POSTMANE2E-attributeGroup02-by-admin-updated222" + } +] \ No newline at end of file diff --git a/test/postman/testData/attribute/patch-attribute-with-invalid-tokens.json b/test/postman/testData/attribute/patch-attribute-with-invalid-tokens.json new file mode 100644 index 0000000..a87aa01 --- /dev/null +++ b/test/postman/testData/attribute/patch-attribute-with-invalid-tokens.json @@ -0,0 +1,20 @@ +[ + { + "id": "{{ATTRIBUTE_ID_2}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "id": "{{ATTRIBUTE_ID_2}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "id": "{{ATTRIBUTE_ID_2}}", + "jwtToken": "", + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/attribute/search-attributes-with-invalid-parameters.json b/test/postman/testData/attribute/search-attributes-with-invalid-parameters.json new file mode 100644 index 0000000..01a8408 --- /dev/null +++ b/test/postman/testData/attribute/search-attributes-with-invalid-parameters.json @@ -0,0 +1,27 @@ +[ + { + "input": "page=-1&perPage=10", + "httpCode": 400, + "message": "\"query.page\" must be larger than or equal to 1" + }, + { + "input": "page=1&perPage=-10", + "httpCode": 400, + "message": "\"query.perPage\" must be larger than or equal to 1" + }, + { + "input": "name=", + "httpCode": 400, + "message": "\"query.name\" is not allowed to be empty" + }, + { + "input": "attributeGroupId=", + "httpCode": 400, + "message": "\"query.attributeGroupId\" is not allowed to be empty" + }, + { + "input": "aa=", + "httpCode": 400, + "message": "\"query.aa\" is not allowed" + } +] \ No newline at end of file diff --git a/test/postman/testData/attribute/search-attributes-with-invalid-tokens.json b/test/postman/testData/attribute/search-attributes-with-invalid-tokens.json new file mode 100644 index 0000000..f25a81a --- /dev/null +++ b/test/postman/testData/attribute/search-attributes-with-invalid-tokens.json @@ -0,0 +1,17 @@ +[ + { + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "jwtToken": "", + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/attribute/search-attributes-with-various-parameters.json b/test/postman/testData/attribute/search-attributes-with-various-parameters.json new file mode 100644 index 0000000..4d5a9ba --- /dev/null +++ b/test/postman/testData/attribute/search-attributes-with-various-parameters.json @@ -0,0 +1,20 @@ +[ + { + "input": "page=1&perPage=10&name=POSTMANE2E&attributeGroupId={{ATTRIBUTE_GROUP_ID_BY_ADMIN}}" + }, + { + "input": "page=1&perPage=10&attributeGroupId={{ATTRIBUTE_GROUP_ID_BY_ADMIN}}" + }, + { + "input": "page=1&perPage=1&name=POSTMANE2E", + "idLabel": "ATTRIBUTE_ID_1" + }, + { + "input": "page=2&perPage=1", + "idLabel": "ATTRIBUTE_ID_2" + }, + { + "input": "page=3&perPage=1", + "idLabel": "ATTRIBUTE_ID_3" + } +] \ No newline at end of file diff --git a/test/postman/testData/external-profile/create-external-profile-by-admin.json b/test/postman/testData/external-profile/create-external-profile-by-admin.json new file mode 100644 index 0000000..8f10125 --- /dev/null +++ b/test/postman/testData/external-profile/create-external-profile-by-admin.json @@ -0,0 +1,58 @@ +[ + { + "user_id": "ce348067-e73f-49d7-af72-fcf11a6c88bf", + "input": { + "organizationId": "{{ORGANIZATION_ID_BY_ADMIN}}", + "externalId": "POSTMANE2E-Topcoder-by-ADMIN-001", + "uri": "http://some.uri", + "isInactive": false + }, + "expected": { + "organizationId": "{{ORGANIZATION_ID_BY_ADMIN}}", + "externalId": "POSTMANE2E-Topcoder-by-ADMIN-001", + "uri": "http://some.uri", + "isInactive": false + }, + "httpCode": 200 + }, + { + "user_id": "35ec01c0-d650-4cd9-8a05-848c9019873d", + "input": { + "organizationId": "{{ORGANIZATION_ID_BY_ADMIN}}", + "externalId": "POSTMANE2E-Topcoder-by-ADMIN-001" + }, + "expected": { + "organizationId": "{{ORGANIZATION_ID_BY_ADMIN}}", + "externalId": "POSTMANE2E-Topcoder-by-ADMIN-001" + }, + "httpCode": 200 + }, + { + "user_id": "4f2dc463-e24b-4b4a-8cde-c0122fbfb8ac", + "input": { + "organizationId": "{{ORGANIZATION_ID_BY_ADMIN}}", + "externalId": "POSTMANE2E-Topcoder-by-ADMIN-003", + "uri": "http://some.uri3" + }, + "expected": { + "organizationId": "{{ORGANIZATION_ID_BY_ADMIN}}", + "externalId": "POSTMANE2E-Topcoder-by-ADMIN-003", + "uri": "http://some.uri3" + }, + "httpCode": 200 + }, + { + "user_id": "ecec4ad8-3a1d-4646-8641-25054e8f2d33", + "input": { + "organizationId": "{{ORGANIZATION_ID_BY_ADMIN}}", + "externalId": "POSTMANE2E-Topcoder-by-ADMIN-004", + "isInactive": true + }, + "expected": { + "organizationId": "{{ORGANIZATION_ID_BY_ADMIN}}", + "externalId": "POSTMANE2E-Topcoder-by-ADMIN-004", + "isInactive": false + }, + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/external-profile/create-external-profile-by-user.json b/test/postman/testData/external-profile/create-external-profile-by-user.json new file mode 100644 index 0000000..a80e337 --- /dev/null +++ b/test/postman/testData/external-profile/create-external-profile-by-user.json @@ -0,0 +1,58 @@ +[ + { + "user_id": "df2f0027-f74f-45fa-85cd-84c9fdc2faf4", + "input": { + "organizationId": "{{ORGANIZATION_ID_BY_ADMIN}}", + "externalId": "POSTMANE2E-Topcoder-by-ADMIN-002", + "uri": "http://some.uri", + "isInactive": false + }, + "expected": { + "organizationId": "{{ORGANIZATION_ID_BY_ADMIN}}", + "externalId": "POSTMANE2E-Topcoder-by-ADMIN-002", + "uri": "http://some.uri", + "isInactive": false + }, + "httpCode": 200 + }, + { + "user_id": "e043286d-ab55-44e3-b2c2-7f7a4f375dcf", + "input": { + "organizationId": "{{ORGANIZATION_ID_BY_ADMIN}}", + "externalId": "POSTMANE2E-Topcoder-by-ADMIN-003" + }, + "expected": { + "organizationId": "{{ORGANIZATION_ID_BY_ADMIN}}", + "externalId": "POSTMANE2E-Topcoder-by-ADMIN-003" + }, + "httpCode": 200 + }, + { + "user_id": "0f8e52c1-33fd-48f2-b160-415c2bb371f2", + "input": { + "organizationId": "{{ORGANIZATION_ID_BY_ADMIN}}", + "externalId": "POSTMANE2E-Topcoder-by-ADMIN-003", + "uri": "http://some.uri3" + }, + "expected": { + "organizationId": "{{ORGANIZATION_ID_BY_ADMIN}}", + "externalId": "POSTMANE2E-Topcoder-by-ADMIN-003", + "uri": "http://some.uri3" + }, + "httpCode": 200 + }, + { + "user_id": "06f130d0-0764-4894-bcd8-67e2758b15d9", + "input": { + "organizationId": "{{ORGANIZATION_ID_BY_ADMIN}}", + "externalId": "POSTMANE2E-Topcoder-TESTER-004", + "isInactive": true + }, + "expected": { + "organizationId": "{{ORGANIZATION_ID_BY_ADMIN}}", + "externalId": "POSTMANE2E-Topcoder-TESTER-004", + "isInactive": true + }, + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/external-profile/create-external-profile-with-invalid-data.json b/test/postman/testData/external-profile/create-external-profile-with-invalid-data.json new file mode 100644 index 0000000..2e522ea --- /dev/null +++ b/test/postman/testData/external-profile/create-external-profile-with-invalid-data.json @@ -0,0 +1,83 @@ +[ + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "input": { + "externalId": "POSTMANE2E-Topcoder-by-ADMIN-001", + "uri": "http://some.uri", + "isInactive": false + }, + "httpCode": 400, + "message": "\"entity.organizationId\" is required" + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "input": { + "organizationId":"", + "externalId": "POSTMANE2E-Topcoder-by-ADMIN-001", + "uri": "http://some.uri", + "isInactive": false + }, + "httpCode": 400, + "message": "\"entity.organizationId\" is not allowed to be empty" + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "input": { + "organizationId": "{{ORGANIZATION_ID_BY_ADMIN}}", + "externalId": "", + "uri": "http://some.uri", + "isInactive": false + }, + "httpCode": 400, + "message": "\"entity.externalId\" is not allowed to be empty" + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "input": { + "organizationId": "{{ORGANIZATION_ID_BY_ADMIN}}", + "externalId": "POSTMANE2E-Topcoder-by-ADMIN-001", + "uri": "", + "isInactive": false + }, + "httpCode": 400, + "message": "\"entity.uri\" is not allowed to be empty" + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "input": { + "organizationId": "{{ORGANIZATION_ID_BY_ADMIN}}", + "externalId": "POSTMANE2E-Topcoder-by-ADMIN-001", + "uri": "http://some.uri", + "isInactive": "anc" + }, + "httpCode": 400, + "message": "\"entity.isInactive\" must be a boolean" + }, + { + "user_id": "ce348067-e73f-49d7-af72-fcf11a6c88bf", + "input": { + "organizationId": "{{ORGANIZATION_ID_BY_ADMIN}}", + "externalId": "123" + }, + "httpCode": 409, + "message": "ExternalProfile already exists with userId:ce348067-e73f-49d7-af72-fcf11a6c88bf" + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "input": { + "organizationId":"75b30af0-46df-4cf6-97ed-3a5608516f4a", + "externalId": "123" + }, + "httpCode": 404, + "message": "cannot find Organization where id = 75b30af0-46df-4cf6-97ed-3a5608516f4a" + }, + { + "user_id": "75b30af0-46df-4cf6-97ed-3a5608516f4a", + "input": { + "organizationId":"{{ORGANIZATION_ID_BY_ADMIN}}", + "externalId": "123" + }, + "httpCode": 404, + "message": "cannot find User where id = 75b30af0-46df-4cf6-97ed-3a5608516f4a" + } +] \ No newline at end of file diff --git a/test/postman/testData/external-profile/create-external-profile-with-invalid-tokens.json b/test/postman/testData/external-profile/create-external-profile-with-invalid-tokens.json new file mode 100644 index 0000000..b878e02 --- /dev/null +++ b/test/postman/testData/external-profile/create-external-profile-with-invalid-tokens.json @@ -0,0 +1,20 @@ +[ + { + "user_id": "{{USER_ID_2}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "user_id": "{{USER_ID_2}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "user_id": "{{USER_ID_2}}", + "jwtToken": "", + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/external-profile/delete-external-profile-by-admin.json b/test/postman/testData/external-profile/delete-external-profile-by-admin.json new file mode 100644 index 0000000..8507c5d --- /dev/null +++ b/test/postman/testData/external-profile/delete-external-profile-by-admin.json @@ -0,0 +1,6 @@ +[ + { + "user_id": "4f2dc463-e24b-4b4a-8cde-c0122fbfb8ac", + "organization_id":"{{ORGANIZATION_ID_BY_ADMIN}}" + } +] \ No newline at end of file diff --git a/test/postman/testData/external-profile/delete-external-profile-with-invalid-request.json b/test/postman/testData/external-profile/delete-external-profile-with-invalid-request.json new file mode 100644 index 0000000..bf8943c --- /dev/null +++ b/test/postman/testData/external-profile/delete-external-profile-with-invalid-request.json @@ -0,0 +1,36 @@ +[ + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "httpCode": 403, + "message": "No token provided." + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "jwtToken": "Bearer {{user_token}}", + "httpCode": 403, + "message": "You are not allowed to perform this action" + }, + { + "user_id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "organization_id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "jwtToken": "Bearer {{admin_token}}", + "httpCode": 404, + "message": "cannot find ExternalProfile where userId:3cd81b8c-d45e-414e-be66-afb31aa0240c, organizationId:3cd81b8c-d45e-414e-be66-afb31aa0240c" + } +] \ No newline at end of file diff --git a/test/postman/testData/external-profile/get-external-profile-by-admin.json b/test/postman/testData/external-profile/get-external-profile-by-admin.json new file mode 100644 index 0000000..5565514 --- /dev/null +++ b/test/postman/testData/external-profile/get-external-profile-by-admin.json @@ -0,0 +1,7 @@ +[ + { + "user_id": "e043286d-ab55-44e3-b2c2-7f7a4f375dcf", + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/external-profile/get-external-profile-by-user.json b/test/postman/testData/external-profile/get-external-profile-by-user.json new file mode 100644 index 0000000..5565514 --- /dev/null +++ b/test/postman/testData/external-profile/get-external-profile-by-user.json @@ -0,0 +1,7 @@ +[ + { + "user_id": "e043286d-ab55-44e3-b2c2-7f7a4f375dcf", + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/external-profile/get-external-profile-with-invalid-parameters.json b/test/postman/testData/external-profile/get-external-profile-with-invalid-parameters.json new file mode 100644 index 0000000..a800a40 --- /dev/null +++ b/test/postman/testData/external-profile/get-external-profile-with-invalid-parameters.json @@ -0,0 +1,26 @@ +[ + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "organization_id": "123456", + "httpCode": 500, + "message": "invalid input syntax for type uuid: \"123456\"" + }, + { + "user_id": "123456", + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "httpCode": 500, + "message": "invalid input syntax for type uuid: \"123456\"" + }, + { + "user_id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "httpCode": 404, + "message": "cannot find ExternalProfile where userId:3cd81b8c-d45e-414e-be66-afb31aa0240c" + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "organization_id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "httpCode": 404, + "message": "cannot find ExternalProfile where userId" + } +] \ No newline at end of file diff --git a/test/postman/testData/external-profile/get-external-profile-with-invalid-tokens.json b/test/postman/testData/external-profile/get-external-profile-with-invalid-tokens.json new file mode 100644 index 0000000..e61f9cb --- /dev/null +++ b/test/postman/testData/external-profile/get-external-profile-with-invalid-tokens.json @@ -0,0 +1,30 @@ +[ + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "httpCode": 403, + "jwtToken": "", + "message": "No token provided." + }, + { + "user_id": "ce348067-e73f-49d7-af72-fcf11a6c88bf", + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "jwtToken": "Bearer {{user_token}}", + "httpCode": 403, + "message": "You are not allowed to perform this action" + } +] \ No newline at end of file diff --git a/test/postman/testData/external-profile/patch-external-profile-with-any-fields-by-admin.json b/test/postman/testData/external-profile/patch-external-profile-with-any-fields-by-admin.json new file mode 100644 index 0000000..8e88ca9 --- /dev/null +++ b/test/postman/testData/external-profile/patch-external-profile-with-any-fields-by-admin.json @@ -0,0 +1,50 @@ +[ + { + "user_id": "ce348067-e73f-49d7-af72-fcf11a6c88bf", + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "input": { + "externalId": "POSTMANE2E-Topcoder-by-ADMIN-updated001", + "uri": "http://some.uri.updated001", + "isInactive": false + }, + "expected": { + "externalId": "POSTMANE2E-Topcoder-by-ADMIN-updated001", + "uri": "http://some.uri.updated001", + "isInactive": false + }, + "httpCode": 200 + }, + { + "user_id": "ce348067-e73f-49d7-af72-fcf11a6c88bf", + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "input": { + "externalId": "POSTMANE2E-Topcoder-by-ADMIN-updated002" + }, + "expected": { + "externalId": "POSTMANE2E-Topcoder-by-ADMIN-updated002" + }, + "httpCode": 200 + }, + { + "user_id": "ce348067-e73f-49d7-af72-fcf11a6c88bf", + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "input": { + "uri": "http://some.uri-updated2" + }, + "expected": { + "uri": "http://some.uri-updated2" + }, + "httpCode": 200 + }, + { + "user_id": "ce348067-e73f-49d7-af72-fcf11a6c88bf", + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "input": { + "isInactive": true + }, + "expected": { + "isInactive": true + }, + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/external-profile/patch-external-profile-with-any-fields-by-user.json b/test/postman/testData/external-profile/patch-external-profile-with-any-fields-by-user.json new file mode 100644 index 0000000..83344d1 --- /dev/null +++ b/test/postman/testData/external-profile/patch-external-profile-with-any-fields-by-user.json @@ -0,0 +1,50 @@ +[ + { + "user_id": "e043286d-ab55-44e3-b2c2-7f7a4f375dcf", + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "input": { + "externalId": "POSTMANE2E-Topcoder-by-ADMIN-updated001", + "uri": "http://some.uri.updated001", + "isInactive": false + }, + "expected": { + "externalId": "POSTMANE2E-Topcoder-by-ADMIN-updated001", + "uri": "http://some.uri.updated001", + "isInactive": false + }, + "httpCode": 200 + }, + { + "user_id": "e043286d-ab55-44e3-b2c2-7f7a4f375dcf", + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "input": { + "externalId": "POSTMANE2E-Topcoder-by-ADMIN-updated002" + }, + "expected": { + "externalId": "POSTMANE2E-Topcoder-by-ADMIN-updated002" + }, + "httpCode": 200 + }, + { + "user_id": "e043286d-ab55-44e3-b2c2-7f7a4f375dcf", + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "input": { + "uri": "http://some.uri-updated2" + }, + "expected": { + "uri": "http://some.uri-updated2" + }, + "httpCode": 200 + }, + { + "user_id": "e043286d-ab55-44e3-b2c2-7f7a4f375dcf", + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "input": { + "isInactive": true + }, + "expected": { + "isInactive": true + }, + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/external-profile/patch-external-profile-with-invalid-data.json b/test/postman/testData/external-profile/patch-external-profile-with-invalid-data.json new file mode 100644 index 0000000..671654d --- /dev/null +++ b/test/postman/testData/external-profile/patch-external-profile-with-invalid-data.json @@ -0,0 +1,54 @@ +[ + { + "user_id": "e043286d-ab55-44e3-b2c2-7f7a4f375dcf", + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "input": { + "uri": "" + }, + "httpCode": 400, + "message": "\"entity.uri\" is not allowed to be empty" + }, + { + "user_id": "e043286d-ab55-44e3-b2c2-7f7a4f375dcf", + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "input": { + "externalId": "" + }, + "httpCode": 400, + "message": "\"entity.externalId\" is not allowed to be empty" + }, + { + "user_id": "e043286d-ab55-44e3-b2c2-7f7a4f375dcf", + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "input": { + "isInactive": "anc" + }, + "httpCode": 400, + "message": "\"entity.isInactive\" must be a boolean" + }, + { + "user_id": "e043286d-ab55-44e3-b2c2-7f7a4f375dcf", + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "input": { + "ccc": "abc" + }, + "httpCode": 400, + "message": "\"entity.ccc\" is not allowed" + }, + { + "user_id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "input": { + }, + "httpCode": 404, + "message": "cannot find User where id = 3cd81b8c-d45e-414e-be66-afb31aa0240c" + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "organization_id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "input": { + }, + "httpCode": 404, + "message": "cannot find Organization where id = 3cd81b8c-d45e-414e-be66-afb31aa0240c" + } +] \ No newline at end of file diff --git a/test/postman/testData/external-profile/patch-external-profile-with-invalid-tokens.json b/test/postman/testData/external-profile/patch-external-profile-with-invalid-tokens.json new file mode 100644 index 0000000..5a989fe --- /dev/null +++ b/test/postman/testData/external-profile/patch-external-profile-with-invalid-tokens.json @@ -0,0 +1,23 @@ +[ + { + "user_id": "e043286d-ab55-44e3-b2c2-7f7a4f375dcf", + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "user_id": "e043286d-ab55-44e3-b2c2-7f7a4f375dcf", + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "user_id": "e043286d-ab55-44e3-b2c2-7f7a4f375dcf", + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "jwtToken": "", + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/external-profile/search-external-profiles-with-invalid-parameters.json b/test/postman/testData/external-profile/search-external-profiles-with-invalid-parameters.json new file mode 100644 index 0000000..b70599a --- /dev/null +++ b/test/postman/testData/external-profile/search-external-profiles-with-invalid-parameters.json @@ -0,0 +1,40 @@ +[ + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "input": "page=-1&perPage=10", + "httpCode": 400, + "message": "\"query.page\" must be larger than or equal to 1" + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "input": "page=1&perPage=-10", + "httpCode": 400, + "message": "\"query.perPage\" must be larger than or equal to 1" + }, + { + "input": "organizationName=", + "httpCode": 400, + "message": "\"query.organizationName\" is not allowed to be empty" + }, + { + "input": "externalId=", + "httpCode": 400, + "message": "\"query.externalId\" is not allowed to be empty" + }, + { + "input": "isInactive=", + "httpCode": 400, + "message": "\"query.isInactive\" must be a boolean" + }, + { + "input": "isInactive=aaa", + "httpCode": 400, + "message": "\"query.isInactive\" must be a boolean" + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "input": "aa=cc", + "httpCode": 400, + "message": "\"query.aa\" is not allowed" + } +] \ No newline at end of file diff --git a/test/postman/testData/external-profile/search-external-profiles-with-invalid-tokens.json b/test/postman/testData/external-profile/search-external-profiles-with-invalid-tokens.json new file mode 100644 index 0000000..fbcdb9f --- /dev/null +++ b/test/postman/testData/external-profile/search-external-profiles-with-invalid-tokens.json @@ -0,0 +1,20 @@ +[ + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "jwtToken": "", + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/external-profile/search-external-profiles-with-various-parameters.json b/test/postman/testData/external-profile/search-external-profiles-with-various-parameters.json new file mode 100644 index 0000000..1bbd2d8 --- /dev/null +++ b/test/postman/testData/external-profile/search-external-profiles-with-various-parameters.json @@ -0,0 +1,22 @@ +[ + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "input": "page=1&perPage=10&organizationName=POSTMANE2E-&externalId=884783&isInactive=true" + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "input": "page=1&perPage=10" + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "input": "organizationName=POSTMANE2E-" + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "input": "externalId=884783" + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "input": "isInactive=true" + } +] \ No newline at end of file diff --git a/test/postman/testData/organization-skill-provider/create-organization-skill-provider-by-admin.json b/test/postman/testData/organization-skill-provider/create-organization-skill-provider-by-admin.json new file mode 100644 index 0000000..496b3d4 --- /dev/null +++ b/test/postman/testData/organization-skill-provider/create-organization-skill-provider-by-admin.json @@ -0,0 +1,12 @@ +[ + { + "organization_id": "a866fd95-c2d5-4fa8-b341-a367138c9911", + "input": { + "skillProviderId":"7637ae1a-3b7c-44eb-a5ed-10ea02f1885d" + }, + "expected": { + "skillProviderId":"7637ae1a-3b7c-44eb-a5ed-10ea02f1885d" + }, + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/organization-skill-provider/create-organization-skill-provider-by-user.json b/test/postman/testData/organization-skill-provider/create-organization-skill-provider-by-user.json new file mode 100644 index 0000000..299a67c --- /dev/null +++ b/test/postman/testData/organization-skill-provider/create-organization-skill-provider-by-user.json @@ -0,0 +1,12 @@ +[ + { + "organization_id": "a866fd95-c2d5-4fa8-b341-a367138c9911", + "input": { + "skillProviderId":"1edf3f25-435d-4d19-ac09-9467a8e6858c" + }, + "expected": { + "skillProviderId":"1edf3f25-435d-4d19-ac09-9467a8e6858c" + }, + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/organization-skill-provider/create-organization-skill-provider-with-invalid-data.json b/test/postman/testData/organization-skill-provider/create-organization-skill-provider-with-invalid-data.json new file mode 100644 index 0000000..6a85d16 --- /dev/null +++ b/test/postman/testData/organization-skill-provider/create-organization-skill-provider-with-invalid-data.json @@ -0,0 +1,41 @@ +[ + { + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "input": { + }, + "httpCode": 400, + "message": "\"entity.skillProviderId\" is required" + }, + { + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "input": { + "skillProviderId":"" + }, + "httpCode": 400, + "message": "\"entity.skillProviderId\" is not allowed to be empty" + }, + { + "organization_id": "a866fd95-c2d5-4fa8-b341-a367138c9911", + "input": { + "skillProviderId":"7637ae1a-3b7c-44eb-a5ed-10ea02f1885d" + }, + "httpCode": 409, + "message": "OrganizationSkillsProvider already exists with organizationId:" + }, + { + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "input": { + "skillProviderId":"75b30af0-46df-4cf6-97ed-3a5608516f4a" + }, + "httpCode": 404, + "message": "cannot find SkillsProvider where id = 75b30af0-46df-4cf6-97ed-3a5608516f4a" + }, + { + "organization_id": "75b30af0-46df-4cf6-97ed-3a5608516f4a", + "input": { + "skillProviderId":"{{PROVIDER_ID_BY_ADMIN}}" + }, + "httpCode": 404, + "message": "cannot find Organization where id = 75b30af0-46df-4cf6-97ed-3a5608516f4a" + } +] \ No newline at end of file diff --git a/test/postman/testData/organization-skill-provider/create-organization-skill-provider-with-invalid-tokens.json b/test/postman/testData/organization-skill-provider/create-organization-skill-provider-with-invalid-tokens.json new file mode 100644 index 0000000..ec81c9e --- /dev/null +++ b/test/postman/testData/organization-skill-provider/create-organization-skill-provider-with-invalid-tokens.json @@ -0,0 +1,20 @@ +[ + { + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "jwtToken": "", + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/organization-skill-provider/delete-organization-skill-provider-by-admin.json b/test/postman/testData/organization-skill-provider/delete-organization-skill-provider-by-admin.json new file mode 100644 index 0000000..ae426c0 --- /dev/null +++ b/test/postman/testData/organization-skill-provider/delete-organization-skill-provider-by-admin.json @@ -0,0 +1,6 @@ +[ + { + "organization_id": "a866fd95-c2d5-4fa8-b341-a367138c9911", + "skillProvider_id":"7637ae1a-3b7c-44eb-a5ed-10ea02f1885d" + } +] \ No newline at end of file diff --git a/test/postman/testData/organization-skill-provider/delete-organization-skill-provider-with-invalid-request.json b/test/postman/testData/organization-skill-provider/delete-organization-skill-provider-with-invalid-request.json new file mode 100644 index 0000000..31e559e --- /dev/null +++ b/test/postman/testData/organization-skill-provider/delete-organization-skill-provider-with-invalid-request.json @@ -0,0 +1,36 @@ +[ + { + "organization_id": "a866fd95-c2d5-4fa8-b341-a367138c9911", + "skillProvider_id":"7637ae1a-3b7c-44eb-a5ed-10ea02f1885d", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "organization_id": "a866fd95-c2d5-4fa8-b341-a367138c9911", + "skillProvider_id":"7637ae1a-3b7c-44eb-a5ed-10ea02f1885d", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "organization_id": "a866fd95-c2d5-4fa8-b341-a367138c9911", + "skillProvider_id":"7637ae1a-3b7c-44eb-a5ed-10ea02f1885d", + "httpCode": 403, + "message": "No token provided." + }, + { + "organization_id": "a866fd95-c2d5-4fa8-b341-a367138c9911", + "skillProvider_id":"7637ae1a-3b7c-44eb-a5ed-10ea02f1885d", + "jwtToken": "Bearer {{user_token}}", + "httpCode": 403, + "message": "You are not allowed to perform this action" + }, + { + "organization_id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "skillProvider_id":"3cd81b8c-d45e-414e-be66-afb31aa0240c", + "jwtToken": "Bearer {{admin_token}}", + "httpCode": 404, + "message": "cannot find OrganizationSkillsProvider where organizationId:3cd81b8c-d45e-414e-be66-afb31aa0240c, skillProviderId:3cd81b8c-d45e-414e-be66-afb31aa0240c" + } +] \ No newline at end of file diff --git a/test/postman/testData/organization-skill-provider/get-organization-skill-provider-by-admin.json b/test/postman/testData/organization-skill-provider/get-organization-skill-provider-by-admin.json new file mode 100644 index 0000000..76241b5 --- /dev/null +++ b/test/postman/testData/organization-skill-provider/get-organization-skill-provider-by-admin.json @@ -0,0 +1,7 @@ +[ + { + "organization_id": "a866fd95-c2d5-4fa8-b341-a367138c9911", + "skillProvider_id":"7637ae1a-3b7c-44eb-a5ed-10ea02f1885d", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/organization-skill-provider/get-organization-skill-provider-by-user.json b/test/postman/testData/organization-skill-provider/get-organization-skill-provider-by-user.json new file mode 100644 index 0000000..8e4aa52 --- /dev/null +++ b/test/postman/testData/organization-skill-provider/get-organization-skill-provider-by-user.json @@ -0,0 +1,7 @@ +[ + { + "organization_id": "a866fd95-c2d5-4fa8-b341-a367138c9911", + "skillProvider_id":"1edf3f25-435d-4d19-ac09-9467a8e6858c", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/organization-skill-provider/get-organization-skill-provider-with-invalid-parameters.json b/test/postman/testData/organization-skill-provider/get-organization-skill-provider-with-invalid-parameters.json new file mode 100644 index 0000000..4bd9f94 --- /dev/null +++ b/test/postman/testData/organization-skill-provider/get-organization-skill-provider-with-invalid-parameters.json @@ -0,0 +1,26 @@ +[ + { + "organization_id": "a866fd95-c2d5-4fa8-b341-a367138c9911", + "skillProvider_id": "123456", + "httpCode": 500, + "message": "invalid input syntax for type uuid: \"123456\"" + }, + { + "organization_id": "123456", + "skillProvider_id":"7637ae1a-3b7c-44eb-a5ed-10ea02f1885d", + "httpCode": 500, + "message": "invalid input syntax for type uuid: \"123456\"" + }, + { + "organization_id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "skillProvider_id":"7637ae1a-3b7c-44eb-a5ed-10ea02f1885d", + "httpCode": 404, + "message": "cannot find OrganizationSkillsProvider where organizationId:3cd81b8c-d45e-414e-be66-afb31aa0240c, skillProviderId:7637ae1a-3b7c-44eb-a5ed-10ea02f1885d" + }, + { + "organization_id": "a866fd95-c2d5-4fa8-b341-a367138c9911", + "skillProvider_id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "httpCode": 404, + "message": "cannot find OrganizationSkillsProvider where organizationId:a866fd95-c2d5-4fa8-b341-a367138c9911, skillProviderId:3cd81b8c-d45e-414e-be66-afb31aa0240c" + } +] \ No newline at end of file diff --git a/test/postman/testData/organization-skill-provider/get-organization-skill-provider-with-invalid-tokens.json b/test/postman/testData/organization-skill-provider/get-organization-skill-provider-with-invalid-tokens.json new file mode 100644 index 0000000..d48de0c --- /dev/null +++ b/test/postman/testData/organization-skill-provider/get-organization-skill-provider-with-invalid-tokens.json @@ -0,0 +1,30 @@ +[ + { + "organization_id": "a866fd95-c2d5-4fa8-b341-a367138c9911", + "skillProvider_id":"7637ae1a-3b7c-44eb-a5ed-10ea02f1885d", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "organization_id": "a866fd95-c2d5-4fa8-b341-a367138c9911", + "skillProvider_id":"7637ae1a-3b7c-44eb-a5ed-10ea02f1885d", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "organization_id": "a866fd95-c2d5-4fa8-b341-a367138c9911", + "skillProvider_id":"7637ae1a-3b7c-44eb-a5ed-10ea02f1885d", + "httpCode": 403, + "jwtToken": "", + "message": "No token provided." + }, + { + "organization_id": "a866fd95-c2d5-4fa8-b341-a367138c9911", + "skillProvider_id":"7637ae1a-3b7c-44eb-a5ed-10ea02f1885d", + "jwtToken": "Bearer {{user_token}}", + "httpCode": 403, + "message": "You are not allowed to perform this action" + } +] \ No newline at end of file diff --git a/test/postman/testData/organization-skill-provider/search-organization-skill-providers-with-invalid-parameters.json b/test/postman/testData/organization-skill-provider/search-organization-skill-providers-with-invalid-parameters.json new file mode 100644 index 0000000..eb5a246 --- /dev/null +++ b/test/postman/testData/organization-skill-provider/search-organization-skill-providers-with-invalid-parameters.json @@ -0,0 +1,26 @@ +[ + { + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "input": "page=-1&perPage=10", + "httpCode": 400, + "message": "\"query.page\" must be larger than or equal to 1" + }, + { + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "input": "page=1&perPage=-10", + "httpCode": 400, + "message": "\"query.perPage\" must be larger than or equal to 1" + }, + { + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "input": "aa=cc", + "httpCode": 400, + "message": "\"query.aa\" is not allowed" + }, + { + "organization_id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "input": "", + "httpCode": 404, + "message": "cannot find Organization where id = 3cd81b8c-d45e-414e-be66-afb31aa0240c" + } +] \ No newline at end of file diff --git a/test/postman/testData/organization-skill-provider/search-organization-skill-providers-with-invalid-tokens.json b/test/postman/testData/organization-skill-provider/search-organization-skill-providers-with-invalid-tokens.json new file mode 100644 index 0000000..ec81c9e --- /dev/null +++ b/test/postman/testData/organization-skill-provider/search-organization-skill-providers-with-invalid-tokens.json @@ -0,0 +1,20 @@ +[ + { + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "jwtToken": "", + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/organization-skill-provider/search-organization-skill-providers-with-various-parameters.json b/test/postman/testData/organization-skill-provider/search-organization-skill-providers-with-various-parameters.json new file mode 100644 index 0000000..f0998c4 --- /dev/null +++ b/test/postman/testData/organization-skill-provider/search-organization-skill-providers-with-various-parameters.json @@ -0,0 +1,10 @@ +[ + { + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "input": "page=1&perPage=10" + }, + { + "organization_id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "input": "" + } +] \ No newline at end of file diff --git a/test/postman/testData/organization/create-organization-by-admin.json b/test/postman/testData/organization/create-organization-by-admin.json new file mode 100644 index 0000000..7b5031b --- /dev/null +++ b/test/postman/testData/organization/create-organization-by-admin.json @@ -0,0 +1,14 @@ +[ + { + "name": "POSTMANE2E-Role01-by-admin", + "httpCode": 200 + }, + { + "name": "POSTMANE2E-Role02-by-admin", + "httpCode": 200 + }, + { + "name": "POSTMANE2E-Role03-by-admin", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/organization/create-organization-by-user.json b/test/postman/testData/organization/create-organization-by-user.json new file mode 100644 index 0000000..33efc0d --- /dev/null +++ b/test/postman/testData/organization/create-organization-by-user.json @@ -0,0 +1,14 @@ +[ + { + "name": "POSTMANE2E-Role01-by-user", + "httpCode": 200 + }, + { + "name": "POSTMANE2E-Role02-by-user", + "httpCode": 200 + }, + { + "name": "POSTMANE2E-Role03-by-user", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/organization/create-organization-with-invalid-data.json b/test/postman/testData/organization/create-organization-with-invalid-data.json new file mode 100644 index 0000000..bf7a8de --- /dev/null +++ b/test/postman/testData/organization/create-organization-with-invalid-data.json @@ -0,0 +1,30 @@ +[ + { + "input": { + }, + "httpCode": 400, + "message": "\"entity.name\" is required" + }, + { + "input": { + "name": "" + }, + "httpCode": 400, + "message": "\"entity.name\" is not allowed to be empty" + }, + { + "input": { + "name": "POSTMANE2E-skill-validname", + "aaa":"ccc" + }, + "httpCode": 400, + "message": "\"entity.aaa\" is not allowed" + }, + { + "input": { + "name": "POSTMANE2E-Role02-by-admin" + }, + "httpCode": 409, + "message": "Organization already exists with name:POSTMANE2E-Role02-by-admin" + } +] \ No newline at end of file diff --git a/test/postman/testData/organization/create-organization-with-invalid-tokens.json b/test/postman/testData/organization/create-organization-with-invalid-tokens.json new file mode 100644 index 0000000..dc4c631 --- /dev/null +++ b/test/postman/testData/organization/create-organization-with-invalid-tokens.json @@ -0,0 +1,16 @@ +[ + { + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/organization/delete-organization-with-invalid-request.json b/test/postman/testData/organization/delete-organization-with-invalid-request.json new file mode 100644 index 0000000..1ca63fe --- /dev/null +++ b/test/postman/testData/organization/delete-organization-with-invalid-request.json @@ -0,0 +1,25 @@ +[ + { + "id": "{{ORGANIZATION_ID_3}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "id": "{{ORGANIZATION_ID_3}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "id": "{{ORGANIZATION_ID_3}}", + "httpCode": 403, + "message": "No token provided." + }, + { + "id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "jwtToken": "Bearer {{user_token}}", + "httpCode": 403, + "message": "You are not allowed to perform this action" + } +] \ No newline at end of file diff --git a/test/postman/testData/organization/get-organization-by-admin.json b/test/postman/testData/organization/get-organization-by-admin.json new file mode 100644 index 0000000..27967c4 --- /dev/null +++ b/test/postman/testData/organization/get-organization-by-admin.json @@ -0,0 +1,10 @@ +[ + { + "id": "{{ORGANIZATION_ID_1}}", + "httpCode": 200 + }, + { + "id": "{{ORGANIZATION_ID_2}}", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/organization/get-organization-by-user.json b/test/postman/testData/organization/get-organization-by-user.json new file mode 100644 index 0000000..4ce0164 --- /dev/null +++ b/test/postman/testData/organization/get-organization-by-user.json @@ -0,0 +1,6 @@ +[ + { + "id": "{{ORGANIZATION_ID_BY_TESTER}}", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/organization/get-organization-with-invalid-parameters.json b/test/postman/testData/organization/get-organization-with-invalid-parameters.json new file mode 100644 index 0000000..89a06cb --- /dev/null +++ b/test/postman/testData/organization/get-organization-with-invalid-parameters.json @@ -0,0 +1,12 @@ +[ + { + "id": "123456", + "httpCode": 500, + "message": "invalid input syntax for type uuid: \"123456\"" + }, + { + "id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "httpCode": 404, + "message": "cannot find Organization where id = 3cd81b8c-d45e-414e-be66-afb31aa0240c" + } +] \ No newline at end of file diff --git a/test/postman/testData/organization/get-organization-with-invalid-tokens.json b/test/postman/testData/organization/get-organization-with-invalid-tokens.json new file mode 100644 index 0000000..b73bef9 --- /dev/null +++ b/test/postman/testData/organization/get-organization-with-invalid-tokens.json @@ -0,0 +1,26 @@ +[ + { + "id": "{{ORGANIZATION_ID_1}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "id": "{{ORGANIZATION_ID_1}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "id": "{{ORGANIZATION_ID_1}}", + "httpCode": 403, + "jwtToken": "", + "message": "No token provided." + }, + { + "id": "{{ORGANIZATION_ID_BY_ADMIN}}", + "jwtToken": "Bearer {{user_token}}", + "httpCode": 500, + "message": "You are not allowed to perform this action" + } +] \ No newline at end of file diff --git a/test/postman/testData/organization/patch-organization-with-any-fields-by-admin.json b/test/postman/testData/organization/patch-organization-with-any-fields-by-admin.json new file mode 100644 index 0000000..a10975f --- /dev/null +++ b/test/postman/testData/organization/patch-organization-with-any-fields-by-admin.json @@ -0,0 +1,12 @@ +[ + { + "id": "{{ORGANIZATION_ID_1}}", + "input": { + "name": "POSTMANE2E-organization02-by-admin-updated" + }, + "expected": { + "name": "POSTMANE2E-organization02-by-admin-updated" + }, + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/organization/patch-organization-with-any-fields-by-user.json b/test/postman/testData/organization/patch-organization-with-any-fields-by-user.json new file mode 100644 index 0000000..84426f8 --- /dev/null +++ b/test/postman/testData/organization/patch-organization-with-any-fields-by-user.json @@ -0,0 +1,12 @@ +[ + { + "id": "{{ORGANIZATION_ID_BY_TESTER}}", + "input": { + "name": "POSTMANE2E-organization01-by-user-updated" + }, + "expected": { + "name": "POSTMANE2E-organization01-by-user-updated" + }, + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/organization/patch-organization-with-invalid-data.json b/test/postman/testData/organization/patch-organization-with-invalid-data.json new file mode 100644 index 0000000..da995bc --- /dev/null +++ b/test/postman/testData/organization/patch-organization-with-invalid-data.json @@ -0,0 +1,42 @@ +[ + { + "id": "{{ORGANIZATION_ID_2}}", + "input": { + "name": "" + }, + "httpCode": 400, + "message": "\"entity.name\" is not allowed to be empty" + }, + { + "id": "{{ORGANIZATION_ID_2}}", + "input": { + "ccc": "abc" + }, + "httpCode": 400, + "message": "\"entity.ccc\" is not allowed" + }, + { + "id": "123456", + "input": { + "name": "POSTMANE2E-organization02-by-admin-updated123456" + }, + "httpCode": 500, + "message": "invalid input syntax for type uuid: \"123456\"" + }, + { + "id": "5ba376ee-1151-47df-b695-05a17a28f0ab", + "input": { + "name": "POSTMANE2E-organization02-by-admin-updated123456" + }, + "httpCode": 404, + "message": "cannot find Organization where id = 5ba376ee-1151-47df-b695-05a17a28f0ab" + }, + { + "id": "{{ORGANIZATION_ID_1}}", + "input": { + "name": "POSTMANE2E-organization02-by-admin-updated" + }, + "httpCode": 409, + "message": "Organization already exists with name:POSTMANE2E-organization02-by-admin-updated" + } +] \ No newline at end of file diff --git a/test/postman/testData/organization/patch-organization-with-invalid-tokens.json b/test/postman/testData/organization/patch-organization-with-invalid-tokens.json new file mode 100644 index 0000000..737c83d --- /dev/null +++ b/test/postman/testData/organization/patch-organization-with-invalid-tokens.json @@ -0,0 +1,19 @@ +[ + { + "id": "{{ORGANIZATION_ID_2}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "id": "{{ORGANIZATION_ID_2}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "id": "{{ORGANIZATION_ID_2}}", + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/organization/search-organizations-with-invalid-parameters.json b/test/postman/testData/organization/search-organizations-with-invalid-parameters.json new file mode 100644 index 0000000..a64c3dc --- /dev/null +++ b/test/postman/testData/organization/search-organizations-with-invalid-parameters.json @@ -0,0 +1,22 @@ +[ + { + "input": "page=-1&perPage=10", + "httpCode": 400, + "message": "\"query.page\" must be larger than or equal to 1" + }, + { + "input": "page=1&perPage=-10", + "httpCode": 400, + "message": "\"query.perPage\" must be larger than or equal to 1" + }, + { + "input": "name=", + "httpCode": 400, + "message": "\"query.name\" is not allowed to be empty" + }, + { + "input": "aa=", + "httpCode": 400, + "message": "\"query.aa\" is not allowed" + } +] \ No newline at end of file diff --git a/test/postman/testData/organization/search-organizations-with-invalid-tokens.json b/test/postman/testData/organization/search-organizations-with-invalid-tokens.json new file mode 100644 index 0000000..f25a81a --- /dev/null +++ b/test/postman/testData/organization/search-organizations-with-invalid-tokens.json @@ -0,0 +1,17 @@ +[ + { + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "jwtToken": "", + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/organization/search-organizations-with-various-parameters.json b/test/postman/testData/organization/search-organizations-with-various-parameters.json new file mode 100644 index 0000000..f3a16f8 --- /dev/null +++ b/test/postman/testData/organization/search-organizations-with-various-parameters.json @@ -0,0 +1,17 @@ +[ + { + "input": "page=1&perPage=10&name=POSTMANE2E" + }, + { + "input": "page=1&perPage=1&name=POSTMANE2E", + "idLabel": "ORGANIZATION_ID_1" + }, + { + "input": "page=2&perPage=1", + "idLabel": "ORGANIZATION_ID_2" + }, + { + "input": "page=3&perPage=1", + "idLabel": "ORGANIZATION_ID_3" + } +] \ No newline at end of file diff --git a/test/postman/testData/role/create-role-by-admin.json b/test/postman/testData/role/create-role-by-admin.json new file mode 100644 index 0000000..7b5031b --- /dev/null +++ b/test/postman/testData/role/create-role-by-admin.json @@ -0,0 +1,14 @@ +[ + { + "name": "POSTMANE2E-Role01-by-admin", + "httpCode": 200 + }, + { + "name": "POSTMANE2E-Role02-by-admin", + "httpCode": 200 + }, + { + "name": "POSTMANE2E-Role03-by-admin", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/role/create-role-by-user.json b/test/postman/testData/role/create-role-by-user.json new file mode 100644 index 0000000..33efc0d --- /dev/null +++ b/test/postman/testData/role/create-role-by-user.json @@ -0,0 +1,14 @@ +[ + { + "name": "POSTMANE2E-Role01-by-user", + "httpCode": 200 + }, + { + "name": "POSTMANE2E-Role02-by-user", + "httpCode": 200 + }, + { + "name": "POSTMANE2E-Role03-by-user", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/role/create-role-with-invalid-data.json b/test/postman/testData/role/create-role-with-invalid-data.json new file mode 100644 index 0000000..0dc985d --- /dev/null +++ b/test/postman/testData/role/create-role-with-invalid-data.json @@ -0,0 +1,30 @@ +[ + { + "input": { + }, + "httpCode": 400, + "message": "\"entity.name\" is required" + }, + { + "input": { + "name": "" + }, + "httpCode": 400, + "message": "\"entity.name\" is not allowed to be empty" + }, + { + "input": { + "name": "POSTMANE2E-skill-validname", + "aaa":"ccc" + }, + "httpCode": 400, + "message": "\"entity.aaa\" is not allowed" + }, + { + "input": { + "name": "POSTMANE2E-Role02-by-admin" + }, + "httpCode": 409, + "message": "Role already exists with name:POSTMANE2E-Role02-by-admin" + } +] \ No newline at end of file diff --git a/test/postman/testData/role/create-role-with-invalid-tokens.json b/test/postman/testData/role/create-role-with-invalid-tokens.json new file mode 100644 index 0000000..dc4c631 --- /dev/null +++ b/test/postman/testData/role/create-role-with-invalid-tokens.json @@ -0,0 +1,16 @@ +[ + { + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/role/delete-role-by-admin.json b/test/postman/testData/role/delete-role-by-admin.json new file mode 100644 index 0000000..f09cd79 --- /dev/null +++ b/test/postman/testData/role/delete-role-by-admin.json @@ -0,0 +1,5 @@ +[ + { + "id": "{{ROLE_ID_FOR_DELETE}}" + } +] \ No newline at end of file diff --git a/test/postman/testData/role/delete-role-with-invalid-request.json b/test/postman/testData/role/delete-role-with-invalid-request.json new file mode 100644 index 0000000..db02bfb --- /dev/null +++ b/test/postman/testData/role/delete-role-with-invalid-request.json @@ -0,0 +1,31 @@ +[ + { + "id": "{{ROLE_ID_3}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "id": "{{ROLE_ID_3}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "id": "{{ROLE_ID_3}}", + "httpCode": 403, + "message": "No token provided." + }, + { + "id": "{{ROLE_ID_BY_ADMIN}}", + "jwtToken": "Bearer {{user_token}}", + "httpCode": 403, + "message": "You are not allowed to perform this action" + }, + { + "id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "jwtToken": "Bearer {{admin_token}}", + "httpCode": 404, + "message": "cannot find Role where id = 3cd81b8c-d45e-414e-be66-afb31aa0240c" + } +] \ No newline at end of file diff --git a/test/postman/testData/role/get-role-by-admin.json b/test/postman/testData/role/get-role-by-admin.json new file mode 100644 index 0000000..f946a9f --- /dev/null +++ b/test/postman/testData/role/get-role-by-admin.json @@ -0,0 +1,10 @@ +[ + { + "id": "{{ROLE_ID_1}}", + "httpCode": 200 + }, + { + "id": "{{ROLE_ID_2}}", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/role/get-role-by-user.json b/test/postman/testData/role/get-role-by-user.json new file mode 100644 index 0000000..6cde503 --- /dev/null +++ b/test/postman/testData/role/get-role-by-user.json @@ -0,0 +1,6 @@ +[ + { + "id": "{{ROLE_ID_BY_TESTER}}", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/role/get-role-with-invalid-parameters.json b/test/postman/testData/role/get-role-with-invalid-parameters.json new file mode 100644 index 0000000..d1b76c5 --- /dev/null +++ b/test/postman/testData/role/get-role-with-invalid-parameters.json @@ -0,0 +1,12 @@ +[ + { + "id": "123456", + "httpCode": 500, + "message": "invalid input syntax for type uuid: \"123456\"" + }, + { + "id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "httpCode": 404, + "message": "cannot find Role where id = 3cd81b8c-d45e-414e-be66-afb31aa0240c" + } +] \ No newline at end of file diff --git a/test/postman/testData/role/get-role-with-invalid-tokens.json b/test/postman/testData/role/get-role-with-invalid-tokens.json new file mode 100644 index 0000000..57d1bab --- /dev/null +++ b/test/postman/testData/role/get-role-with-invalid-tokens.json @@ -0,0 +1,26 @@ +[ + { + "id": "{{ROLE_ID_1}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "id": "{{ROLE_ID_1}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "id": "{{ROLE_ID_1}}", + "httpCode": 403, + "jwtToken": "", + "message": "No token provided." + }, + { + "id": "{{ROLE_ID_BY_ADMIN}}", + "jwtToken": "Bearer {{user_token}}", + "httpCode": 500, + "message": "You are not allowed to perform this action" + } +] \ No newline at end of file diff --git a/test/postman/testData/role/patch-role-with-any-fields-by-admin.json b/test/postman/testData/role/patch-role-with-any-fields-by-admin.json new file mode 100644 index 0000000..7f0f0c1 --- /dev/null +++ b/test/postman/testData/role/patch-role-with-any-fields-by-admin.json @@ -0,0 +1,12 @@ +[ + { + "id": "{{ROLE_ID_1}}", + "input": { + "name": "POSTMANE2E-role02-by-admin-updated" + }, + "expected": { + "name": "POSTMANE2E-role02-by-admin-updated" + }, + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/role/patch-role-with-any-fields-by-user.json b/test/postman/testData/role/patch-role-with-any-fields-by-user.json new file mode 100644 index 0000000..9aa22b4 --- /dev/null +++ b/test/postman/testData/role/patch-role-with-any-fields-by-user.json @@ -0,0 +1,12 @@ +[ + { + "id": "{{ROLE_ID_BY_TESTER}}", + "input": { + "name": "POSTMANE2E-role01-by-user-updated" + }, + "expected": { + "name": "POSTMANE2E-role01-by-user-updated" + }, + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/role/patch-role-with-invalid-data.json b/test/postman/testData/role/patch-role-with-invalid-data.json new file mode 100644 index 0000000..4322dbd --- /dev/null +++ b/test/postman/testData/role/patch-role-with-invalid-data.json @@ -0,0 +1,42 @@ +[ + { + "id": "{{ROLE_ID_2}}", + "input": { + "name": "" + }, + "httpCode": 400, + "message": "\"entity.name\" is not allowed to be empty" + }, + { + "id": "{{ROLE_ID_2}}", + "input": { + "ccc": "abc" + }, + "httpCode": 400, + "message": "\"entity.ccc\" is not allowed" + }, + { + "id": "123456", + "input": { + "name": "POSTMANE2E-role02-by-admin-updated123456" + }, + "httpCode": 500, + "message": "invalid input syntax for type uuid: \"123456\"" + }, + { + "id": "5ba376ee-1151-47df-b695-05a17a28f0ab", + "input": { + "name": "POSTMANE2E-role02-by-admin-updated123456" + }, + "httpCode": 404, + "message": "cannot find Role where id = 5ba376ee-1151-47df-b695-05a17a28f0ab" + }, + { + "id": "{{ROLE_ID_1}}", + "input": { + "name": "POSTMANE2E-role02-by-admin-updated" + }, + "httpCode": 409, + "message": "Role already exists with name:POSTMANE2E-role02-by-admin-updated" + } +] \ No newline at end of file diff --git a/test/postman/testData/role/patch-role-with-invalid-tokens.json b/test/postman/testData/role/patch-role-with-invalid-tokens.json new file mode 100644 index 0000000..ec2ef85 --- /dev/null +++ b/test/postman/testData/role/patch-role-with-invalid-tokens.json @@ -0,0 +1,19 @@ +[ + { + "id": "{{ROLE_ID_2}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "id": "{{ROLE_ID_2}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "id": "{{ROLE_ID_2}}", + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/role/search-roles-with-invalid-parameters.json b/test/postman/testData/role/search-roles-with-invalid-parameters.json new file mode 100644 index 0000000..a64c3dc --- /dev/null +++ b/test/postman/testData/role/search-roles-with-invalid-parameters.json @@ -0,0 +1,22 @@ +[ + { + "input": "page=-1&perPage=10", + "httpCode": 400, + "message": "\"query.page\" must be larger than or equal to 1" + }, + { + "input": "page=1&perPage=-10", + "httpCode": 400, + "message": "\"query.perPage\" must be larger than or equal to 1" + }, + { + "input": "name=", + "httpCode": 400, + "message": "\"query.name\" is not allowed to be empty" + }, + { + "input": "aa=", + "httpCode": 400, + "message": "\"query.aa\" is not allowed" + } +] \ No newline at end of file diff --git a/test/postman/testData/role/search-roles-with-invalid-tokens.json b/test/postman/testData/role/search-roles-with-invalid-tokens.json new file mode 100644 index 0000000..f25a81a --- /dev/null +++ b/test/postman/testData/role/search-roles-with-invalid-tokens.json @@ -0,0 +1,17 @@ +[ + { + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "jwtToken": "", + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/role/search-roles-with-various-parameters.json b/test/postman/testData/role/search-roles-with-various-parameters.json new file mode 100644 index 0000000..5e55b0b --- /dev/null +++ b/test/postman/testData/role/search-roles-with-various-parameters.json @@ -0,0 +1,17 @@ +[ + { + "input": "page=1&perPage=10&name=POSTMANE2E" + }, + { + "input": "page=1&perPage=1", + "idLabel": "ROLE_ID_1" + }, + { + "input": "page=2&perPage=1", + "idLabel": "ROLE_ID_2" + }, + { + "input": "page=3&perPage=1", + "idLabel": "ROLE_ID_3" + } +] \ No newline at end of file diff --git a/test/postman/testData/skill-provider/create-skill-provider-by-admin.json b/test/postman/testData/skill-provider/create-skill-provider-by-admin.json new file mode 100644 index 0000000..602a692 --- /dev/null +++ b/test/postman/testData/skill-provider/create-skill-provider-by-admin.json @@ -0,0 +1,14 @@ +[ + { + "name": "POSTMANE2E-skill-provider01-by-admin", + "httpCode": 200 + }, + { + "name": "POSTMANE2E-skill-provider02-by-admin", + "httpCode": 200 + }, + { + "name": "POSTMANE2E-skill-provider03-by-admin", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/skill-provider/create-skill-provider-by-user.json b/test/postman/testData/skill-provider/create-skill-provider-by-user.json new file mode 100644 index 0000000..2d93506 --- /dev/null +++ b/test/postman/testData/skill-provider/create-skill-provider-by-user.json @@ -0,0 +1,14 @@ +[ + { + "name": "POSTMANE2E-skill-provider01", + "httpCode": 200 + }, + { + "name": "POSTMANE2E-skill-provider02", + "httpCode": 200 + }, + { + "name": "POSTMANE2E-skill-provider03", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/skill-provider/create-skill-provider-with-invalid-data.json b/test/postman/testData/skill-provider/create-skill-provider-with-invalid-data.json new file mode 100644 index 0000000..530404f --- /dev/null +++ b/test/postman/testData/skill-provider/create-skill-provider-with-invalid-data.json @@ -0,0 +1,23 @@ +[ + { + "input": { + }, + "httpCode": 400, + "message": "\"entity.name\" is required" + }, + { + "input": { + "name": "" + }, + "httpCode": 400, + "message": "\"entity.name\" is not allowed to be empty" + }, + { + "input": { + "name": "POSTMANE2E-skill-validname", + "aaa":"ccc" + }, + "httpCode": 400, + "message": "\"entity.aaa\" is not allowed" + } +] \ No newline at end of file diff --git a/test/postman/testData/skill-provider/create-skill-provider-with-invalid-tokens.json b/test/postman/testData/skill-provider/create-skill-provider-with-invalid-tokens.json new file mode 100644 index 0000000..dc4c631 --- /dev/null +++ b/test/postman/testData/skill-provider/create-skill-provider-with-invalid-tokens.json @@ -0,0 +1,16 @@ +[ + { + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/skill-provider/delete-skill-provider-by-admin.json b/test/postman/testData/skill-provider/delete-skill-provider-by-admin.json new file mode 100644 index 0000000..7a81c5e --- /dev/null +++ b/test/postman/testData/skill-provider/delete-skill-provider-by-admin.json @@ -0,0 +1,5 @@ +[ + { + "provider_id": "1a9e404b-e9ad-4d88-a5d7-16b06c8ce749" + } +] \ No newline at end of file diff --git a/test/postman/testData/skill-provider/delete-skill-provider-with-invalid-request.json b/test/postman/testData/skill-provider/delete-skill-provider-with-invalid-request.json new file mode 100644 index 0000000..7fc39e3 --- /dev/null +++ b/test/postman/testData/skill-provider/delete-skill-provider-with-invalid-request.json @@ -0,0 +1,31 @@ +[ + { + "provider_id": "{{SKILL_PROVIDER_ID_3}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "provider_id": "{{SKILL_PROVIDER_ID_3}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "provider_id": "{{SKILL_PROVIDER_ID_3}}", + "httpCode": 403, + "message": "No token provided." + }, + { + "provider_id": "{{PROVIDER_ID_BY_ADMIN}}", + "jwtToken": "Bearer {{user_token}}", + "httpCode": 403, + "message": "You are not allowed to perform this action" + }, + { + "provider_id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "jwtToken": "Bearer {{admin_token}}", + "httpCode": 404, + "message": "cannot find SkillsProvider where id = 3cd81b8c-d45e-414e-be66-afb31aa0240c" + } +] \ No newline at end of file diff --git a/test/postman/testData/skill-provider/get-skill-provider-by-admin.json b/test/postman/testData/skill-provider/get-skill-provider-by-admin.json new file mode 100644 index 0000000..3bebf9f --- /dev/null +++ b/test/postman/testData/skill-provider/get-skill-provider-by-admin.json @@ -0,0 +1,10 @@ +[ + { + "provider_id": "{{SKILL_PROVIDER_ID_1}}", + "httpCode": 200 + }, + { + "provider_id": "{{SKILL_PROVIDER_ID_2}}", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/skill-provider/get-skill-provider-by-user.json b/test/postman/testData/skill-provider/get-skill-provider-by-user.json new file mode 100644 index 0000000..f53b707 --- /dev/null +++ b/test/postman/testData/skill-provider/get-skill-provider-by-user.json @@ -0,0 +1,6 @@ +[ + { + "provider_id": "{{SKILL_PROVIDER_ID_2}}", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/skill-provider/get-skill-provider-with-invalid-parameters.json b/test/postman/testData/skill-provider/get-skill-provider-with-invalid-parameters.json new file mode 100644 index 0000000..1329b57 --- /dev/null +++ b/test/postman/testData/skill-provider/get-skill-provider-with-invalid-parameters.json @@ -0,0 +1,12 @@ +[ + { + "provider_id": "123456", + "httpCode": 500, + "message": "invalid input syntax for type uuid: \"123456\"" + }, + { + "provider_id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "httpCode": 404, + "message": "cannot find SkillsProvider where id = 3cd81b8c-d45e-414e-be66-afb31aa0240c" + } +] \ No newline at end of file diff --git a/test/postman/testData/skill-provider/get-skill-provider-with-invalid-tokens.json b/test/postman/testData/skill-provider/get-skill-provider-with-invalid-tokens.json new file mode 100644 index 0000000..b274473 --- /dev/null +++ b/test/postman/testData/skill-provider/get-skill-provider-with-invalid-tokens.json @@ -0,0 +1,26 @@ +[ + { + "provide_id": "{{SKILL_PROVIDER_3}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "provide_id": "{{SKILL_PROVIDER_3}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "provide_id": "{{SKILL_PROVIDER_3}}", + "httpCode": 403, + "jwtToken": "", + "message": "No token provided." + }, + { + "provide_id": "{{PROVIDER_ID_BY_ADMIN}}", + "jwtToken": "Bearer {{user_token}}", + "httpCode": 500, + "message": "You are not allowed to perform this action" + } +] \ No newline at end of file diff --git a/test/postman/testData/skill-provider/patch-skill-provider-with-any-fields-by-admin.json b/test/postman/testData/skill-provider/patch-skill-provider-with-any-fields-by-admin.json new file mode 100644 index 0000000..cc6d0a7 --- /dev/null +++ b/test/postman/testData/skill-provider/patch-skill-provider-with-any-fields-by-admin.json @@ -0,0 +1,12 @@ +[ + { + "provider_id": "{{SKILL_PROVIDER_ID_2}}", + "input": { + "name": "POSTMANE2E-skill-provider02-by-admin-updated" + }, + "expected": { + "name": "POSTMANE2E-skill-provider02-by-admin-updated" + }, + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/skill-provider/patch-skill-provider-with-any-fields-by-user.json b/test/postman/testData/skill-provider/patch-skill-provider-with-any-fields-by-user.json new file mode 100644 index 0000000..a15fcb6 --- /dev/null +++ b/test/postman/testData/skill-provider/patch-skill-provider-with-any-fields-by-user.json @@ -0,0 +1,12 @@ +[ + { + "provider_id": "{{PROVIDER_ID_BY_TESTER}}", + "input": { + "name": "POSTMANE2E-skill-provider-by-user-updated" + }, + "expected": { + "name": "POSTMANE2E-skill-provider-by-user-updated" + }, + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/skill-provider/patch-skill-provider-with-invalid-data.json b/test/postman/testData/skill-provider/patch-skill-provider-with-invalid-data.json new file mode 100644 index 0000000..0a3a8af --- /dev/null +++ b/test/postman/testData/skill-provider/patch-skill-provider-with-invalid-data.json @@ -0,0 +1,34 @@ +[ + { + "provider_id": "{{SKILL_PROVIDER_ID_2}}", + "input": { + "name": "" + }, + "httpCode": 400, + "message": "\"entity.name\" is not allowed to be empty" + }, + { + "provider_id": "{{SKILL_PROVIDER_ID_2}}", + "input": { + "ccc": "abc" + }, + "httpCode": 400, + "message": "\"entity.ccc\" is not allowed" + }, + { + "provider_id": "123456", + "input": { + "name": "POSTMANE2E-skill-provider02-by-admin-updated123456" + }, + "httpCode": 500, + "message": "invalid input syntax for type uuid: \"123456\"" + }, + { + "provider_id": "5ba376ee-1151-47df-b695-05a17a28f0ab", + "input": { + "name": "POSTMANE2E-skill-provider02-by-admin-updated123456" + }, + "httpCode": 404, + "message": "cannot find SkillsProvider where id = 5ba376ee-1151-47df-b695-05a17a28f0ab" + } +] \ No newline at end of file diff --git a/test/postman/testData/skill-provider/patch-skill-provider-with-invalid-tokens.json b/test/postman/testData/skill-provider/patch-skill-provider-with-invalid-tokens.json new file mode 100644 index 0000000..e64b54a --- /dev/null +++ b/test/postman/testData/skill-provider/patch-skill-provider-with-invalid-tokens.json @@ -0,0 +1,19 @@ +[ + { + "provider_id": "{{SKILL_PROVIDER_ID_2}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "provider_id": "{{SKILL_PROVIDER_ID_2}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "provider_id": "{{SKILL_PROVIDER_ID_2}}", + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/skill-provider/search-skill-providers-with-invalid-parameters.json b/test/postman/testData/skill-provider/search-skill-providers-with-invalid-parameters.json new file mode 100644 index 0000000..a64c3dc --- /dev/null +++ b/test/postman/testData/skill-provider/search-skill-providers-with-invalid-parameters.json @@ -0,0 +1,22 @@ +[ + { + "input": "page=-1&perPage=10", + "httpCode": 400, + "message": "\"query.page\" must be larger than or equal to 1" + }, + { + "input": "page=1&perPage=-10", + "httpCode": 400, + "message": "\"query.perPage\" must be larger than or equal to 1" + }, + { + "input": "name=", + "httpCode": 400, + "message": "\"query.name\" is not allowed to be empty" + }, + { + "input": "aa=", + "httpCode": 400, + "message": "\"query.aa\" is not allowed" + } +] \ No newline at end of file diff --git a/test/postman/testData/skill-provider/search-skill-providers-with-invalid-tokens.json b/test/postman/testData/skill-provider/search-skill-providers-with-invalid-tokens.json new file mode 100644 index 0000000..f25a81a --- /dev/null +++ b/test/postman/testData/skill-provider/search-skill-providers-with-invalid-tokens.json @@ -0,0 +1,17 @@ +[ + { + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "jwtToken": "", + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/skill-provider/search-skill-providers-with-various-parameters.json b/test/postman/testData/skill-provider/search-skill-providers-with-various-parameters.json new file mode 100644 index 0000000..6034a6c --- /dev/null +++ b/test/postman/testData/skill-provider/search-skill-providers-with-various-parameters.json @@ -0,0 +1,17 @@ +[ + { + "input": "page=1&perPage=10&name=POSTMANE2E" + }, + { + "input": "page=1&perPage=1", + "idLabel": "SKILL_PROVIDER_ID_1" + }, + { + "input": "page=2&perPage=1", + "idLabel": "SKILL_PROVIDER_ID_2" + }, + { + "input": "page=3&perPage=1", + "idLabel": "SKILL_PROVIDER_ID_3" + } +] \ No newline at end of file diff --git a/test/postman/testData/skill-search/skill-search-user-achievements-with-invalid-parameters.json b/test/postman/testData/skill-search/skill-search-user-achievements-with-invalid-parameters.json new file mode 100644 index 0000000..c7bc75f --- /dev/null +++ b/test/postman/testData/skill-search/skill-search-user-achievements-with-invalid-parameters.json @@ -0,0 +1,7 @@ +[ + { + "input": "", + "httpCode": 500, + "message": "Cannot search for achievements without organization info" + } +] \ No newline at end of file diff --git a/test/postman/testData/skill-search/skill-search-user-achievements-with-invalid-tokens.json b/test/postman/testData/skill-search/skill-search-user-achievements-with-invalid-tokens.json new file mode 100644 index 0000000..5788e4c --- /dev/null +++ b/test/postman/testData/skill-search/skill-search-user-achievements-with-invalid-tokens.json @@ -0,0 +1,26 @@ +[ + { + "input": "organizationId={{ORGANIZATION_ID_BY_ADMIN}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "input": "organizationId={{ORGANIZATION_ID_BY_ADMIN}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "input": "organizationId={{ORGANIZATION_ID_BY_ADMIN}}", + "jwtToken": "", + "httpCode": 403, + "message": "No token provided." + }, + { + "input": "organizationId={{ORGANIZATION_ID_BY_ADMIN}}", + "jwtToken": "Bearer {{user_token}}", + "httpCode": 403, + "message": "You are not allowed to perform this action" + } +] \ No newline at end of file diff --git a/test/postman/testData/skill-search/skill-search-user-achievements-with-various-parameters.json b/test/postman/testData/skill-search/skill-search-user-achievements-with-various-parameters.json new file mode 100644 index 0000000..501c240 --- /dev/null +++ b/test/postman/testData/skill-search/skill-search-user-achievements-with-various-parameters.json @@ -0,0 +1,8 @@ +[ + { + "input": "organizationId={{ORGANIZATION_ID_BY_ADMIN}}&keyword=POSTMANE2E" + }, + { + "input": "organizationId={{ORGANIZATION_ID_BY_ADMIN}}" + } +] \ No newline at end of file diff --git a/test/postman/testData/skill-search/skill-search-user-attributes-with-invalid-tokens.json b/test/postman/testData/skill-search/skill-search-user-attributes-with-invalid-tokens.json new file mode 100644 index 0000000..1dcb370 --- /dev/null +++ b/test/postman/testData/skill-search/skill-search-user-attributes-with-invalid-tokens.json @@ -0,0 +1,22 @@ +[ + { + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "jwtToken": "", + "httpCode": 403, + "message": "No token provided." + }, + { + "jwtToken": "Bearer {{user_token}}", + "httpCode": 403, + "message": "You are not allowed to perform this action" + } +] \ No newline at end of file diff --git a/test/postman/testData/skill-search/skill-search-user-attributes-with-various-parameters.json b/test/postman/testData/skill-search/skill-search-user-attributes-with-various-parameters.json new file mode 100644 index 0000000..b66082b --- /dev/null +++ b/test/postman/testData/skill-search/skill-search-user-attributes-with-various-parameters.json @@ -0,0 +1,14 @@ +[ + { + "input": "attributeId={{ATTRIBUTE_ID_BY_ADMIN}}&attributeValue=POSTMANE2E" + }, + { + "input": "attributeId={{ATTRIBUTE_ID_BY_ADMIN}}" + }, + { + "input": "attributeValue=POSTMANE2E" + }, + { + "input": "" + } +] \ No newline at end of file diff --git a/test/postman/testData/skill-search/skill-search-user-skills-with-invalid-parameters.json b/test/postman/testData/skill-search/skill-search-user-skills-with-invalid-parameters.json new file mode 100644 index 0000000..ad1be31 --- /dev/null +++ b/test/postman/testData/skill-search/skill-search-user-skills-with-invalid-parameters.json @@ -0,0 +1,12 @@ +[ + { + "input": "keyword=POSTMANE2E", + "httpCode": 400, + "message": "\"query.organizationId\" is required" + }, + { + "input": "organizationId={{ORGANIZATION_ID_BY_ADMIN}}", + "httpCode": 400, + "message": "\"query.keyword\" is required" + } +] \ No newline at end of file diff --git a/test/postman/testData/skill-search/skill-search-user-skills-with-invalid-tokens.json b/test/postman/testData/skill-search/skill-search-user-skills-with-invalid-tokens.json new file mode 100644 index 0000000..f811581 --- /dev/null +++ b/test/postman/testData/skill-search/skill-search-user-skills-with-invalid-tokens.json @@ -0,0 +1,26 @@ +[ + { + "input": "organizationId={{ORGANIZATION_ID_BY_ADMIN}}&keyword=POSTMANE2E", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "input": "organizationId={{ORGANIZATION_ID_BY_ADMIN}}&keyword=POSTMANE2E", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "input": "organizationId={{ORGANIZATION_ID_BY_ADMIN}}&keyword=POSTMANE2E", + "jwtToken": "", + "httpCode": 403, + "message": "No token provided." + }, + { + "input": "organizationId={{ORGANIZATION_ID_BY_ADMIN}}&keyword=POSTMANE2E", + "jwtToken": "Bearer {{user_token}}", + "httpCode": 403, + "message": "You are not allowed to perform this action" + } +] \ No newline at end of file diff --git a/test/postman/testData/skill-search/skill-search-user-skills-with-various-parameters.json b/test/postman/testData/skill-search/skill-search-user-skills-with-various-parameters.json new file mode 100644 index 0000000..cfbeba7 --- /dev/null +++ b/test/postman/testData/skill-search/skill-search-user-skills-with-various-parameters.json @@ -0,0 +1,5 @@ +[ + { + "input": "organizationId={{ORGANIZATION_ID_BY_ADMIN}}&keyword=POSTMANE2E" + } +] \ No newline at end of file diff --git a/test/postman/testData/skill-search/skill-search-users-with-invalid-parameters.json b/test/postman/testData/skill-search/skill-search-users-with-invalid-parameters.json new file mode 100644 index 0000000..4d07b6c --- /dev/null +++ b/test/postman/testData/skill-search/skill-search-users-with-invalid-parameters.json @@ -0,0 +1,33 @@ +[ + { + "params": "page=-1&perPage=10", + "input": { + "organizationId":"{{ORGANIZATION_ID_BY_ADMIN}}" + }, + "httpCode": 500, + "message": "illegal_argument_exception" + }, + { + "params": "page=1&perPage=-10", + "input": { + "organizationId":"{{ORGANIZATION_ID_BY_ADMIN}}" + }, + "httpCode": 500, + "message": "illegal_argument_exception" + }, + { + "params": "", + "input": { + }, + "httpCode": 500, + "message": "Cannot search for users without organization info" + }, + { + "params": "", + "input": { + "organizationId":"" + }, + "httpCode": 500, + "message": "Cannot search for users without organization info" + } +] \ No newline at end of file diff --git a/test/postman/testData/skill-search/skill-search-users-with-invalid-tokens.json b/test/postman/testData/skill-search/skill-search-users-with-invalid-tokens.json new file mode 100644 index 0000000..b676a6c --- /dev/null +++ b/test/postman/testData/skill-search/skill-search-users-with-invalid-tokens.json @@ -0,0 +1,29 @@ +[ + { + "params": "page=1&perPage=10", + "input": { + "organizationId":"ORGANIZATION_ID_BY_ADMIN" + }, + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "params": "page=1&perPage=10", + "input": { + "organizationId":"ORGANIZATION_ID_BY_ADMIN" + }, + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "params": "page=1&perPage=10", + "input": { + "organizationId":"ORGANIZATION_ID_BY_ADMIN" + }, + "jwtToken": "", + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/skill-search/skill-search-users-with-various-parameters.json b/test/postman/testData/skill-search/skill-search-users-with-various-parameters.json new file mode 100644 index 0000000..db273b7 --- /dev/null +++ b/test/postman/testData/skill-search/skill-search-users-with-various-parameters.json @@ -0,0 +1,14 @@ +[ + { + "params": "page=1&perPage=10", + "input": { + "organizationId":"ORGANIZATION_ID_BY_ADMIN" + } + }, + { + "params": "", + "input": { + "organizationId":"ORGANIZATION_ID_BY_ADMIN" + } + } +] \ No newline at end of file diff --git a/test/postman/testData/skill/create-skill-by-admin.json b/test/postman/testData/skill/create-skill-by-admin.json new file mode 100644 index 0000000..430d0fa --- /dev/null +++ b/test/postman/testData/skill/create-skill-by-admin.json @@ -0,0 +1,23 @@ +[ + { + "skillProviderId": "{{PROVIDER_ID_BY_TESTER}}", + "name": "POSTMANE2E-Skill01-by-admin", + "uri": "POSTMANE2E-skill-uri01-by-admin", + "externalId": "POSTMANE2E-externalId01-by-admin", + "httpCode": 200 + }, + { + "skillProviderId": "{{PROVIDER_ID_BY_TESTER}}", + "name": "POSTMANE2E-Skill02-by-admin", + "uri": "POSTMANE2E-skill-uri02-by-admin", + "externalId": "POSTMANE2E-externalId02-by-admin", + "httpCode": 200 + }, + { + "skillProviderId": "{{PROVIDER_ID_BY_TESTER}}", + "name": "POSTMANE2E-Skill03-by-admin", + "uri": "POSTMANE2E-skill-uri03-by-admin", + "externalId": "POSTMANE2E-externalId03-by-admin", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/skill/create-skill-by-user.json b/test/postman/testData/skill/create-skill-by-user.json new file mode 100644 index 0000000..cd562ea --- /dev/null +++ b/test/postman/testData/skill/create-skill-by-user.json @@ -0,0 +1,23 @@ +[ + { + "skillProviderId": "{{PROVIDER_ID_BY_TESTER}}", + "name": "POSTMANE2E-Skill01", + "uri": "POSTMANE2E-skill-uri01", + "externalId": "POSTMANE2E-externalId01", + "httpCode": 200 + }, + { + "skillProviderId": "{{PROVIDER_ID_BY_TESTER}}", + "name": "POSTMANE2E-Skill02", + "uri": "POSTMANE2E-skill-uri02", + "externalId": "POSTMANE2E-externalId02", + "httpCode": 200 + }, + { + "skillProviderId": "{{PROVIDER_ID_BY_TESTER}}", + "name": "POSTMANE2E-Skill03", + "uri": "POSTMANE2E-skill-uri03", + "externalId": "POSTMANE2E-externalId03", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/skill/create-skill-with-invalid-data.json b/test/postman/testData/skill/create-skill-with-invalid-data.json new file mode 100644 index 0000000..5b80fc1 --- /dev/null +++ b/test/postman/testData/skill/create-skill-with-invalid-data.json @@ -0,0 +1,81 @@ +[ + { + "input": { + "skillProviderId": "{{PROVIDER_ID_BY_TESTER}}", + "uri": "POSTMANE2E-skill-uri01", + "externalId": "POSTMANE2E-externalId01" + }, + "httpCode": 400, + "message": "\"entity.name\" is required" + }, + { + "input": { + "skillProviderId": "{{PROVIDER_ID_BY_TESTER}}", + "name": "", + "uri": "POSTMANE2E-skill-uri01", + "externalId": "POSTMANE2E-externalId01" + }, + "httpCode": 400, + "message": "\"entity.name\" is not allowed to be empty" + }, + { + "input": { + "name": "POSTMANE2E-Skill01", + "uri": "POSTMANE2E-skill-uri01", + "externalId": "POSTMANE2E-externalId01" + }, + "httpCode": 400, + "message": "\"entity.skillProviderId\" is required" + }, + { + "input": { + "skillProviderId": "", + "name": "POSTMANE2E-Skill01", + "uri": "POSTMANE2E-skill-uri01", + "externalId": "POSTMANE2E-externalId01" + }, + "httpCode": 400, + "message": "\"entity.skillProviderId\" is not allowed to be empty" + }, + { + "input": { + "skillProviderId": "{{PROVIDER_ID_BY_TESTER}}", + "name": "POSTMANE2E-Skill01", + "uri": "", + "externalId": "POSTMANE2E-externalId01" + }, + "httpCode": 400, + "message": "\"entity.uri\" is not allowed to be empty" + }, + { + "input": { + "skillProviderId": "{{PROVIDER_ID_BY_TESTER}}", + "name": "POSTMANE2E-Skill01", + "uri": "POSTMANE2E-skill-uri01", + "externalId": "" + }, + "httpCode": 400, + "message": "\"entity.externalId\" is not allowed to be empty" + }, + { + "input": { + "skillProviderId": "{{PROVIDER_ID_BY_TESTER}}", + "name": "POSTMANE2E-Skill01-valid", + "uri": "POSTMANE2E-skill-uri01", + "externalId": "POSTMANE2E-externalId01", + "aaa":"ccc" + }, + "httpCode": 400, + "message": "\"entity.aaa\" is not allowed" + }, + { + "input": { + "skillProviderId": "{{PROVIDER_ID_BY_TESTER}}", + "name": "POSTMANE2E-Skill01", + "uri": "POSTMANE2E-skill-uri01", + "externalId": "POSTMANE2E-externalId01" + }, + "httpCode": 409, + "message": "Skill already exists with skillProviderId:" + } +] \ No newline at end of file diff --git a/test/postman/testData/skill/create-skill-with-invalid-tokens.json b/test/postman/testData/skill/create-skill-with-invalid-tokens.json new file mode 100644 index 0000000..f25a81a --- /dev/null +++ b/test/postman/testData/skill/create-skill-with-invalid-tokens.json @@ -0,0 +1,17 @@ +[ + { + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "jwtToken": "", + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/skill/delete-skill-by-admin.json b/test/postman/testData/skill/delete-skill-by-admin.json new file mode 100644 index 0000000..9805fdf --- /dev/null +++ b/test/postman/testData/skill/delete-skill-by-admin.json @@ -0,0 +1,5 @@ +[ + { + "id": "c8f94001-2c3e-4008-b706-97db74b4369b" + } +] \ No newline at end of file diff --git a/test/postman/testData/skill/delete-skill-with-invalid-request.json b/test/postman/testData/skill/delete-skill-with-invalid-request.json new file mode 100644 index 0000000..bc33fe0 --- /dev/null +++ b/test/postman/testData/skill/delete-skill-with-invalid-request.json @@ -0,0 +1,31 @@ +[ + { + "id": "{{SKILL_ID_2}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "id": "{{SKILL_ID_2}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "id": "{{SKILL_ID_2}}", + "httpCode": 403, + "message": "No token provided." + }, + { + "id": "{{SKILL_ID_BY_ADMIN}}", + "jwtToken": "Bearer {{user_token}}", + "httpCode": 403, + "message": "You are not allowed to perform this action" + }, + { + "id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "jwtToken": "Bearer {{admin_token}}", + "httpCode": 404, + "message": "cannot find Skill where id = 3cd81b8c-d45e-414e-be66-afb31aa0240c" + } +] \ No newline at end of file diff --git a/test/postman/testData/skill/get-skill-by-admin.json b/test/postman/testData/skill/get-skill-by-admin.json new file mode 100644 index 0000000..5cff9df --- /dev/null +++ b/test/postman/testData/skill/get-skill-by-admin.json @@ -0,0 +1,10 @@ +[ + { + "id": "{{SKILL_ID_1}}", + "httpCode": 200 + }, + { + "id": "{{SKILL_ID_2}}", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/skill/get-skill-by-user.json b/test/postman/testData/skill/get-skill-by-user.json new file mode 100644 index 0000000..1c97abc --- /dev/null +++ b/test/postman/testData/skill/get-skill-by-user.json @@ -0,0 +1,6 @@ +[ + { + "id": "{{SKILL_ID_BY_TESTER}}", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/skill/get-skill-with-invalid-parameters.json b/test/postman/testData/skill/get-skill-with-invalid-parameters.json new file mode 100644 index 0000000..9517451 --- /dev/null +++ b/test/postman/testData/skill/get-skill-with-invalid-parameters.json @@ -0,0 +1,12 @@ +[ + { + "id": "123456", + "httpCode": 500, + "message": "invalid input syntax for type uuid: \"123456\"" + }, + { + "id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "httpCode": 404, + "message": "cannot find Skill where id = 3cd81b8c-d45e-414e-be66-afb31aa0240c" + } +] \ No newline at end of file diff --git a/test/postman/testData/skill/get-skill-with-invalid-tokens.json b/test/postman/testData/skill/get-skill-with-invalid-tokens.json new file mode 100644 index 0000000..7f18aaa --- /dev/null +++ b/test/postman/testData/skill/get-skill-with-invalid-tokens.json @@ -0,0 +1,26 @@ +[ + { + "id": "{{SKILL_ID_BY_ADMIN}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "id": "{{SKILL_ID_BY_ADMIN}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "id": "{{SKILL_ID_BY_ADMIN}}", + "httpCode": 403, + "jwtToken": "", + "message": "No token provided." + }, + { + "id": "{{SKILL_ID_BY_ADMIN}}", + "jwtToken": "Bearer {{user_token}}", + "httpCode": 500, + "message": "You are not allowed to perform this action" + } +] \ No newline at end of file diff --git a/test/postman/testData/skill/patch-skill-with-any-fields-by-admin.json b/test/postman/testData/skill/patch-skill-with-any-fields-by-admin.json new file mode 100644 index 0000000..bbf4b94 --- /dev/null +++ b/test/postman/testData/skill/patch-skill-with-any-fields-by-admin.json @@ -0,0 +1,48 @@ +[ + { + "id": "{{SKILL_ID_2}}", + "input": { + "skillProviderId": "{{PROVIDER_ID_BY_TESTER}}", + "name": "POSTMANE2E-Skill01-by-admin-updated1", + "uri": "POSTMANE2E-skill-uri01-by-admin-updated", + "externalId": "POSTMANE2E-externalId01-by-admin-updated" + }, + "expected": { + "skillProviderId": "{{PROVIDER_ID_BY_TESTER}}", + "name": "POSTMANE2E-Skill01-by-admin-updated1", + "uri": "POSTMANE2E-skill-uri01-by-admin-updated", + "externalId": "POSTMANE2E-externalId01-by-admin-updated" + }, + "httpCode": 200 + }, + { + "id": "{{SKILL_ID_2}}", + "input": { + "name": "POSTMANE2E-Skill01-by-admin-updated01" + }, + "expected": { + "name": "POSTMANE2E-Skill01-by-admin-updated01" + }, + "httpCode": 200 + }, + { + "id": "{{SKILL_ID_2}}", + "input": { + "uri": "POSTMANE2E-skill-uri01-by-admin-updated01" + }, + "expected": { + "uri": "POSTMANE2E-skill-uri01-by-admin-updated01" + }, + "httpCode": 200 + }, + { + "id": "{{SKILL_ID_2}}", + "input": { + "externalId": "POSTMANE2E-externalId01-by-admin-updated01" + }, + "expected": { + "externalId": "POSTMANE2E-externalId01-by-admin-updated01" + }, + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/skill/patch-skill-with-any-fields-by-user.json b/test/postman/testData/skill/patch-skill-with-any-fields-by-user.json new file mode 100644 index 0000000..096f6d6 --- /dev/null +++ b/test/postman/testData/skill/patch-skill-with-any-fields-by-user.json @@ -0,0 +1,48 @@ +[ + { + "id": "{{SKILL_ID_BY_TESTER}}", + "input": { + "skillProviderId": "{{PROVIDER_ID_BY_TESTER}}", + "name": "POSTMANE2E-Skill01-by-user-updated", + "uri": "POSTMANE2E-skill-uri01-by-user-updated", + "externalId": "POSTMANE2E-externalId01-by-user-updated" + }, + "expected": { + "skillProviderId": "{{PROVIDER_ID_BY_TESTER}}", + "name": "POSTMANE2E-Skill01-by-user-updated", + "uri": "POSTMANE2E-skill-uri01-by-user-updated", + "externalId": "POSTMANE2E-externalId01-by-user-updated" + }, + "httpCode": 200 + }, + { + "id": "{{SKILL_ID_BY_TESTER}}", + "input": { + "name": "POSTMANE2E-Skill01-by-user-updated02" + }, + "expected": { + "name": "POSTMANE2E-Skill01-by-user-updated02" + }, + "httpCode": 200 + }, + { + "id": "{{SKILL_ID_BY_TESTER}}", + "input": { + "uri": "POSTMANE2E-skill-uri01-by-user-updated02" + }, + "expected": { + "uri": "POSTMANE2E-skill-uri01-by-user-updated02" + }, + "httpCode": 200 + }, + { + "id": "{{SKILL_ID_BY_TESTER}}", + "input": { + "externalId": "POSTMANE2E-externalId01-by-user-updated02" + }, + "expected": { + "externalId": "POSTMANE2E-externalId01-by-user-updated02" + }, + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/skill/patch-skill-with-invalid-data.json b/test/postman/testData/skill/patch-skill-with-invalid-data.json new file mode 100644 index 0000000..f21c55c --- /dev/null +++ b/test/postman/testData/skill/patch-skill-with-invalid-data.json @@ -0,0 +1,58 @@ +[ + { + "id": "{{SKILL_ID_2}}", + "input": { + "skillProviderId": "" + }, + "httpCode": 400, + "message": "\"entity.skillProviderId\" is not allowed to be empty" + }, + { + "id": "{{SKILL_ID_2}}", + "input": { + "name": "" + }, + "httpCode": 400, + "message": "\"entity.name\" is not allowed to be empty" + }, + { + "id": "{{SKILL_ID_2}}", + "input": { + "uri": "" + }, + "httpCode": 400, + "message": "\"entity.uri\" is not allowed to be empty" + }, + { + "id": "{{SKILL_ID_2}}", + "input": { + "externalId": "" + }, + "httpCode": 400, + "message": "\"entity.externalId\" is not allowed to be empty" + }, + { + "id": "{{SKILL_ID_2}}", + "input": { + "ccc": "abc" + }, + "httpCode": 400, + "message": "\"entity.ccc\" is not allowed" + }, + { + "id": "{{SKILL_ID_2}}", + "input": { + "skillProviderId": "3cd81b8c-d45e-414e-be66-afb31aa0240c" + }, + "httpCode": 404, + "message": "cannot find SkillsProvider where id = 3cd81b8c-d45e-414e-be66-afb31aa0240c" + }, + { + "id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "input": { + "name": "POSTMANE2E-Skill01-by-user-updated2" + }, + "httpCode": 404, + "message": "cannot find Skill where id = 3cd81b8c-d45e-414e-be66-afb31aa0240c" + } +] \ No newline at end of file diff --git a/test/postman/testData/skill/patch-skill-with-invalid-tokens.json b/test/postman/testData/skill/patch-skill-with-invalid-tokens.json new file mode 100644 index 0000000..4d392ea --- /dev/null +++ b/test/postman/testData/skill/patch-skill-with-invalid-tokens.json @@ -0,0 +1,20 @@ +[ + { + "id": "{{SKILL_ID_2}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "id": "{{SKILL_ID_2}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "id": "{{SKILL_ID_2}}", + "jwtToken": "", + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/skill/search-skills-with-invalid-parameters.json b/test/postman/testData/skill/search-skills-with-invalid-parameters.json new file mode 100644 index 0000000..569e707 --- /dev/null +++ b/test/postman/testData/skill/search-skills-with-invalid-parameters.json @@ -0,0 +1,42 @@ +[ + { + "input": "page=-1&perPage=10", + "httpCode": 400, + "message": "\"query.page\" must be larger than or equal to 1" + }, + { + "input": "page=1&perPage=-10", + "httpCode": 400, + "message": "\"query.perPage\" must be larger than or equal to 1" + }, + { + "input": "name=", + "httpCode": 400, + "message": "\"query.name\" is not allowed to be empty" + }, + { + "input": "skillProviderId=", + "httpCode": 400, + "message": "\"query.skillProviderId\" is not allowed to be empty" + }, + { + "input": "externalId=", + "httpCode": 400, + "message": "\"query.externalId\" is not allowed to be empty" + }, + { + "input": "name=", + "httpCode": 400, + "message": "\"query.name\" is not allowed to be empty" + }, + { + "input": "orderBy=", + "httpCode": 400, + "message": "\"query.orderBy\" is not allowed to be empty" + }, + { + "input": "aa=", + "httpCode": 400, + "message": "\"query.aa\" is not allowed" + } +] \ No newline at end of file diff --git a/test/postman/testData/skill/search-skills-with-invalid-tokens.json b/test/postman/testData/skill/search-skills-with-invalid-tokens.json new file mode 100644 index 0000000..f25a81a --- /dev/null +++ b/test/postman/testData/skill/search-skills-with-invalid-tokens.json @@ -0,0 +1,17 @@ +[ + { + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "jwtToken": "", + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/skill/search-skills-with-various-parameters.json b/test/postman/testData/skill/search-skills-with-various-parameters.json new file mode 100644 index 0000000..b6e0d77 --- /dev/null +++ b/test/postman/testData/skill/search-skills-with-various-parameters.json @@ -0,0 +1,29 @@ +[ + { + "input": "page=1&perPage=10&skillProviderId={{PROVIDER_ID_BY_TESTER}}&externalId=KS126XR63RKYVCKYDNBN&name=POSTMANE2E-.NET Framework 4&orderBy=name" + }, + { + "input": "page=1&perPage=10" + }, + { + "input": "skillProviderId={{PROVIDER_ID_BY_TESTER}}" + }, + { + "input": "name=POSTMANE2E-.NET Framework 4" + }, + { + "input": "orderBy=name" + }, + { + "input": "externalId=KS126XR63RKYVCKYDNBN", + "idLabel": "SKILL_ID_1" + }, + { + "input": "externalId=KS120H6772VQ0MQ5RLVD", + "idLabel": "SKILL_ID_2" + }, + { + "input": "externalId=KS125LS6N7WP4S6SFTCK", + "idLabel": "SKILL_ID_3" + } +] \ No newline at end of file diff --git a/test/postman/testData/user-achievement/create-user-achievement-by-admin.json b/test/postman/testData/user-achievement/create-user-achievement-by-admin.json new file mode 100644 index 0000000..e81108e --- /dev/null +++ b/test/postman/testData/user-achievement/create-user-achievement-by-admin.json @@ -0,0 +1,74 @@ +[ + { + "user_id": "ce348067-e73f-49d7-af72-fcf11a6c88bf", + "input": { + "achievementsProviderId": "{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "name": "POSTMANE2E-Topcoder-by-ADMIN-001", + "uri": "http://some.uri", + "certifierId": "certifier id 001", + "certifiedDate": "2020-05-04T07:36:28.036Z" + }, + "expected": { + "achievementsProviderId": "{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "name": "POSTMANE2E-Topcoder-by-ADMIN-001", + "uri": "http://some.uri", + "certifierId": "certifier id 001", + "certifiedDate": "2020-05-04T07:36:28.036Z" + }, + "httpCode": 200 + }, + { + "user_id": "35ec01c0-d650-4cd9-8a05-848c9019873d", + "input": { + "achievementsProviderId": "{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "name": "POSTMANE2E-Topcoder-by-ADMIN-002" + }, + "expected": { + "achievementsProviderId": "{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "name": "POSTMANE2E-Topcoder-by-ADMIN-002" + }, + "httpCode": 200 + }, + { + "user_id": "3f64739e-10bf-42ca-8314-8aea0245cd0f", + "input": { + "achievementsProviderId": "{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "name": "POSTMANE2E-Topcoder-by-ADMIN-003", + "uri": "http://some.uri3" + }, + "expected": { + "achievementsProviderId": "{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "name": "POSTMANE2E-Topcoder-by-ADMIN-003", + "uri": "http://some.uri3" + }, + "httpCode": 200 + }, + { + "user_id": "ecec4ad8-3a1d-4646-8641-25054e8f2d33", + "input": { + "achievementsProviderId": "{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "name": "POSTMANE2E-Topcoder-by-ADMIN-004", + "certifierId": "certifier id 004" + }, + "expected": { + "achievementsProviderId": "{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "name": "POSTMANE2E-Topcoder-by-ADMIN-004", + "certifierId": "certifier id 004" + }, + "httpCode": 200 + }, + { + "user_id": "7d93ee11-b4e9-415e-9a6f-aff458d6f975", + "input": { + "achievementsProviderId": "{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "name": "POSTMANE2E-Topcoder-by-ADMIN-005", + "certifiedDate": "2020-05-04T07:36:28.036Z" + }, + "expected": { + "achievementsProviderId": "{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "name": "POSTMANE2E-Topcoder-by-ADMIN-005", + "certifiedDate": "2020-05-04T07:36:28.036Z" + }, + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/user-achievement/create-user-achievement-by-user.json b/test/postman/testData/user-achievement/create-user-achievement-by-user.json new file mode 100644 index 0000000..7904d59 --- /dev/null +++ b/test/postman/testData/user-achievement/create-user-achievement-by-user.json @@ -0,0 +1,74 @@ +[ + { + "user_id": "df2f0027-f74f-45fa-85cd-84c9fdc2faf4", + "input": { + "achievementsProviderId": "{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "name": "POSTMANE2E-Topcoder-by-TESTER-001", + "uri": "http://some.uri", + "certifierId": "certifier id 001", + "certifiedDate": "2020-05-04T07:36:28.036Z" + }, + "expected": { + "achievementsProviderId": "{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "name": "POSTMANE2E-Topcoder-by-TESTER-001", + "uri": "http://some.uri", + "certifierId": "certifier id 001", + "certifiedDate": "2020-05-04T07:36:28.036Z" + }, + "httpCode": 200 + }, + { + "user_id": "e043286d-ab55-44e3-b2c2-7f7a4f375dcf", + "input": { + "achievementsProviderId": "{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "name": "POSTMANE2E-Topcoder-by-TESTER-002" + }, + "expected": { + "achievementsProviderId": "{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "name": "POSTMANE2E-Topcoder-by-TESTER-002" + }, + "httpCode": 200 + }, + { + "user_id": "0f8e52c1-33fd-48f2-b160-415c2bb371f2", + "input": { + "achievementsProviderId": "{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "name": "POSTMANE2E-Topcoder-TESTER-003", + "uri": "http://some.uri3" + }, + "expected": { + "achievementsProviderId": "{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "name": "POSTMANE2E-Topcoder-TESTER-003", + "uri": "http://some.uri3" + }, + "httpCode": 200 + }, + { + "user_id": "06f130d0-0764-4894-bcd8-67e2758b15d9", + "input": { + "achievementsProviderId": "{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "name": "POSTMANE2E-Topcoder-TESTER-004", + "certifierId": "certifier id 004" + }, + "expected": { + "achievementsProviderId": "{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "name": "POSTMANE2E-Topcoder-TESTER-004", + "certifierId": "certifier id 004" + }, + "httpCode": 200 + }, + { + "user_id": "e02d66c9-01d6-4cd8-9f8c-30e40315adcc", + "input": { + "achievementsProviderId": "{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "name": "POSTMANE2E-Topcoder-TESTER-005", + "certifiedDate": "2020-05-04T07:36:28.036Z" + }, + "expected": { + "achievementsProviderId": "{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "name": "POSTMANE2E-Topcoder-TESTER-005", + "certifiedDate": "2020-05-04T07:36:28.036Z" + }, + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/user-achievement/create-user-achievement-with-invalid-data.json b/test/postman/testData/user-achievement/create-user-achievement-with-invalid-data.json new file mode 100644 index 0000000..5431e86 --- /dev/null +++ b/test/postman/testData/user-achievement/create-user-achievement-with-invalid-data.json @@ -0,0 +1,114 @@ +[ + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "input": { + "name": "POSTMANE2E-Topcoder-by-ADMIN-001", + "uri": "http://some.uri", + "certifierId": "certifier id 001", + "certifiedDate": "2020-05-04T07:36:28.036Z" + }, + "httpCode": 400, + "message": "\"entity.achievementsProviderId\" is required" + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "input": { + "achievementsProviderId":"", + "name": "POSTMANE2E-Topcoder-by-ADMIN-001", + "uri": "http://some.uri", + "certifierId": "certifier id 001", + "certifiedDate": "2020-05-04T07:36:28.036Z" + }, + "httpCode": 400, + "message": "\"entity.achievementsProviderId\" is not allowed to be empty" + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "input": { + "achievementsProviderId": "{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "uri": "http://some.uri", + "certifierId": "certifier id 001", + "certifiedDate": "2020-05-04T07:36:28.036Z" + }, + "httpCode": 400, + "message": "\"entity.name\" is required" + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "input": { + "achievementsProviderId": "{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "name": "", + "uri": "http://some.uri", + "certifierId": "certifier id 001", + "certifiedDate": "2020-05-04T07:36:28.036Z" + }, + "httpCode": 400, + "message": "\"entity.name\" is not allowed to be empty" + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "input": { + "achievementsProviderId": "{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "name": "POSTMANE2E-Topcoder-by-ADMIN-007", + "uri": "", + "certifierId": "certifier id 001", + "certifiedDate": "2020-05-04T07:36:28.036Z" + }, + "httpCode": 400, + "message": "\"entity.uri\" is not allowed to be empty" + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "input": { + "achievementsProviderId": "{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "name": "POSTMANE2E-Topcoder-by-ADMIN-007", + "uri": "http://some.uri", + "certifierId": "certifier id 001", + "certifiedDate": "" + }, + "httpCode": 400, + "message": "\"entity.certifiedDate\" must be in ISO 8601 date format" + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "input": { + "achievementsProviderId": "{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "name": "POSTMANE2E-Topcoder-by-ADMIN-007", + "uri": "http://some.uri", + "certifierId": "certifier id 001", + "certifiedDate": "abcd" + }, + "httpCode": 400, + "message": "\"entity.certifiedDate\" must be in ISO 8601 date format" + }, + { + "user_id": "7d93ee11-b4e9-415e-9a6f-aff458d6f975", + "input": { + "achievementsProviderId": "{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "name": "POSTMANE2E-Topcoder-by-ADMIN-001", + "uri": "http://some.uri", + "certifierId": "certifier id 001", + "certifiedDate": "2020-05-04T07:36:28.036Z" + }, + "httpCode": 409, + "message": "Achievement already exists with userId:7d93ee11-b4e9-415e-9a6f-aff458d6f975" + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "input": { + "achievementsProviderId":"75b30af0-46df-4cf6-97ed-3a5608516f4a", + "name": "POSTMANE2E-Topcoder-by-ADMIN-001" + }, + "httpCode": 404, + "message": "cannot find AchievementsProvider where id = 75b30af0-46df-4cf6-97ed-3a5608516f4a" + }, + { + "user_id": "75b30af0-46df-4cf6-97ed-3a5608516f4a", + "input": { + "achievementsProviderId":"{{ACHIEVEMENTS_PROVIDER_ID_2}}", + "name": "POSTMANE2E-Topcoder-by-ADMIN-001" + }, + "httpCode": 404, + "message": "cannot find User where id = 75b30af0-46df-4cf6-97ed-3a5608516f4a" + } +] \ No newline at end of file diff --git a/test/postman/testData/user-achievement/create-user-achievement-with-invalid-tokens.json b/test/postman/testData/user-achievement/create-user-achievement-with-invalid-tokens.json new file mode 100644 index 0000000..b878e02 --- /dev/null +++ b/test/postman/testData/user-achievement/create-user-achievement-with-invalid-tokens.json @@ -0,0 +1,20 @@ +[ + { + "user_id": "{{USER_ID_2}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "user_id": "{{USER_ID_2}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "user_id": "{{USER_ID_2}}", + "jwtToken": "", + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/user-achievement/delete-user-achievement-by-admin.json b/test/postman/testData/user-achievement/delete-user-achievement-by-admin.json new file mode 100644 index 0000000..290c2d5 --- /dev/null +++ b/test/postman/testData/user-achievement/delete-user-achievement-by-admin.json @@ -0,0 +1,6 @@ +[ + { + "user_id": "ecec4ad8-3a1d-4646-8641-25054e8f2d33", + "achievement_id":"{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}" + } +] \ No newline at end of file diff --git a/test/postman/testData/user-achievement/delete-user-achievement-with-invalid-request.json b/test/postman/testData/user-achievement/delete-user-achievement-with-invalid-request.json new file mode 100644 index 0000000..1484ea1 --- /dev/null +++ b/test/postman/testData/user-achievement/delete-user-achievement-with-invalid-request.json @@ -0,0 +1,36 @@ +[ + { + "user_id": "{{USER_ID_BY_TESTER}}", + "achievement_id": "{{ACHIEVEMENT_ID_BY_TESTER}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "user_id": "{{USER_ID_BY_TESTER}}", + "achievement_id": "{{ACHIEVEMENT_ID_BY_TESTER}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "user_id": "{{USER_ID_BY_TESTER}}", + "achievement_id": "{{ACHIEVEMENT_ID_BY_TESTER}}", + "httpCode": 403, + "message": "No token provided." + }, + { + "user_id": "{{USER_ID_2}}", + "achievement_id": "{{ACHIEVEMENT_ID_BY_ADMIN}}", + "jwtToken": "Bearer {{user_token}}", + "httpCode": 403, + "message": "You are not allowed to perform this action" + }, + { + "user_id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "achievement_id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "jwtToken": "Bearer {{admin_token}}", + "httpCode": 404, + "message": "cannot find Achievement where userId:3cd81b8c-d45e-414e-be66-afb31aa0240c, achievementsProviderId:3cd81b8c-d45e-414e-be66-afb31aa0240c" + } +] \ No newline at end of file diff --git a/test/postman/testData/user-achievement/get-user-achievement-by-admin.json b/test/postman/testData/user-achievement/get-user-achievement-by-admin.json new file mode 100644 index 0000000..cf6d15f --- /dev/null +++ b/test/postman/testData/user-achievement/get-user-achievement-by-admin.json @@ -0,0 +1,7 @@ +[ + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "achievement_id":"{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/user-achievement/get-user-achievement-by-user.json b/test/postman/testData/user-achievement/get-user-achievement-by-user.json new file mode 100644 index 0000000..c573c17 --- /dev/null +++ b/test/postman/testData/user-achievement/get-user-achievement-by-user.json @@ -0,0 +1,7 @@ +[ + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "achievement_id": "{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/user-achievement/get-user-achievement-with-invalid-parameters.json b/test/postman/testData/user-achievement/get-user-achievement-with-invalid-parameters.json new file mode 100644 index 0000000..b05a9ec --- /dev/null +++ b/test/postman/testData/user-achievement/get-user-achievement-with-invalid-parameters.json @@ -0,0 +1,26 @@ +[ + { + "user_id": "{{USER_ID_BY_TESTER}}", + "achievement_id": "123456", + "httpCode": 500, + "message": "invalid input syntax for type uuid: \"123456\"" + }, + { + "user_id": "123456", + "achievement_id": "{{ACHIEVEMENTS_PROVIDER_ID_2}}", + "httpCode": 500, + "message": "invalid input syntax for type uuid: \"123456\"" + }, + { + "user_id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "achievement_id": "{{ACHIEVEMENTS_PROVIDER_ID_2}}", + "httpCode": 404, + "message": "cannot find Achievement where userId:3cd81b8c-d45e-414e-be66-afb31aa0240c" + }, + { + "user_id": "{{USER_ID_BY_TESTER}}", + "achievement_id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "httpCode": 404, + "message": "cannot find Achievement where userId:bdcb113f-6715-40fd-8dab-14aa01327ae9, achievementsProviderId:3cd81b8c-d45e-414e-be66-afb31aa0240c" + } +] \ No newline at end of file diff --git a/test/postman/testData/user-achievement/get-user-achievement-with-invalid-tokens.json b/test/postman/testData/user-achievement/get-user-achievement-with-invalid-tokens.json new file mode 100644 index 0000000..8bc730e --- /dev/null +++ b/test/postman/testData/user-achievement/get-user-achievement-with-invalid-tokens.json @@ -0,0 +1,30 @@ +[ + { + "user_id": "{{USER_ID_BY_TESTER}}", + "achievement_id": "{{ACHIEVEMENT_ID_BY_TESTER}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "user_id": "{{USER_ID_BY_TESTER}}", + "achievement_id": "{{ACHIEVEMENT_ID_BY_TESTER}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "user_id": "{{USER_ID_BY_TESTER}}", + "achievement_id": "{{ACHIEVEMENT_ID_BY_TESTER}}", + "httpCode": 403, + "jwtToken": "", + "message": "No token provided." + }, + { + "user_id": "35ec01c0-d650-4cd9-8a05-848c9019873d", + "achievement_id": "{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "jwtToken": "Bearer {{user_token}}", + "httpCode": 403, + "message": "You are not allowed to perform this action" + } +] \ No newline at end of file diff --git a/test/postman/testData/user-achievement/patch-user-achievement-with-any-fields-by-admin.json b/test/postman/testData/user-achievement/patch-user-achievement-with-any-fields-by-admin.json new file mode 100644 index 0000000..2d55c02 --- /dev/null +++ b/test/postman/testData/user-achievement/patch-user-achievement-with-any-fields-by-admin.json @@ -0,0 +1,63 @@ +[ + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "achievement_id":"{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "input": { + "name": "POSTMANE2E-Topcoder-by-ADMIN-001-updated", + "uri": "http://some.uri-updated", + "certifierId": "certifier id 001-updated", + "certifiedDate": "2021-05-04T07:36:28.036Z" + }, + "expected": { + "name": "POSTMANE2E-Topcoder-by-ADMIN-001-updated", + "uri": "http://some.uri-updated", + "certifierId": "certifier id 001-updated", + "certifiedDate": "2021-05-04T07:36:28.036Z" + }, + "httpCode": 200 + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "achievement_id":"{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "input": { + "name": "POSTMANE2E-Topcoder-by-ADMIN-001-updated1" + }, + "expected": { + "name": "POSTMANE2E-Topcoder-by-ADMIN-001-updated1" + }, + "httpCode": 200 + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "achievement_id":"{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "input": { + "uri": "http://some.uri-updated2" + }, + "expected": { + "uri": "http://some.uri-updated2" + }, + "httpCode": 200 + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "achievement_id":"{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "input": { + "certifierId": "certifier id 001-updated2" + }, + "expected": { + "certifierId": "certifier id 001-updated2" + }, + "httpCode": 200 + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "achievement_id":"{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "input": { + "certifiedDate": "2021-05-08T07:36:28.036Z" + }, + "expected": { + "certifiedDate": "2021-05-08T07:36:28.036Z" + }, + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/user-achievement/patch-user-achievement-with-any-fields-by-user.json b/test/postman/testData/user-achievement/patch-user-achievement-with-any-fields-by-user.json new file mode 100644 index 0000000..78a60c0 --- /dev/null +++ b/test/postman/testData/user-achievement/patch-user-achievement-with-any-fields-by-user.json @@ -0,0 +1,63 @@ +[ + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "achievement_id":"{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "input": { + "name": "POSTMANE2E-Topcoder-by-ADMIN-001-updated2", + "uri": "http://some.uri-updated2", + "certifierId": "certifier id 001-updated2", + "certifiedDate": "2021-05-04T07:36:28.036Z" + }, + "expected": { + "name": "POSTMANE2E-Topcoder-by-ADMIN-001-updated2", + "uri": "http://some.uri-updated2", + "certifierId": "certifier id 001-updated2", + "certifiedDate": "2021-05-04T07:36:28.036Z" + }, + "httpCode": 200 + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "achievement_id":"{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "input": { + "name": "POSTMANE2E-Topcoder-by-ADMIN-001-updated11" + }, + "expected": { + "name": "POSTMANE2E-Topcoder-by-ADMIN-001-updated11" + }, + "httpCode": 200 + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "achievement_id":"{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "input": { + "uri": "http://some.uri-updated21" + }, + "expected": { + "uri": "http://some.uri-updated21" + }, + "httpCode": 200 + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "achievement_id":"{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "input": { + "certifierId": "certifier id 001-updated21" + }, + "expected": { + "certifierId": "certifier id 001-updated21" + }, + "httpCode": 200 + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "achievement_id":"{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "input": { + "certifiedDate": "2021-07-08T07:36:28.036Z" + }, + "expected": { + "certifiedDate": "2021-07-08T07:36:28.036Z" + }, + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/user-achievement/patch-user-achievement-with-invalid-data.json b/test/postman/testData/user-achievement/patch-user-achievement-with-invalid-data.json new file mode 100644 index 0000000..0a39425 --- /dev/null +++ b/test/postman/testData/user-achievement/patch-user-achievement-with-invalid-data.json @@ -0,0 +1,54 @@ +[ + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "achievement_id":"{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "input": { + "name": "" + }, + "httpCode": 400, + "message": "\"entity.name\" is not allowed to be empty" + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "achievement_id":"{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "input": { + "uri": "" + }, + "httpCode": 400, + "message": "\"entity.uri\" is not allowed to be empty" + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "achievement_id":"{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "input": { + "certifiedDate": "" + }, + "httpCode": 400, + "message": "\"entity.certifiedDate\" must be in ISO 8601 date format" + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "achievement_id":"{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "input": { + "ccc": "abc" + }, + "httpCode": 400, + "message": "\"entity.ccc\" is not allowed" + }, + { + "user_id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "achievement_id":"{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "input": { + }, + "httpCode": 404, + "message": "cannot find User where id = 3cd81b8c-d45e-414e-be66-afb31aa0240c" + }, + { + "user_id": "{{USER_ID_BY_TESTER}}", + "achievement_id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "input": { + }, + "httpCode": 404, + "message": "cannot find AchievementsProvider where id = 3cd81b8c-d45e-414e-be66-afb31aa0240c" + } +] \ No newline at end of file diff --git a/test/postman/testData/user-achievement/patch-user-achievement-with-invalid-tokens.json b/test/postman/testData/user-achievement/patch-user-achievement-with-invalid-tokens.json new file mode 100644 index 0000000..0d7b699 --- /dev/null +++ b/test/postman/testData/user-achievement/patch-user-achievement-with-invalid-tokens.json @@ -0,0 +1,23 @@ +[ + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "achievement_id":"{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "achievement_id":"{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "achievement_id":"{{ACHIEVEMENTS_PROVIDER_ID_BY_ADMIN}}", + "jwtToken": "", + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/user-achievement/search-user-achievements-with-invalid-parameters.json b/test/postman/testData/user-achievement/search-user-achievements-with-invalid-parameters.json new file mode 100644 index 0000000..c533bbd --- /dev/null +++ b/test/postman/testData/user-achievement/search-user-achievements-with-invalid-parameters.json @@ -0,0 +1,25 @@ +[ + { + "user_id": "{{USER_ID_1}}", + "input": "page=-1&perPage=10", + "httpCode": 400, + "message": "\"query.page\" must be larger than or equal to 1" + }, + { + "user_id": "{{USER_ID_1}}", + "input": "page=1&perPage=-10", + "httpCode": 400, + "message": "\"query.perPage\" must be larger than or equal to 1" + }, + { + "input": "achievementsProviderName=", + "httpCode": 400, + "message": "\"query.achievementsProviderName\" is not allowed to be empty" + }, + { + "user_id": "{{USER_ID_1}}", + "input": "aa=cc", + "httpCode": 400, + "message": "\"query.aa\" is not allowed" + } +] \ No newline at end of file diff --git a/test/postman/testData/user-achievement/search-user-achievements-with-invalid-tokens.json b/test/postman/testData/user-achievement/search-user-achievements-with-invalid-tokens.json new file mode 100644 index 0000000..dc69184 --- /dev/null +++ b/test/postman/testData/user-achievement/search-user-achievements-with-invalid-tokens.json @@ -0,0 +1,20 @@ +[ + { + "user_id": "{{USER_ID_1}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "user_id": "{{USER_ID_1}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "user_id": "{{USER_ID_1}}", + "jwtToken": "", + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/user-achievement/search-user-achievements-with-various-parameters.json b/test/postman/testData/user-achievement/search-user-achievements-with-various-parameters.json new file mode 100644 index 0000000..c729631 --- /dev/null +++ b/test/postman/testData/user-achievement/search-user-achievements-with-various-parameters.json @@ -0,0 +1,10 @@ +[ + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "input": "page=1&perPage=10&achievementsProviderName=POSTMANE2E-" + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "input": "page=1&perPage=10" + } +] \ No newline at end of file diff --git a/test/postman/testData/user-attribute/create-user-attribute-by-admin.json b/test/postman/testData/user-attribute/create-user-attribute-by-admin.json new file mode 100644 index 0000000..984e291 --- /dev/null +++ b/test/postman/testData/user-attribute/create-user-attribute-by-admin.json @@ -0,0 +1,14 @@ +[ + { + "user_id": "ce348067-e73f-49d7-af72-fcf11a6c88bf", + "input": { + "attributeId": "{{ATTRIBUTE_ID_BY_ADMIN}}", + "value": "POSTMANE2E-Attribute-by-ADMIN-001" + }, + "expected": { + "attributeId": "{{ATTRIBUTE_ID_BY_ADMIN}}", + "value": "POSTMANE2E-Attribute-by-ADMIN-001" + }, + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/user-attribute/create-user-attribute-by-user.json b/test/postman/testData/user-attribute/create-user-attribute-by-user.json new file mode 100644 index 0000000..d534ccf --- /dev/null +++ b/test/postman/testData/user-attribute/create-user-attribute-by-user.json @@ -0,0 +1,14 @@ +[ + { + "user_id": "df2f0027-f74f-45fa-85cd-84c9fdc2faf4", + "input": { + "attributeId": "{{ATTRIBUTE_ID_BY_ADMIN}}", + "value": "POSTMANE2E-Attribute-by-TESTER-001" + }, + "expected": { + "attributeId": "{{ATTRIBUTE_ID_BY_ADMIN}}", + "value": "POSTMANE2E-Attribute-by-TESTER-001" + }, + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/user-attribute/create-user-attribute-with-invalid-data.json b/test/postman/testData/user-attribute/create-user-attribute-with-invalid-data.json new file mode 100644 index 0000000..d94bc04 --- /dev/null +++ b/test/postman/testData/user-attribute/create-user-attribute-with-invalid-data.json @@ -0,0 +1,63 @@ +[ + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "input": { + "value": "POSTMANE2E-Attribute-by-TESTER-002" + }, + "httpCode": 400, + "message": "\"entity.attributeId\" is required" + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "input": { + "attributeId":"", + "value": "POSTMANE2E-Attribute-by-TESTER-002" + }, + "httpCode": 400, + "message": "\"entity.attributeId\" is not allowed to be empty" + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "input": { + "attributeId": "{{ATTRIBUTE_ID_BY_ADMIN}}" + }, + "httpCode": 400, + "message": "\"entity.value\" is required" + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "input": { + "attributeId": "{{ATTRIBUTE_ID_BY_ADMIN}}", + "value": "" + }, + "httpCode": 400, + "message": "\"entity.value\" is not allowed to be empty" + }, + { + "user_id": "ce348067-e73f-49d7-af72-fcf11a6c88bf", + "input": { + "attributeId": "{{ATTRIBUTE_ID_BY_ADMIN}}", + "value": "POSTMANE2E-Attribute-by-TESTER-002" + }, + "httpCode": 409, + "message": "UserAttribute already exists with userId:ce348067-e73f-49d7-af72-fcf11a6c88bf" + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "input": { + "attributeId":"75b30af0-46df-4cf6-97ed-3a5608516f4a", + "value": "POSTMANE2E-Attribute-by-TESTER-002" + }, + "httpCode": 404, + "message": "cannot find Attribute where id = 75b30af0-46df-4cf6-97ed-3a5608516f4a" + }, + { + "user_id": "75b30af0-46df-4cf6-97ed-3a5608516f4a", + "input": { + "attributeId":"{{ATTRIBUTE_ID_BY_ADMIN}}", + "value": "POSTMANE2E-Attribute-by-TESTER-002" + }, + "httpCode": 404, + "message": "cannot find User where id = 75b30af0-46df-4cf6-97ed-3a5608516f4a" + } +] \ No newline at end of file diff --git a/test/postman/testData/user-attribute/create-user-attribute-with-invalid-tokens.json b/test/postman/testData/user-attribute/create-user-attribute-with-invalid-tokens.json new file mode 100644 index 0000000..b878e02 --- /dev/null +++ b/test/postman/testData/user-attribute/create-user-attribute-with-invalid-tokens.json @@ -0,0 +1,20 @@ +[ + { + "user_id": "{{USER_ID_2}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "user_id": "{{USER_ID_2}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "user_id": "{{USER_ID_2}}", + "jwtToken": "", + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/user-attribute/delete-user-attribute-by-admin.json b/test/postman/testData/user-attribute/delete-user-attribute-by-admin.json new file mode 100644 index 0000000..150b77e --- /dev/null +++ b/test/postman/testData/user-attribute/delete-user-attribute-by-admin.json @@ -0,0 +1,6 @@ +[ + { + "user_id": "df2f0027-f74f-45fa-85cd-84c9fdc2faf4", + "attribute_id":"{{ATTRIBUTE_ID_BY_ADMIN}}" + } +] \ No newline at end of file diff --git a/test/postman/testData/user-attribute/delete-user-attribute-with-invalid-request.json b/test/postman/testData/user-attribute/delete-user-attribute-with-invalid-request.json new file mode 100644 index 0000000..24b396c --- /dev/null +++ b/test/postman/testData/user-attribute/delete-user-attribute-with-invalid-request.json @@ -0,0 +1,36 @@ +[ + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "attribute_id": "{{ATTRIBUTE_ID_BY_ADMIN}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "attribute_id": "{{ATTRIBUTE_ID_BY_ADMIN}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "attribute_id": "{{ATTRIBUTE_ID_BY_ADMIN}}", + "httpCode": 403, + "message": "No token provided." + }, + { + "user_id": "ce348067-e73f-49d7-af72-fcf11a6c88bf", + "attribute_id": "{{ATTRIBUTE_ID_BY_ADMIN}}", + "jwtToken": "Bearer {{user_token}}", + "httpCode": 403, + "message": "You are not allowed to perform this action" + }, + { + "user_id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "attribute_id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "jwtToken": "Bearer {{admin_token}}", + "httpCode": 404, + "message": "cannot find UserAttribute where userId:3cd81b8c-d45e-414e-be66-afb31aa0240c, attributeId:3cd81b8c-d45e-414e-be66-afb31aa0240c" + } +] \ No newline at end of file diff --git a/test/postman/testData/user-attribute/get-user-attribute-by-admin.json b/test/postman/testData/user-attribute/get-user-attribute-by-admin.json new file mode 100644 index 0000000..b5a1aba --- /dev/null +++ b/test/postman/testData/user-attribute/get-user-attribute-by-admin.json @@ -0,0 +1,7 @@ +[ + { + "user_id": "ce348067-e73f-49d7-af72-fcf11a6c88bf", + "attribute_id": "{{ATTRIBUTE_ID_BY_ADMIN}}", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/user-attribute/get-user-attribute-by-user.json b/test/postman/testData/user-attribute/get-user-attribute-by-user.json new file mode 100644 index 0000000..e101d84 --- /dev/null +++ b/test/postman/testData/user-attribute/get-user-attribute-by-user.json @@ -0,0 +1,7 @@ +[ + { + "user_id": "df2f0027-f74f-45fa-85cd-84c9fdc2faf4", + "attribute_id": "{{ATTRIBUTE_ID_BY_ADMIN}}", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/user-attribute/get-user-attribute-with-invalid-parameters.json b/test/postman/testData/user-attribute/get-user-attribute-with-invalid-parameters.json new file mode 100644 index 0000000..0d5ddf6 --- /dev/null +++ b/test/postman/testData/user-attribute/get-user-attribute-with-invalid-parameters.json @@ -0,0 +1,26 @@ +[ + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "attribute_id": "123456", + "httpCode": 500, + "message": "invalid input syntax for type uuid: \"123456\"" + }, + { + "user_id": "123456", + "attribute_id": "{{ATTRIBUTE_ID_BY_ADMIN}}", + "httpCode": 500, + "message": "invalid input syntax for type uuid: \"123456\"" + }, + { + "user_id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "attribute_id": "{{ATTRIBUTE_ID_BY_ADMIN}}", + "httpCode": 404, + "message": "cannot find UserAttribute where userId:3cd81b8c-d45e-414e-be66-afb31aa0240c" + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "attribute_id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "httpCode": 404, + "message": "cannot find UserAttribute where userId" + } +] \ No newline at end of file diff --git a/test/postman/testData/user-attribute/get-user-attribute-with-invalid-tokens.json b/test/postman/testData/user-attribute/get-user-attribute-with-invalid-tokens.json new file mode 100644 index 0000000..c776b9d --- /dev/null +++ b/test/postman/testData/user-attribute/get-user-attribute-with-invalid-tokens.json @@ -0,0 +1,30 @@ +[ + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "attribute_id": "{{ATTRIBUTE_ID_BY_ADMIN}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "attribute_id": "{{ATTRIBUTE_ID_BY_ADMIN}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "attribute_id": "{{ATTRIBUTE_ID_BY_ADMIN}}", + "httpCode": 403, + "jwtToken": "", + "message": "No token provided." + }, + { + "user_id": "ce348067-e73f-49d7-af72-fcf11a6c88bf", + "attribute_id": "{{ATTRIBUTE_ID_BY_ADMIN}}", + "jwtToken": "Bearer {{user_token}}", + "httpCode": 403, + "message": "You are not allowed to perform this action" + } +] \ No newline at end of file diff --git a/test/postman/testData/user-attribute/patch-user-attribute-with-any-fields-by-admin.json b/test/postman/testData/user-attribute/patch-user-attribute-with-any-fields-by-admin.json new file mode 100644 index 0000000..eeca08c --- /dev/null +++ b/test/postman/testData/user-attribute/patch-user-attribute-with-any-fields-by-admin.json @@ -0,0 +1,13 @@ +[ + { + "user_id": "ce348067-e73f-49d7-af72-fcf11a6c88bf", + "attribute_id": "{{ATTRIBUTE_ID_BY_ADMIN}}", + "input": { + "value": "POSTMANE2E-Attribute-ADMIN-updated001" + }, + "expected": { + "value": "POSTMANE2E-Attribute-ADMIN-updated001" + }, + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/user-attribute/patch-user-attribute-with-any-fields-by-user.json b/test/postman/testData/user-attribute/patch-user-attribute-with-any-fields-by-user.json new file mode 100644 index 0000000..db0e8b1 --- /dev/null +++ b/test/postman/testData/user-attribute/patch-user-attribute-with-any-fields-by-user.json @@ -0,0 +1,13 @@ +[ + { + "user_id": "df2f0027-f74f-45fa-85cd-84c9fdc2faf4", + "attribute_id": "{{ATTRIBUTE_ID_BY_ADMIN}}", + "input": { + "value": "POSTMANE2E-Attribute-ADMIN-updated001" + }, + "expected": { + "value": "POSTMANE2E-Attribute-ADMIN-updated001" + }, + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/user-attribute/patch-user-attribute-with-invalid-data.json b/test/postman/testData/user-attribute/patch-user-attribute-with-invalid-data.json new file mode 100644 index 0000000..dcb891b --- /dev/null +++ b/test/postman/testData/user-attribute/patch-user-attribute-with-invalid-data.json @@ -0,0 +1,36 @@ +[ + { + "user_id": "e043286d-ab55-44e3-b2c2-7f7a4f375dcf", + "attribute_id": "{{ATTRIBUTE_ID_BY_ADMIN}}", + "input": { + "value": "" + }, + "httpCode": 400, + "message": "\"entity.value\" is not allowed to be empty" + }, + { + "user_id": "e043286d-ab55-44e3-b2c2-7f7a4f375dcf", + "attribute_id": "{{ATTRIBUTE_ID_BY_ADMIN}}", + "input": { + "ccc": "abc" + }, + "httpCode": 400, + "message": "\"entity.ccc\" is not allowed" + }, + { + "user_id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "attribute_id": "{{ATTRIBUTE_ID_BY_ADMIN}}", + "input": { + }, + "httpCode": 404, + "message": "cannot find User where id = 3cd81b8c-d45e-414e-be66-afb31aa0240c" + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "attribute_id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "input": { + }, + "httpCode": 404, + "message": "cannot find Attribute where id = 3cd81b8c-d45e-414e-be66-afb31aa0240c" + } +] \ No newline at end of file diff --git a/test/postman/testData/user-attribute/patch-user-attribute-with-invalid-tokens.json b/test/postman/testData/user-attribute/patch-user-attribute-with-invalid-tokens.json new file mode 100644 index 0000000..c13f39c --- /dev/null +++ b/test/postman/testData/user-attribute/patch-user-attribute-with-invalid-tokens.json @@ -0,0 +1,23 @@ +[ + { + "user_id": "e043286d-ab55-44e3-b2c2-7f7a4f375dcf", + "attribute_id": "{{ATTRIBUTE_ID_BY_ADMIN}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "user_id": "e043286d-ab55-44e3-b2c2-7f7a4f375dcf", + "attribute_id": "{{ATTRIBUTE_ID_BY_ADMIN}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "user_id": "e043286d-ab55-44e3-b2c2-7f7a4f375dcf", + "attribute_id": "{{ATTRIBUTE_ID_BY_ADMIN}}", + "jwtToken": "", + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/user-attribute/search-user-attributes-with-invalid-parameters.json b/test/postman/testData/user-attribute/search-user-attributes-with-invalid-parameters.json new file mode 100644 index 0000000..53d0aa9 --- /dev/null +++ b/test/postman/testData/user-attribute/search-user-attributes-with-invalid-parameters.json @@ -0,0 +1,35 @@ +[ + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "input": "page=-1&perPage=10", + "httpCode": 400, + "message": "\"query.page\" must be larger than or equal to 1" + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "input": "page=1&perPage=-10", + "httpCode": 400, + "message": "\"query.perPage\" must be larger than or equal to 1" + }, + { + "input": "attributeName=", + "httpCode": 400, + "message": "\"query.attributeName\" is not allowed to be empty" + }, + { + "input": "attributeGroupName=", + "httpCode": 400, + "message": "\"query.attributeGroupName\" is not allowed to be empty" + }, + { + "input": "attributeGroupId=", + "httpCode": 400, + "message": "\"query.attributeGroupId\" is not allowed to be empty" + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "input": "aa=cc", + "httpCode": 400, + "message": "\"query.aa\" is not allowed" + } +] \ No newline at end of file diff --git a/test/postman/testData/user-attribute/search-user-attributes-with-invalid-tokens.json b/test/postman/testData/user-attribute/search-user-attributes-with-invalid-tokens.json new file mode 100644 index 0000000..fbcdb9f --- /dev/null +++ b/test/postman/testData/user-attribute/search-user-attributes-with-invalid-tokens.json @@ -0,0 +1,20 @@ +[ + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "jwtToken": "", + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/user-attribute/search-user-attributes-with-various-parameters.json b/test/postman/testData/user-attribute/search-user-attributes-with-various-parameters.json new file mode 100644 index 0000000..e1a6bba --- /dev/null +++ b/test/postman/testData/user-attribute/search-user-attributes-with-various-parameters.json @@ -0,0 +1,22 @@ +[ + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "input": "page=1&perPage=10&attributeName=POSTMANE2E-attribute&attributeGroupName=POSTMANE2E-attributeGroup&attributeGroupId=84634bbd-8191-40cf-a03e-9962d7e39fda" + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "input": "page=1&perPage=10" + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "input": "attributeName=POSTMANE2E-attribute" + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "input": "attributeGroupName=POSTMANE2E-attributeGroup" + }, + { + "user_id": "{{USER_ID_BY_ADMIN}}", + "input": "attributeGroupId=84634bbd-8191-40cf-a03e-9962d7e39fda" + } +] \ No newline at end of file diff --git a/test/postman/testData/user-role/create-user-role-by-admin.json b/test/postman/testData/user-role/create-user-role-by-admin.json new file mode 100644 index 0000000..87c4682 --- /dev/null +++ b/test/postman/testData/user-role/create-user-role-by-admin.json @@ -0,0 +1,12 @@ +[ + { + "user_id": "{{USER_ID_2}}", + "input": { + "roleId":"{{ROLE_ID_BY_ADMIN}}" + }, + "expected": { + "roleId":"{{ROLE_ID_BY_ADMIN}}" + }, + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/user-role/create-user-role-by-user.json b/test/postman/testData/user-role/create-user-role-by-user.json new file mode 100644 index 0000000..2720524 --- /dev/null +++ b/test/postman/testData/user-role/create-user-role-by-user.json @@ -0,0 +1,12 @@ +[ + { + "user_id": "{{USER_ID_BY_TESTER}}", + "input": { + "roleId":"{{ROLE_ID_1}}" + }, + "expected": { + "roleId":"{{ROLE_ID_1}}" + }, + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/user-role/create-user-role-with-invalid-data.json b/test/postman/testData/user-role/create-user-role-with-invalid-data.json new file mode 100644 index 0000000..ff1ea0d --- /dev/null +++ b/test/postman/testData/user-role/create-user-role-with-invalid-data.json @@ -0,0 +1,41 @@ +[ + { + "user_id": "{{USER_ID_2}}", + "input": { + }, + "httpCode": 400, + "message": "\"entity.roleId\" is required" + }, + { + "user_id": "{{USER_ID_2}}", + "input": { + "roleId":"" + }, + "httpCode": 400, + "message": "\"entity.roleId\" is not allowed to be empty" + }, + { + "user_id": "{{USER_ID_2}}", + "input": { + "roleId":"{{ROLE_ID_BY_ADMIN}}" + }, + "httpCode": 409, + "message": "UsersRole already exists with userId:" + }, + { + "user_id": "{{USER_ID_2}}", + "input": { + "roleId":"75b30af0-46df-4cf6-97ed-3a5608516f4a" + }, + "httpCode": 404, + "message": "cannot find Role where id = 75b30af0-46df-4cf6-97ed-3a5608516f4a" + }, + { + "user_id": "75b30af0-46df-4cf6-97ed-3a5608516f4a", + "input": { + "roleId":"{{ROLE_ID_2}}" + }, + "httpCode": 404, + "message": "cannot find User where id = 75b30af0-46df-4cf6-97ed-3a5608516f4a" + } +] \ No newline at end of file diff --git a/test/postman/testData/user-role/create-user-role-with-invalid-tokens.json b/test/postman/testData/user-role/create-user-role-with-invalid-tokens.json new file mode 100644 index 0000000..b878e02 --- /dev/null +++ b/test/postman/testData/user-role/create-user-role-with-invalid-tokens.json @@ -0,0 +1,20 @@ +[ + { + "user_id": "{{USER_ID_2}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "user_id": "{{USER_ID_2}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "user_id": "{{USER_ID_2}}", + "jwtToken": "", + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/user-role/delete-user-role-with-invalid-request.json b/test/postman/testData/user-role/delete-user-role-with-invalid-request.json new file mode 100644 index 0000000..a51b6b6 --- /dev/null +++ b/test/postman/testData/user-role/delete-user-role-with-invalid-request.json @@ -0,0 +1,36 @@ +[ + { + "user_id": "{{USER_ID_BY_TESTER}}", + "role_id": "{{ROLE_ID_BY_TESTER}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "user_id": "{{USER_ID_BY_TESTER}}", + "role_id": "{{ROLE_ID_BY_TESTER}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "user_id": "{{USER_ID_BY_TESTER}}", + "role_id": "{{ROLE_ID_BY_TESTER}}", + "httpCode": 403, + "message": "No token provided." + }, + { + "user_id": "{{USER_ID_2}}", + "role_id": "{{ROLE_ID_BY_ADMIN}}", + "jwtToken": "Bearer {{user_token}}", + "httpCode": 403, + "message": "You are not allowed to perform this action" + }, + { + "user_id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "role_id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "jwtToken": "Bearer {{admin_token}}", + "httpCode": 404, + "message": "cannot find UsersRole where userId:3cd81b8c-d45e-414e-be66-afb31aa0240c, roleId:3cd81b8c-d45e-414e-be66-afb31aa0240c" + } +] \ No newline at end of file diff --git a/test/postman/testData/user-role/get-user-role-by-admin.json b/test/postman/testData/user-role/get-user-role-by-admin.json new file mode 100644 index 0000000..f647b6c --- /dev/null +++ b/test/postman/testData/user-role/get-user-role-by-admin.json @@ -0,0 +1,7 @@ +[ + { + "user_id": "{{USER_ID_2}}", + "role_id":"{{ROLE_ID_BY_ADMIN}}", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/user-role/get-user-role-by-user.json b/test/postman/testData/user-role/get-user-role-by-user.json new file mode 100644 index 0000000..591731f --- /dev/null +++ b/test/postman/testData/user-role/get-user-role-by-user.json @@ -0,0 +1,7 @@ +[ + { + "user_id": "{{USER_ID_BY_TESTER}}", + "role_id": "{{ROLE_ID_1}}", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/user-role/get-user-role-with-invalid-parameters.json b/test/postman/testData/user-role/get-user-role-with-invalid-parameters.json new file mode 100644 index 0000000..59a69a9 --- /dev/null +++ b/test/postman/testData/user-role/get-user-role-with-invalid-parameters.json @@ -0,0 +1,26 @@ +[ + { + "user_id": "{{USER_ID_BY_TESTER}}", + "role_id": "123456", + "httpCode": 500, + "message": "invalid input syntax for type uuid: \"123456\"" + }, + { + "user_id": "123456", + "role_id": "{{ROLE_ID_2}}", + "httpCode": 500, + "message": "invalid input syntax for type uuid: \"123456\"" + }, + { + "user_id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "role_id": "{{ROLE_ID_2}}", + "httpCode": 404, + "message": "cannot find UsersRole where userId:3cd81b8c-d45e-414e-be66-afb31aa0240c" + }, + { + "user_id": "{{USER_ID_BY_TESTER}}", + "role_id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "httpCode": 404, + "message": "cannot find UsersRole where userId:bdcb113f-6715-40fd-8dab-14aa01327ae9, roleId:3cd81b8c-d45e-414e-be66-afb31aa0240c" + } +] \ No newline at end of file diff --git a/test/postman/testData/user-role/get-user-role-with-invalid-tokens.json b/test/postman/testData/user-role/get-user-role-with-invalid-tokens.json new file mode 100644 index 0000000..afcaeda --- /dev/null +++ b/test/postman/testData/user-role/get-user-role-with-invalid-tokens.json @@ -0,0 +1,30 @@ +[ + { + "user_id": "{{USER_ID_BY_TESTER}}", + "role_id": "{{ROLE_ID_BY_TESTER}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "user_id": "{{USER_ID_BY_TESTER}}", + "role_id": "{{ROLE_ID_BY_TESTER}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "user_id": "{{USER_ID_BY_TESTER}}", + "role_id": "{{ROLE_ID_BY_TESTER}}", + "httpCode": 403, + "jwtToken": "", + "message": "No token provided." + }, + { + "user_id": "{{USER_ID_2}}", + "role_id": "{{ROLE_ID_BY_ADMIN}}", + "jwtToken": "Bearer {{user_token}}", + "httpCode": 403, + "message": "You are not allowed to perform this action" + } +] \ No newline at end of file diff --git a/test/postman/testData/user-role/search-user-roles-with-invalid-parameters.json b/test/postman/testData/user-role/search-user-roles-with-invalid-parameters.json new file mode 100644 index 0000000..fff9943 --- /dev/null +++ b/test/postman/testData/user-role/search-user-roles-with-invalid-parameters.json @@ -0,0 +1,26 @@ +[ + { + "user_id": "{{USER_ID_1}}", + "input": "page=-1&perPage=10", + "httpCode": 400, + "message": "\"query.page\" must be larger than or equal to 1" + }, + { + "user_id": "{{USER_ID_1}}", + "input": "page=1&perPage=-10", + "httpCode": 400, + "message": "\"query.perPage\" must be larger than or equal to 1" + }, + { + "user_id": "{{USER_ID_1}}", + "input": "aa=cc", + "httpCode": 400, + "message": "\"query.aa\" is not allowed" + }, + { + "user_id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "input": "", + "httpCode": 404, + "message": "cannot find User where id = 3cd81b8c-d45e-414e-be66-afb31aa0240c" + } +] \ No newline at end of file diff --git a/test/postman/testData/user-role/search-user-roles-with-invalid-tokens.json b/test/postman/testData/user-role/search-user-roles-with-invalid-tokens.json new file mode 100644 index 0000000..dc69184 --- /dev/null +++ b/test/postman/testData/user-role/search-user-roles-with-invalid-tokens.json @@ -0,0 +1,20 @@ +[ + { + "user_id": "{{USER_ID_1}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "user_id": "{{USER_ID_1}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "user_id": "{{USER_ID_1}}", + "jwtToken": "", + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/user-role/search-user-roles-with-various-parameters.json b/test/postman/testData/user-role/search-user-roles-with-various-parameters.json new file mode 100644 index 0000000..6ecf2ac --- /dev/null +++ b/test/postman/testData/user-role/search-user-roles-with-various-parameters.json @@ -0,0 +1,10 @@ +[ + { + "user_id": "{{USER_ID_1}}", + "input": "page=1&perPage=10" + }, + { + "user_id": "{{USER_ID_1}}", + "input": "" + } +] \ No newline at end of file diff --git a/test/postman/testData/user-skill/create-user-skill-by-admin.json b/test/postman/testData/user-skill/create-user-skill-by-admin.json new file mode 100644 index 0000000..3709374 --- /dev/null +++ b/test/postman/testData/user-skill/create-user-skill-by-admin.json @@ -0,0 +1,30 @@ +[ + { + "user_id": "{{USER_ID_2}}", + "input": { + "skillId":"{{SKILL_ID_BY_ADMIN}}", + "metricValue":"3L", + "certifierId": "POSTMANE2E-certifier_id", + "certifiedDate":"2020-05-04T07:36:28.036Z" + }, + "expected": { + "skillId":"{{SKILL_ID_BY_ADMIN}}", + "metricValue":"3L", + "certifierId": "POSTMANE2E-certifier_id", + "certifiedDate":"2020-05-04T07:36:28.036Z" + }, + "httpCode": 200 + }, + { + "user_id": "{{USER_ID_BY_TESTER}}", + "input": { + "skillId":"{{SKILL_ID_BY_TESTER}}", + "metricValue":"3L" + }, + "expected": { + "skillId":"{{SKILL_ID_BY_TESTER}}", + "metricValue":"3L" + }, + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/user-skill/create-user-skill-by-user.json b/test/postman/testData/user-skill/create-user-skill-by-user.json new file mode 100644 index 0000000..5d7a30d --- /dev/null +++ b/test/postman/testData/user-skill/create-user-skill-by-user.json @@ -0,0 +1,14 @@ +[ + { + "user_id": "{{USER_ID_BY_TESTER}}", + "input": { + "skillId":"{{SKILL_ID_2}}", + "metricValue":"3L" + }, + "expected": { + "skillId":"{{SKILL_ID_2}}", + "metricValue":"3L" + }, + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/user-skill/create-user-skill-with-invalid-data.json b/test/postman/testData/user-skill/create-user-skill-with-invalid-data.json new file mode 100644 index 0000000..412f31c --- /dev/null +++ b/test/postman/testData/user-skill/create-user-skill-with-invalid-data.json @@ -0,0 +1,78 @@ +[ + { + "user_id": "{{USER_ID_2}}", + "input": { + "metricValue":"3L", + "certifierId": "POSTMANE2E-certifier_id", + "certifiedDate":"2020-05-04T07:36:28.036Z" + }, + "httpCode": 400, + "message": "\"entity.skillId\" is required" + }, + { + "user_id": "{{USER_ID_2}}", + "input": { + "skillId":"", + "metricValue":"3L", + "certifierId": "POSTMANE2E-certifier_id", + "certifiedDate":"2020-05-04T07:36:28.036Z" + }, + "httpCode": 400, + "message": "\"entity.skillId\" is not allowed to be empty" + }, + { + "user_id": "{{USER_ID_2}}", + "input": { + "skillId":"{{SKILL_ID_2}}", + "metricValue":"", + "certifierId": "POSTMANE2E-certifier_id", + "certifiedDate":"2020-05-04T07:36:28.036Z" + }, + "httpCode": 400, + "message": "\"entity.metricValue\" is not allowed to be empty" + }, + { + "user_id": "{{USER_ID_2}}", + "input": { + "skillId":"{{SKILL_ID_2}}", + "metricValue":"3L", + "certifierId":"", + "certifiedDate":"2020-05-04T07:36:28.036Z" + }, + "httpCode": 400, + "message": "\"entity.certifierId\" is not allowed to be empty" + }, + { + "user_id": "{{USER_ID_2}}", + "input": { + "skillId":"{{SKILL_ID_2}}", + "metricValue":"3L", + "certifierId": "POSTMANE2E-certifier_id", + "certifiedDate":"" + }, + "httpCode": 400, + "message": "\"entity.certifiedDate\" must be in ISO 8601 date format" + }, + { + "user_id": "{{USER_ID_2}}", + "input": { + "skillId":"{{SKILL_ID_2}}", + "metricValue":"3L", + "certifierId": "POSTMANE2E-certifier_id", + "certifiedDate":"invalid_date" + }, + "httpCode": 400, + "message": "\"entity.certifiedDate\" must be in ISO 8601 date format" + }, + { + "user_id": "{{USER_ID_2}}", + "input": { + "skillId":"{{SKILL_ID_BY_ADMIN}}", + "metricValue":"3L", + "certifierId": "POSTMANE2E-certifier_id", + "certifiedDate":"2020-05-04T07:36:28.036Z" + }, + "httpCode": 409, + "message": "UsersSkill already exists with userId:" + } +] \ No newline at end of file diff --git a/test/postman/testData/user-skill/create-user-skill-with-invalid-tokens.json b/test/postman/testData/user-skill/create-user-skill-with-invalid-tokens.json new file mode 100644 index 0000000..b878e02 --- /dev/null +++ b/test/postman/testData/user-skill/create-user-skill-with-invalid-tokens.json @@ -0,0 +1,20 @@ +[ + { + "user_id": "{{USER_ID_2}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "user_id": "{{USER_ID_2}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "user_id": "{{USER_ID_2}}", + "jwtToken": "", + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/user-skill/delete-user-skill-with-invalid-request.json b/test/postman/testData/user-skill/delete-user-skill-with-invalid-request.json new file mode 100644 index 0000000..151f5f6 --- /dev/null +++ b/test/postman/testData/user-skill/delete-user-skill-with-invalid-request.json @@ -0,0 +1,36 @@ +[ + { + "user_id": "{{USER_ID_BY_TESTER}}", + "skill_id": "{{SKILL_ID_BY_TESTER}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "user_id": "{{USER_ID_BY_TESTER}}", + "skill_id": "{{SKILL_ID_BY_TESTER}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "user_id": "{{USER_ID_BY_TESTER}}", + "skill_id": "{{SKILL_ID_BY_TESTER}}", + "httpCode": 403, + "message": "No token provided." + }, + { + "user_id": "{{USER_ID_BY_TESTER}}", + "skill_id": "{{SKILL_ID_BY_TESTER}}", + "jwtToken": "Bearer {{user_token}}", + "httpCode": 403, + "message": "You are not allowed to perform this action" + }, + { + "user_id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "skill_id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "jwtToken": "Bearer {{admin_token}}", + "httpCode": 404, + "message": "cannot find UsersSkill where userId:3cd81b8c-d45e-414e-be66-afb31aa0240c, skillId:3cd81b8c-d45e-414e-be66-afb31aa0240c" + } +] \ No newline at end of file diff --git a/test/postman/testData/user-skill/get-user-skill-by-admin.json b/test/postman/testData/user-skill/get-user-skill-by-admin.json new file mode 100644 index 0000000..30c8201 --- /dev/null +++ b/test/postman/testData/user-skill/get-user-skill-by-admin.json @@ -0,0 +1,12 @@ +[ + { + "user_id": "{{USER_ID_2}}", + "skill_id":"{{SKILL_ID_BY_ADMIN}}", + "httpCode": 200 + }, + { + "user_id": "{{USER_ID_BY_TESTER}}", + "skill_id": "{{SKILL_ID_BY_TESTER}}", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/user-skill/get-user-skill-by-user.json b/test/postman/testData/user-skill/get-user-skill-by-user.json new file mode 100644 index 0000000..820a31d --- /dev/null +++ b/test/postman/testData/user-skill/get-user-skill-by-user.json @@ -0,0 +1,7 @@ +[ + { + "user_id": "{{USER_ID_BY_TESTER}}", + "skill_id": "{{SKILL_ID_2}}", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/user-skill/get-user-skill-with-invalid-parameters.json b/test/postman/testData/user-skill/get-user-skill-with-invalid-parameters.json new file mode 100644 index 0000000..96a7dfa --- /dev/null +++ b/test/postman/testData/user-skill/get-user-skill-with-invalid-parameters.json @@ -0,0 +1,26 @@ +[ + { + "user_id": "{{USER_ID_BY_TESTER}}", + "skill_id": "123456", + "httpCode": 500, + "message": "invalid input syntax for type uuid: \"123456\"" + }, + { + "user_id": "123456", + "skill_id": "{{SKILL_ID_2}}", + "httpCode": 500, + "message": "invalid input syntax for type uuid: \"123456\"" + }, + { + "user_id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "skill_id": "{{SKILL_ID_2}}", + "httpCode": 404, + "message": "cannot find UsersSkill where userId:3cd81b8c-d45e-414e-be66-afb31aa0240c" + }, + { + "user_id": "{{USER_ID_BY_TESTER}}", + "skill_id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "httpCode": 404, + "message": "cannot find UsersSkill where userId:bdcb113f-6715-40fd-8dab-14aa01327ae9, skillId:3cd81b8c-d45e-414e-be66-afb31aa0240c" + } +] \ No newline at end of file diff --git a/test/postman/testData/user-skill/get-user-skill-with-invalid-tokens.json b/test/postman/testData/user-skill/get-user-skill-with-invalid-tokens.json new file mode 100644 index 0000000..9d5b2d5 --- /dev/null +++ b/test/postman/testData/user-skill/get-user-skill-with-invalid-tokens.json @@ -0,0 +1,30 @@ +[ + { + "user_id": "{{USER_ID_BY_TESTER}}", + "skill_id": "{{SKILL_ID_BY_TESTER}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "user_id": "{{USER_ID_BY_TESTER}}", + "skill_id": "{{SKILL_ID_BY_TESTER}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "user_id": "{{USER_ID_BY_TESTER}}", + "skill_id": "{{SKILL_ID_BY_TESTER}}", + "httpCode": 403, + "jwtToken": "", + "message": "No token provided." + }, + { + "user_id": "{{USER_ID_BY_TESTER}}", + "skill_id": "{{SKILL_ID_BY_TESTER}}", + "jwtToken": "Bearer {{user_token}}", + "httpCode": 403, + "message": "You are not allowed to perform this action" + } +] \ No newline at end of file diff --git a/test/postman/testData/user-skill/patch-user-skill-with-any-fields-by-admin.json b/test/postman/testData/user-skill/patch-user-skill-with-any-fields-by-admin.json new file mode 100644 index 0000000..8185cc5 --- /dev/null +++ b/test/postman/testData/user-skill/patch-user-skill-with-any-fields-by-admin.json @@ -0,0 +1,50 @@ +[ + { + "user_id": "{{USER_ID_2}}", + "skill_id":"{{SKILL_ID_BY_ADMIN}}", + "input": { + "metricValue":"3L updated", + "certifierId": "POSTMANE2E-certifier_id updated", + "certifiedDate":"2020-07-04T07:36:28.036Z" + }, + "expected": { + "metricValue":"3L updated", + "certifierId": "POSTMANE2E-certifier_id updated", + "certifiedDate":"2020-07-04T07:36:28.036Z" + }, + "httpCode": 200 + }, + { + "user_id": "{{USER_ID_2}}", + "skill_id":"{{SKILL_ID_BY_ADMIN}}", + "input": { + "metricValue":"3L updated 1" + }, + "expected": { + "metricValue":"3L updated 1" + }, + "httpCode": 200 + }, + { + "user_id": "{{USER_ID_2}}", + "skill_id":"{{SKILL_ID_BY_ADMIN}}", + "input": { + "certifierId": "POSTMANE2E-certifier_id updated 1" + }, + "expected": { + "certifierId": "POSTMANE2E-certifier_id updated 1" + }, + "httpCode": 200 + }, + { + "user_id": "{{USER_ID_2}}", + "skill_id":"{{SKILL_ID_BY_ADMIN}}", + "input": { + "certifiedDate":"2021-07-04T07:36:28.036Z" + }, + "expected": { + "certifiedDate":"2021-07-04T07:36:28.036Z" + }, + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/user-skill/patch-user-skill-with-any-fields-by-user.json b/test/postman/testData/user-skill/patch-user-skill-with-any-fields-by-user.json new file mode 100644 index 0000000..25aef78 --- /dev/null +++ b/test/postman/testData/user-skill/patch-user-skill-with-any-fields-by-user.json @@ -0,0 +1,50 @@ +[ + { + "user_id": "{{USER_ID_BY_TESTER}}", + "skill_id": "{{SKILL_ID_2}}", + "input": { + "metricValue":"3L updated 2", + "certifierId": "POSTMANE2E-certifier_id updated 2", + "certifiedDate":"2020-09-04T07:36:28.036Z" + }, + "expected": { + "metricValue":"3L updated 2", + "certifierId": "POSTMANE2E-certifier_id updated 2", + "certifiedDate":"2020-09-04T07:36:28.036Z" + }, + "httpCode": 200 + }, + { + "user_id": "{{USER_ID_BY_TESTER}}", + "skill_id": "{{SKILL_ID_2}}", + "input": { + "metricValue":"3L updated 2" + }, + "expected": { + "metricValue":"3L updated 2" + }, + "httpCode": 200 + }, + { + "user_id": "{{USER_ID_BY_TESTER}}", + "skill_id": "{{SKILL_ID_2}}", + "input": { + "certifierId": "POSTMANE2E-certifier_id updated 2" + }, + "expected": { + "certifierId": "POSTMANE2E-certifier_id updated 2" + }, + "httpCode": 200 + }, + { + "user_id": "{{USER_ID_BY_TESTER}}", + "skill_id": "{{SKILL_ID_2}}", + "input": { + "certifiedDate":"2020-11-04T07:36:28.036Z" + }, + "expected": { + "certifiedDate":"2020-11-04T07:36:28.036Z" + }, + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/user-skill/patch-user-skill-with-invalid-data.json b/test/postman/testData/user-skill/patch-user-skill-with-invalid-data.json new file mode 100644 index 0000000..0878d94 --- /dev/null +++ b/test/postman/testData/user-skill/patch-user-skill-with-invalid-data.json @@ -0,0 +1,54 @@ +[ + { + "user_id": "{{USER_ID_BY_TESTER}}", + "skill_id": "{{SKILL_ID_2}}", + "input": { + "metricValue": "" + }, + "httpCode": 400, + "message": "\"entity.metricValue\" is not allowed to be empty" + }, + { + "user_id": "{{USER_ID_BY_TESTER}}", + "skill_id": "{{SKILL_ID_2}}", + "input": { + "certifierId": "" + }, + "httpCode": 400, + "message": "\"entity.certifierId\" is not allowed to be empty" + }, + { + "user_id": "{{USER_ID_BY_TESTER}}", + "skill_id": "{{SKILL_ID_2}}", + "input": { + "certifiedDate": "" + }, + "httpCode": 400, + "message": "\"entity.certifiedDate\" must be a valid date" + }, + { + "user_id": "{{USER_ID_BY_TESTER}}", + "skill_id": "{{SKILL_ID_2}}", + "input": { + "ccc": "abc" + }, + "httpCode": 400, + "message": "\"entity.ccc\" is not allowed" + }, + { + "user_id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "skill_id": "{{SKILL_ID_2}}", + "input": { + }, + "httpCode": 404, + "message": "cannot find User where id = 3cd81b8c-d45e-414e-be66-afb31aa0240c" + }, + { + "user_id": "{{USER_ID_BY_TESTER}}", + "skill_id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "input": { + }, + "httpCode": 404, + "message": "cannot find Skill where id = 3cd81b8c-d45e-414e-be66-afb31aa0240c" + } +] \ No newline at end of file diff --git a/test/postman/testData/user-skill/patch-user-skill-with-invalid-tokens.json b/test/postman/testData/user-skill/patch-user-skill-with-invalid-tokens.json new file mode 100644 index 0000000..0c62ab7 --- /dev/null +++ b/test/postman/testData/user-skill/patch-user-skill-with-invalid-tokens.json @@ -0,0 +1,23 @@ +[ + { + "user_id": "{{USER_ID_BY_TESTER}}", + "skill_id": "{{SKILL_ID_2}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "user_id": "{{USER_ID_BY_TESTER}}", + "skill_id": "{{SKILL_ID_2}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "user_id": "{{USER_ID_BY_TESTER}}", + "skill_id": "{{SKILL_ID_2}}", + "jwtToken": "", + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/user-skill/search-user-skills-with-invalid-parameters.json b/test/postman/testData/user-skill/search-user-skills-with-invalid-parameters.json new file mode 100644 index 0000000..5a499c6 --- /dev/null +++ b/test/postman/testData/user-skill/search-user-skills-with-invalid-parameters.json @@ -0,0 +1,32 @@ +[ + { + "user_id": "{{USER_ID_1}}", + "input": "page=-1&perPage=10", + "httpCode": 400, + "message": "\"query.page\" must be larger than or equal to 1" + }, + { + "user_id": "{{USER_ID_1}}", + "input": "page=1&perPage=-10", + "httpCode": 400, + "message": "\"query.perPage\" must be larger than or equal to 1" + }, + { + "user_id": "{{USER_ID_1}}", + "input": "skillName=", + "httpCode": 400, + "message": "\"query.skillName\" is not allowed to be empty" + }, + { + "user_id": "{{USER_ID_1}}", + "input": "aa=cc", + "httpCode": 400, + "message": "\"query.aa\" is not allowed" + }, + { + "user_id": "3cd81b8c-d45e-414e-be66-afb31aa0240c", + "input": "", + "httpCode": 404, + "message": "cannot find User where id = 3cd81b8c-d45e-414e-be66-afb31aa0240c" + } +] \ No newline at end of file diff --git a/test/postman/testData/user-skill/search-user-skills-with-invalid-tokens.json b/test/postman/testData/user-skill/search-user-skills-with-invalid-tokens.json new file mode 100644 index 0000000..dc69184 --- /dev/null +++ b/test/postman/testData/user-skill/search-user-skills-with-invalid-tokens.json @@ -0,0 +1,20 @@ +[ + { + "user_id": "{{USER_ID_1}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "user_id": "{{USER_ID_1}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "user_id": "{{USER_ID_1}}", + "jwtToken": "", + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/user-skill/search-user-skills-with-various-parameters.json b/test/postman/testData/user-skill/search-user-skills-with-various-parameters.json new file mode 100644 index 0000000..64e9645 --- /dev/null +++ b/test/postman/testData/user-skill/search-user-skills-with-various-parameters.json @@ -0,0 +1,14 @@ +[ + { + "user_id": "{{USER_ID_1}}", + "input": "page=1&perPage=10&skillName=POSTMANE2E-Skill-1" + }, + { + "user_id": "{{USER_ID_1}}", + "input": "page=1&perPage=10" + }, + { + "user_id": "{{USER_ID_1}}", + "input": "skillName=POSTMANE2E-Skill-1" + } +] \ No newline at end of file diff --git a/test/postman/testData/user/create-user-by-admin.json b/test/postman/testData/user/create-user-by-admin.json new file mode 100644 index 0000000..ec619e7 --- /dev/null +++ b/test/postman/testData/user/create-user-by-admin.json @@ -0,0 +1,20 @@ +[ + { + "handle": "POSTMANE2E-handle01-by-admin", + "firstName": "POSTMANE2E-first01", + "lastName": "POSTMANE2E-last01", + "httpCode": 200 + }, + { + "handle": "POSTMANE2E-handle02-by-admin", + "firstName": "POSTMANE2E-first02", + "lastName": "POSTMANE2E-last02", + "httpCode": 200 + }, + { + "handle": "POSTMANE2E-handle03-by-admin", + "firstName": "POSTMANE2E-first03", + "lastName": "POSTMANE2E-last03", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/user/create-user-by-user.json b/test/postman/testData/user/create-user-by-user.json new file mode 100644 index 0000000..ac53d8c --- /dev/null +++ b/test/postman/testData/user/create-user-by-user.json @@ -0,0 +1,20 @@ +[ + { + "handle": "POSTMANE2E-handle01", + "firstName": "POSTMANE2E-first01", + "lastName": "POSTMANE2E-last01", + "httpCode": 200 + }, + { + "handle": "POSTMANE2E-handle02", + "firstName": "POSTMANE2E-first02", + "lastName": "POSTMANE2E-last02", + "httpCode": 200 + }, + { + "handle": "POSTMANE2E-handle03", + "firstName": "POSTMANE2E-first03", + "lastName": "POSTMANE2E-last03", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/user/create-user-with-invalid-data.json b/test/postman/testData/user/create-user-with-invalid-data.json new file mode 100644 index 0000000..61aec1d --- /dev/null +++ b/test/postman/testData/user/create-user-with-invalid-data.json @@ -0,0 +1,72 @@ +[ + { + "input": { + "firstName": "POSTMANE2E-firstName", + "lastName": "POSTMANE2E-lastName" + }, + "httpCode": 400, + "message": "\"entity.handle\" is required" + }, + { + "input": { + "handle": "", + "firstName": "POSTMANE2E-firstName", + "lastName": "POSTMANE2E-lastName" + }, + "httpCode": 400, + "message": "\"entity.handle\" is not allowed to be empty" + }, + { + "input": { + "handle": "POSTMANE2E-valid-handle", + "lastName": "POSTMANE2E-lastName" + }, + "httpCode": 400, + "message": "\"entity.firstName\" is required" + }, + { + "input": { + "handle": "POSTMANE2E-valid-handle", + "firstName": "", + "lastName": "POSTMANE2E-lastName" + }, + "httpCode": 400, + "message": "\"entity.firstName\" is not allowed to be empty" + }, + { + "input": { + "handle": "POSTMANE2E-valid-handle", + "firstName": "POSTMANE2E-firstName" + }, + "httpCode": 400, + "message": "\"entity.lastName\" is required" + }, + { + "input": { + "handle": "POSTMANE2E-valid-handle", + "firstName": "POSTMANE2E-firstName", + "lastName": "" + }, + "httpCode": 400, + "message": "\"entity.lastName\" is not allowed to be empty" + }, + { + "input": { + "handle": "POSTMANE2E-handle01", + "firstName": "POSTMANE2E-firstName", + "lastName": "POSTMANE2E-lastName" + }, + "httpCode": 409, + "message": "User already exists with handle:POSTMANE2E-handle01" + }, + { + "input": { + "handle": "POSTMANE2E-valid-handle", + "firstName": "POSTMANE2E-firstName", + "lastName": "POSTMANE2E-lastName", + "aaa":"ccc" + }, + "httpCode": 400, + "message": "\"entity.aaa\" is not allowed" + } +] \ No newline at end of file diff --git a/test/postman/testData/user/create-user-with-invalid-tokens.json b/test/postman/testData/user/create-user-with-invalid-tokens.json new file mode 100644 index 0000000..dc4c631 --- /dev/null +++ b/test/postman/testData/user/create-user-with-invalid-tokens.json @@ -0,0 +1,16 @@ +[ + { + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/user/delete-user-by-admin.json b/test/postman/testData/user/delete-user-by-admin.json new file mode 100644 index 0000000..72c1576 --- /dev/null +++ b/test/postman/testData/user/delete-user-by-admin.json @@ -0,0 +1,5 @@ +[ + { + "user_id": "f0df47fc-2b1f-44ad-bd38-1ada036ba4d9" + } +] \ No newline at end of file diff --git a/test/postman/testData/user/delete-user-with-invalid-tokens.json b/test/postman/testData/user/delete-user-with-invalid-tokens.json new file mode 100644 index 0000000..056af6a --- /dev/null +++ b/test/postman/testData/user/delete-user-with-invalid-tokens.json @@ -0,0 +1,25 @@ +[ + { + "user_id": "{{USER_ID_3}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "user_id": "{{USER_ID_3}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "user_id": "{{USER_ID_3}}", + "httpCode": 403, + "message": "No token provided." + }, + { + "user_id": "{{USER_ID_3}}", + "jwtToken": "Bearer {{user_token}}", + "httpCode": 403, + "message": "You are not allowed to perform this action" + } +] \ No newline at end of file diff --git a/test/postman/testData/user/get-user-by-admin.json b/test/postman/testData/user/get-user-by-admin.json new file mode 100644 index 0000000..47843e2 --- /dev/null +++ b/test/postman/testData/user/get-user-by-admin.json @@ -0,0 +1,17 @@ +[ + { + "user_id": "{{USER_ID_1}}", + "params": "enrich=true", + "httpCode": 200 + }, + { + "user_id": "{{USER_ID_2}}", + "params": "enrich=true", + "httpCode": 200 + }, + { + "user_id": "{{USER_ID_1}}", + "params": "", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/user/get-user-by-user.json b/test/postman/testData/user/get-user-by-user.json new file mode 100644 index 0000000..478e790 --- /dev/null +++ b/test/postman/testData/user/get-user-by-user.json @@ -0,0 +1,12 @@ +[ + { + "user_id": "{{USER_ID_BY_TESTER}}", + "params": "enrich=true", + "httpCode": 200 + }, + { + "user_id": "{{USER_ID_BY_TESTER}}", + "params": "", + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/user/get-user-with-invalid-parameters.json b/test/postman/testData/user/get-user-with-invalid-parameters.json new file mode 100644 index 0000000..3f65234 --- /dev/null +++ b/test/postman/testData/user/get-user-with-invalid-parameters.json @@ -0,0 +1,8 @@ +[ + { + "user_id": "not_exist_user", + "params": "enrich=true", + "httpCode": 500, + "message": "resource_not_found_exception" + } +] \ No newline at end of file diff --git a/test/postman/testData/user/get-user-with-invalid-tokens.json b/test/postman/testData/user/get-user-with-invalid-tokens.json new file mode 100644 index 0000000..e2690a3 --- /dev/null +++ b/test/postman/testData/user/get-user-with-invalid-tokens.json @@ -0,0 +1,23 @@ +[ + { + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "httpCode": 403, + "jwtToken": "", + "message": "No token provided." + }, + { + "user_id": "{{USER_ID_3}}", + "jwtToken": "Bearer {{user_token}}", + "httpCode": 500, + "message": "You are not allowed to perform this action" + } +] \ No newline at end of file diff --git a/test/postman/testData/user/patch-user-with-any-fields-by-admin.json b/test/postman/testData/user/patch-user-with-any-fields-by-admin.json new file mode 100644 index 0000000..d645a9b --- /dev/null +++ b/test/postman/testData/user/patch-user-with-any-fields-by-admin.json @@ -0,0 +1,82 @@ +[ + { + "user_id": "{{USER_ID_2}}", + "input": { + "handle": "POSTMANE2E-handle02-updated" + }, + "expected": { + "handle": "POSTMANE2E-handle02-updated" + }, + "httpCode": 200 + }, + { + "user_id": "{{USER_ID_2}}", + "input": { + "firstName": "POSTMANE2E-firstName02-updated" + }, + "expected": { + "firstName": "POSTMANE2E-firstName02-updated" + }, + "httpCode": 200 + }, + { + "user_id": "{{USER_ID_2}}", + "input": { + "lastName": "POSTMANE2E-lastName02-updated" + }, + "expected": { + "lastName": "POSTMANE2E-lastName02-updated" + }, + "httpCode": 200 + }, + { + "user_id": "{{USER_ID_2}}", + "input": { + "handle": "POSTMANE2E-handle02-updated1", + "firstName": "POSTMANE2E-firstName02-updated1" + }, + "expected": { + "handle": "POSTMANE2E-handle02-updated1", + "firstName": "POSTMANE2E-firstName02-updated1" + }, + "httpCode": 200 + }, + { + "user_id": "{{USER_ID_2}}", + "input": { + "handle": "POSTMANE2E-handle02-updated2", + "lastName": "POSTMANE2E-lastName02-updated2" + }, + "expected": { + "handle": "POSTMANE2E-handle02-updated2", + "lastName": "POSTMANE2E-lastName02-updated2" + }, + "httpCode": 200 + }, + { + "user_id": "{{USER_ID_2}}", + "input": { + "firstName": "POSTMANE2E-firstName02-updated3", + "lastName": "POSTMANE2E-lastName02-updated3" + }, + "expected": { + "firstName": "POSTMANE2E-firstName02-updated3", + "lastName": "POSTMANE2E-lastName02-updated3" + }, + "httpCode": 200 + }, + { + "user_id": "{{USER_ID_2}}", + "input": { + "handle": "POSTMANE2E-handle02-updated4", + "firstName": "POSTMANE2E-firstName02-updated4", + "lastName": "POSTMANE2E-lastName02-updated4" + }, + "expected": { + "handle": "POSTMANE2E-handle02-updated4", + "firstName": "POSTMANE2E-firstName02-updated4", + "lastName": "POSTMANE2E-lastName02-updated4" + }, + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/user/patch-user-with-any-fields-by-user.json b/test/postman/testData/user/patch-user-with-any-fields-by-user.json new file mode 100644 index 0000000..d02c09f --- /dev/null +++ b/test/postman/testData/user/patch-user-with-any-fields-by-user.json @@ -0,0 +1,82 @@ +[ + { + "user_id": "{{USER_ID_BY_TESTER}}", + "input": { + "handle": "POSTMANE2E-handle02-updated" + }, + "expected": { + "handle": "POSTMANE2E-handle02-updated" + }, + "httpCode": 200 + }, + { + "user_id": "{{USER_ID_BY_TESTER}}", + "input": { + "firstName": "POSTMANE2E-firstName02-updated" + }, + "expected": { + "firstName": "POSTMANE2E-firstName02-updated" + }, + "httpCode": 200 + }, + { + "user_id": "{{USER_ID_BY_TESTER}}", + "input": { + "lastName": "POSTMANE2E-lastName02-updated" + }, + "expected": { + "lastName": "POSTMANE2E-lastName02-updated" + }, + "httpCode": 200 + }, + { + "user_id": "{{USER_ID_BY_TESTER}}", + "input": { + "handle": "POSTMANE2E-handle02-updated1", + "firstName": "POSTMANE2E-firstName02-updated1" + }, + "expected": { + "handle": "POSTMANE2E-handle02-updated1", + "firstName": "POSTMANE2E-firstName02-updated1" + }, + "httpCode": 200 + }, + { + "user_id": "{{USER_ID_BY_TESTER}}", + "input": { + "handle": "POSTMANE2E-handle02-updated2", + "lastName": "POSTMANE2E-lastName02-updated2" + }, + "expected": { + "handle": "POSTMANE2E-handle02-updated2", + "lastName": "POSTMANE2E-lastName02-updated2" + }, + "httpCode": 200 + }, + { + "user_id": "{{USER_ID_BY_TESTER}}", + "input": { + "firstName": "POSTMANE2E-firstName02-updated3", + "lastName": "POSTMANE2E-lastName02-updated3" + }, + "expected": { + "firstName": "POSTMANE2E-firstName02-updated3", + "lastName": "POSTMANE2E-lastName02-updated3" + }, + "httpCode": 200 + }, + { + "user_id": "{{USER_ID_BY_TESTER}}", + "input": { + "handle": "POSTMANE2E-handle02-updated41", + "firstName": "POSTMANE2E-firstName02-updated4", + "lastName": "POSTMANE2E-lastName02-updated4" + }, + "expected": { + "handle": "POSTMANE2E-handle02-updated41", + "firstName": "POSTMANE2E-firstName02-updated4", + "lastName": "POSTMANE2E-lastName02-updated4" + }, + "httpCode": 200 + } +] \ No newline at end of file diff --git a/test/postman/testData/user/patch-user-with-invalid-data.json b/test/postman/testData/user/patch-user-with-invalid-data.json new file mode 100644 index 0000000..d873352 --- /dev/null +++ b/test/postman/testData/user/patch-user-with-invalid-data.json @@ -0,0 +1,42 @@ +[ + { + "user_id": "{{USER_ID_2}}", + "input": { + "handle": "" + }, + "httpCode": 400, + "message": "\"entity.handle\" is not allowed to be empty" + }, + { + "user_id": "{{USER_ID_2}}", + "input": { + "firstName": "" + }, + "httpCode": 400, + "message": "\"entity.firstName\" is not allowed to be empty" + }, + { + "user_id": "{{USER_ID_2}}", + "input": { + "lastName": "" + }, + "httpCode": 400, + "message": "\"entity.lastName\" is not allowed to be empty" + }, + { + "user_id": "{{USER_ID_2}}", + "input": { + "handle": "POSTMANE2E-handle03" + }, + "httpCode": 409, + "message": "User already exists with handle:POSTMANE2E-handle03" + }, + { + "terms_id": "{{TERMS_OF_USE_ID_2}}", + "input": { + "ccc": "abc" + }, + "httpCode": 400, + "message": "\"entity.ccc\" is not allowed" + } +] \ No newline at end of file diff --git a/test/postman/testData/user/patch-user-with-invalid-tokens.json b/test/postman/testData/user/patch-user-with-invalid-tokens.json new file mode 100644 index 0000000..62f918b --- /dev/null +++ b/test/postman/testData/user/patch-user-with-invalid-tokens.json @@ -0,0 +1,19 @@ +[ + { + "user_id": "{{USER_ID_2}}", + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "user_id": "{{USER_ID_2}}", + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "user_id": "{{USER_ID_2}}", + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/user/search-users-with-invalid-parameters.json b/test/postman/testData/user/search-users-with-invalid-parameters.json new file mode 100644 index 0000000..9ef8890 --- /dev/null +++ b/test/postman/testData/user/search-users-with-invalid-parameters.json @@ -0,0 +1,42 @@ +[ + { + "input": "page=-1&perPage=10", + "httpCode": 400, + "message": "\"query.page\" must be larger than or equal to 1" + }, + { + "input": "page=1&perPage=-10", + "httpCode": 400, + "message": "\"query.perPage\" must be larger than or equal to 1" + }, + { + "input": "handle=", + "httpCode": 400, + "message": "\"query.handle\" is not allowed to be empty" + }, + { + "input": "roleId=", + "httpCode": 400, + "message": "\"query.roleId\" is not allowed to be empty" + }, + { + "input": "enrich=aa", + "httpCode": 400, + "message": "\"query.enrich\" must be a boolean" + }, + { + "input": "externalProfile.externalId=", + "httpCode": 400, + "message": "\"query.externalProfile.externalId\" is not allowed to be empty" + }, + { + "input": "externalProfile.organizationId=", + "httpCode": 400, + "message": "\"query.externalProfile.organizationId\" is not allowed to be empty" + }, + { + "input": "aa=", + "httpCode": 400, + "message": "\"query.aa\" is not allowed" + } +] \ No newline at end of file diff --git a/test/postman/testData/user/search-users-with-invalid-tokens.json b/test/postman/testData/user/search-users-with-invalid-tokens.json new file mode 100644 index 0000000..f25a81a --- /dev/null +++ b/test/postman/testData/user/search-users-with-invalid-tokens.json @@ -0,0 +1,17 @@ +[ + { + "jwtToken": "Bearer invalid", + "httpCode": 403, + "message": "Invalid Token." + }, + { + "jwtToken": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiQ29ubmVjdCBTdXBwb3J0IiwiYWRtaW5pc3RyYXRvciIsInRlc3RSb2xlIiwiYWFhIiwidG9ueV90ZXN0XzEiLCJDb25uZWN0IE1hbmFnZXIiLCJDb25uZWN0IEFkbWluIiwiY29waWxvdCIsIkNvbm5lY3QgQ29waWxvdCBNYW5hZ2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJUb255SiIsImV4cCI6MTU1MTA2MzIxMSwidXNlcklkIjoiODU0Nzg5OSIsImlhdCI6MTU1MTA1MzIxMSwiZW1haWwiOiJ0amVmdHMrZml4QHRvcGNvZGVyLmNvbSIsImp0aSI6ImY5NGQxZTI2LTNkMGUtNDZjYS04MTE1LTg3NTQ1NDRhMDhmMSJ9.97-pjuSGGqDAqK2FG2yi_3nmzB7ZMXQwtG0bi8_PlKk", + "httpCode": 403, + "message": "Failed to authenticate token." + }, + { + "jwtToken": "", + "httpCode": 403, + "message": "No token provided." + } +] \ No newline at end of file diff --git a/test/postman/testData/user/search-users-with-various-parameters.json b/test/postman/testData/user/search-users-with-various-parameters.json new file mode 100644 index 0000000..955a170 --- /dev/null +++ b/test/postman/testData/user/search-users-with-various-parameters.json @@ -0,0 +1,32 @@ +[ + { + "input": "page=1&perPage=10&enrich=true" + }, + { + "input": "page=1&perPage=1" + }, + { + "input": "page=1&perPage=1&handle=POSTMANE2E-lazybaer", + "idLabel": "USER_ID_1" + }, + { + "input": "roleId=977d66bb-112f-49b1-8b20-2ef7a17f4943" + }, + { + "input": "enrich=true&externalProfile.externalId=8547899" + }, + { + "input": "enrich=true&externalProfile.organizationId=36ed815b-3da1-49f1-a043-aaed0a4e81ad" + }, + { + "input": "page=1&perPage=10&enrich=true&handle=POSTMANE2E-tc-Admin&roleId=977d66bb-112f-49b1-8b20-2ef7a17f4943&externalProfile.externalId=8547899&externalProfile.organizationId=36ed815b-3da1-49f1-a043-aaed0a4e81ad" + }, + { + "input": "handle=POSTMANE2E-Sylvan_Gorczany", + "idLabel": "USER_ID_2" + }, + { + "input": "handle=POSTMANE2E-Dana_Paucek6", + "idLabel": "USER_ID_3" + } +] \ No newline at end of file