Skip to content

Commit

Permalink
chore(): fix postman tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tcompiegne committed Jun 21, 2021
1 parent a627395 commit e6a3aff
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 144 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ public Single<User> update(String id, User updateUser) {
if (rowsUpdated == 0) {
return Single.error(new UserNotFoundException(id));
}
((DefaultUser) updateUser).setId(id);
return Single.just(updateUser);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@
"",
"pm.test(\"UM - create user - username invalid\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.message).to.eql(\"[£Invalid: invalid username]\");",
" pm.expect(jsonData.message).to.eql(\"Username [£Invalid] is not a valid value\");",
"});"
],
"type": "text/javascript"
Expand Down Expand Up @@ -1197,7 +1197,7 @@
"",
"pm.test(\"UM - create user - first name invalid\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.message).to.eql(\"[#Invalid: invalid first name]\");",
" pm.expect(jsonData.message).to.eql(\"First name [#Invalid] is not a valid value\");",
"});"
],
"type": "text/javascript"
Expand Down Expand Up @@ -1256,7 +1256,7 @@
"",
"pm.test(\"UM - create user - last name invalid\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.message).to.eql(\"[#Invalid: invalid last name]\");",
" pm.expect(jsonData.message).to.eql(\"Last name [#Invalid] is not a valid value\");",
"});"
],
"type": "text/javascript"
Expand Down Expand Up @@ -1433,7 +1433,7 @@
"",
"pm.test(\"UM - create user - external id too long\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.message).to.eql(\"[Tooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo long: must not be greater than 100]\");",
" pm.expect(jsonData.message).to.eql(\"External id [Tooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo long] is not a valid value\");",
"});"
],
"type": "text/javascript"
Expand Down Expand Up @@ -2087,7 +2087,7 @@
"",
"pm.test(\"UM - create user - first name invalid\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.message).to.eql(\"[#Invalid: invalid first name]\");",
" pm.expect(jsonData.message).to.eql(\"First name [#Invalid] is not a valid value\");",
"});"
],
"type": "text/javascript"
Expand Down Expand Up @@ -2147,7 +2147,7 @@
"",
"pm.test(\"UM - create user - last name invalid\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.message).to.eql(\"[#Invalid: invalid last name]\");",
" pm.expect(jsonData.message).to.eql(\"Last name [#Invalid] is not a valid value\");",
"});"
],
"type": "text/javascript"
Expand Down Expand Up @@ -2253,66 +2253,6 @@
},
"response": []
},
{
"name": "Invalid request - external id too long",
"event": [
{
"listen": "test",
"script": {
"id": "56ffba4f-b70a-452d-a063-8c3865594fd4",
"exec": [
"pm.test(\"Status code is 400\", function () {",
" pm.response.to.have.status(400);",
"});",
"",
"pm.test(\"UM - create user - external id too long\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.message).to.eql(\"[Tooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo long: must not be greater than 100]\");",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "PUT",
"header": [
{
"key": "Authorization",
"type": "text",
"value": "Bearer {{token}}"
},
{
"key": "Content-Type",
"name": "Content-Type",
"type": "text",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n\t\"firstName\": \"Jensen\",\n\t\"lastName\": \"Barbara\",\n\t\"email\": \"jensen.barbara@mail.com\",\n\t\"externalId\": \"Tooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo long\"\n}"
},
"url": {
"raw": "{{management_url}}/management/organizations/{{defaultOrganizationId}}/environments/{{defaultEnvironmentId}}/domains/{{domain}}/users/{{userUM}}",
"host": [
"{{management_url}}"
],
"path": [
"management",
"organizations",
"{{defaultOrganizationId}}",
"environments",
"{{defaultEnvironmentId}}",
"domains",
"{{domain}}",
"users",
"{{userUM}}"
]
}
},
"response": []
},
{
"name": "Update user",
"event": [
Expand Down Expand Up @@ -4489,4 +4429,4 @@
}
],
"protocolProfileBehavior": {}
}
}
94 changes: 17 additions & 77 deletions postman/collections/graviteeio-am-user-management-collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@
"",
"pm.test(\"UM - create user - username invalid\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.message).to.eql(\"[£Invalid: invalid username]\");",
" pm.expect(jsonData.message).to.eql(\"Username [£Invalid] is not a valid value\");",
"});"
],
"type": "text/javascript"
Expand Down Expand Up @@ -1197,7 +1197,7 @@
"",
"pm.test(\"UM - create user - first name invalid\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.message).to.eql(\"[#Invalid: invalid first name]\");",
" pm.expect(jsonData.message).to.eql(\"First name [#Invalid] is not a valid value\");",
"});"
],
"type": "text/javascript"
Expand All @@ -1221,7 +1221,7 @@
],
"body": {
"mode": "raw",
"raw": "{\n\t\"firstName\": \"#Invalid\",\n\t\"lastName\": \"Barbara\",\n\t\"username\": \"jensen.barbara\",\n\t\"email\": \"jensen.barbara@mail.com\",\n\t\"password\": \"password\"\n}"
"raw": "{\n\t\"firstName\": \"#Invalid\",\n\t\"lastName\": \"Barbara\",\n\t\"username\": \"jensen.barbara\",\n\t\"email\": \"jensen.barbara@mail.com\",\n\t\"password\": \"#CoMpL3X-P@SsW0Rd\"\n}"
},
"url": {
"raw": "{{management_url}}/management/organizations/{{defaultOrganizationId}}/environments/{{defaultEnvironmentId}}/domains/{{domain}}/users",
Expand Down Expand Up @@ -1256,7 +1256,7 @@
"",
"pm.test(\"UM - create user - last name invalid\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.message).to.eql(\"[#Invalid: invalid last name]\");",
" pm.expect(jsonData.message).to.eql(\"Last name [#Invalid] is not a valid value\");",
"});"
],
"type": "text/javascript"
Expand All @@ -1280,7 +1280,7 @@
],
"body": {
"mode": "raw",
"raw": "{\n\t\"firstName\": \"Jensen\",\n\t\"lastName\": \"#Invalid\",\n\t\"username\": \"jensen.barbara\",\n\t\"email\": \"jensen.barbara@mail.com\",\n\t\"password\": \"password\"\n}"
"raw": "{\n\t\"firstName\": \"Jensen\",\n\t\"lastName\": \"#Invalid\",\n\t\"username\": \"jensen.barbara\",\n\t\"email\": \"jensen.barbara@mail.com\",\n\t\"password\": \"#CoMpL3X-P@SsW0Rd\"\n}"
},
"url": {
"raw": "{{management_url}}/management/organizations/{{defaultOrganizationId}}/environments/{{defaultEnvironmentId}}/domains/{{domain}}/users",
Expand Down Expand Up @@ -1433,7 +1433,7 @@
"",
"pm.test(\"UM - create user - external id too long\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.message).to.eql(\"[Tooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo long: must not be greater than 100]\");",
" pm.expect(jsonData.message).to.eql(\"External id [Tooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo long] is not a valid value\");",
"});"
],
"type": "text/javascript"
Expand Down Expand Up @@ -2089,7 +2089,7 @@
"",
"pm.test(\"UM - create user - first name invalid\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.message).to.eql(\"[#Invalid: invalid first name]\");",
" pm.expect(jsonData.message).to.eql(\"First name [#Invalid] is not a valid value\");",
"});"
],
"type": "text/javascript"
Expand Down Expand Up @@ -2149,7 +2149,7 @@
"",
"pm.test(\"UM - create user - last name invalid\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.message).to.eql(\"[#Invalid: invalid last name]\");",
" pm.expect(jsonData.message).to.eql(\"Last name [#Invalid] is not a valid value\");",
"});"
],
"type": "text/javascript"
Expand Down Expand Up @@ -2255,66 +2255,6 @@
},
"response": []
},
{
"name": "Invalid request - external id too long",
"event": [
{
"listen": "test",
"script": {
"id": "56ffba4f-b70a-452d-a063-8c3865594fd4",
"exec": [
"pm.test(\"Status code is 400\", function () {",
" pm.response.to.have.status(400);",
"});",
"",
"pm.test(\"UM - create user - external id too long\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.message).to.eql(\"[Tooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo long: must not be greater than 100]\");",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "PUT",
"header": [
{
"key": "Authorization",
"type": "text",
"value": "Bearer {{token}}"
},
{
"key": "Content-Type",
"name": "Content-Type",
"type": "text",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n\t\"firstName\": \"Jensen\",\n\t\"lastName\": \"Barbara\",\n\t\"email\": \"jensen.barbara@mail.com\",\n\t\"externalId\": \"Tooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo long\"\n}"
},
"url": {
"raw": "{{management_url}}/management/organizations/{{defaultOrganizationId}}/environments/{{defaultEnvironmentId}}/domains/{{domain}}/users/{{userUM}}",
"host": [
"{{management_url}}"
],
"path": [
"management",
"organizations",
"{{defaultOrganizationId}}",
"environments",
"{{defaultEnvironmentId}}",
"domains",
"{{domain}}",
"users",
"{{userUM}}"
]
}
},
"response": []
},
{
"name": "Update user",
"event": [
Expand Down Expand Up @@ -3731,8 +3671,8 @@
"type": "text"
},
{
"key": "password",
"value": "#CoMpL3X-P@SsW0Rd",
"key": "password",
"value": "#CoMpL3X-P@SsW0Rd",
"type": "text"
}
]
Expand Down Expand Up @@ -3870,8 +3810,8 @@
"type": "text"
},
{
"key": "password",
"value": "#CoMpL3X-P@SsW0Rd",
"key": "password",
"value": "#CoMpL3X-P@SsW0Rd",
"type": "text"
}
]
Expand Down Expand Up @@ -3999,8 +3939,8 @@
"type": "text"
},
{
"key": "password",
"value": "#CoMpL3X-P@SsW0Rd",
"key": "password",
"value": "#CoMpL3X-P@SsW0Rd",
"type": "text"
}
]
Expand Down Expand Up @@ -4355,8 +4295,8 @@
"type": "text"
},
{
"key": "password",
"value": "#CoMpL3X-P@SsW0Rd",
"key": "password",
"value": "#CoMpL3X-P@SsW0Rd",
"type": "text"
}
]
Expand Down Expand Up @@ -4429,4 +4369,4 @@
}
],
"protocolProfileBehavior": {}
}
}

0 comments on commit e6a3aff

Please sign in to comment.