Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

mpa-8170 update and implement tests for org service #106

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
4c45c60
grammar to api doc
PavloPetrina Mar 7, 2019
a1b167c
add the description for API key filtering
PavloPetrina Mar 13, 2019
fe21b39
updated the error responses
PavloPetrina Mar 13, 2019
0fad6ac
- updated TC-s#47 (deleteApiKey) & #53 (inviteMember)
PavloPetrina Mar 14, 2019
1e03736
- added TC#45 (fail to deleteApiKey)
PavloPetrina Mar 14, 2019
934eef5
- updated grammar
PavloPetrina Mar 14, 2019
4f5a623
- updated error responses for non-existing org and null for org creat…
PavloPetrina Mar 20, 2019
46648b4
- new update for error responses for non-existing org and null for or…
PavloPetrina Mar 20, 2019
1d85b00
updated TC#53 Scenario definition
PavloPetrina Mar 21, 2019
73e8798
filtering for api keys update
PavloPetrina Apr 16, 2019
158def6
added #4.1 & 5.2 - missed keys for name and email of related Org
PavloPetrina Apr 17, 2019
95504ec
Merge remote-tracking branch 'origin/develop' into mpa-8170-Update-Im…
PavloPetrina Apr 17, 2019
e0f8aa5
re-numerated TC-s
PavloPetrina Apr 22, 2019
99b703d
updated delete api key TC
PavloPetrina May 15, 2019
8771e70
Merge remote-tracking branch 'origin/develop' into mpa-8170-Update-Im…
PavloPetrina May 20, 2019
e566a52
updated TC#32 - new error message
PavloPetrina May 20, 2019
3c6da8e
removed old versions of changes
PavloPetrina May 20, 2019
b41c25e
updated responses for leave kick-out when the user is not a member
PavloPetrina May 21, 2019
6d14a6d
Merge remote-tracking branch 'origin/develop' into mpa-8170-Update-Im…
PavloPetrina May 21, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,10 @@ Feature: Organization service API keys management - Add API key
When this user requested to add some API key for some Organization
Then this user should receive the error message: "Token verification failed"


#MPA-8170 (#42.1)
Scenario: Fail to add the API key (token) for a non-existent Organization
Given the user "A" have got a valid "token" issued by relevant authority
When the user "A" requested to add the API key "name" for "non-existent" organizationId
Then user "A" should receive the error message: "Organization [id=non-existent] not found"

Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,26 @@ Feature: Organization service API keys management - Delete API key

#__________________________________________________NEGATIVE___________________________________________________________

/**
*
*##MPA-7603 (#45) - TBD if Admin could delete the API key assigned with "owner" role?
*#Scenario: Fail to delete the API key (token) with "owner" role from relevant Organization by Admin
*# Given the user "A" have got a valid "token" issued by relevant authority
*# And only single organization "organizationId" with specified "name" and "email" already created and owned by user "A"
*# And the user "A" requested to add the API key "name" for own organization with assigned role "owner"
*# And the user "B" who have got the "userId" issued by relevant authority was invited to user's "A" organization with an "admin" role
*# When the user "B" requested to delete the API key "name" from user's "A" organization with assigned role "owner"
*# Then user "B" should get an error message: "user: 'userId "B"', name: 'null', not in role Owner of organization: 'org "A" name'"
*/

#MPA-7603 (#44.1)
Scenario: Fail to delete the API key (token) with "owner" role from relevant Organization by Admin
Given the user "A" have got a valid "token" issued by relevant authority
And only single organization "organizationId" with specified "name" and "email" already created and owned by user "A"
And the user "A" requested to add the API key "name" for own organization with assigned role "owner"
And the user "B" who have got the "userId" issued by relevant authority was invited to user's "A" organization with an "admin" role
When the user "B" requested to delete the API key "name" from user's "A" organization with assigned role "owner"
Then user "B" should get an error message: "user: 'userId "B"', name: 'null', not in role Owner of organization: 'org "A" name'"


#MPA-8170 (#45)
Scenario: Fail to delete some of accessible API keys (token) from relevant Organization upon the owner was removed from own Organization
Given the user "A" have got a valid "token" issued by relevant authority
And only single organization "organizationId" with specified "name" and "email" already created and owned by user "A"
And the user "A" added API key "specifiedApiKeyName" for own organization with assigned role "owner"
And the user "B" who have got the "userId" issued by relevant authority was invited to user's "A" organization with an "owner" role
And the user "A" was removed from user's "A" organization
When the user "A" requested to delete the API key "specifiedApiKeyName" from his former organization
Then user "A" should get an error message: "user: 'userId "B"', name: 'null', not in role Owner or Admin of organization: 'org "A" name'"


#MPA-7603 (#46)
Expand All @@ -64,9 +73,8 @@ Feature: Organization service API keys management - Delete API key
Scenario: Fail to delete non-existent (invalid) API key (token) from specific Organization
Given the user "A" have got a valid "token" issued by relevant authority
And only single organization "organizationId" with specified "name" and "email" already created and owned by user "A"
And the user "A" requested to add the API key "name" for own organization with assigned role "member"
When the user "A" requested to delete the non-existent API key "someKey" from user's "A" organization
Then user "A" should get successful response with extended organization info which include the API key with "member" role only
When the user "A" requested to delete the non-existent API key "someKey" name from user's "A" organization
Then user "A" should receive the error message: "Key 'someKey' doesn't exist"


#MPA-7603 (#48)
Expand All @@ -75,5 +83,12 @@ Feature: Organization service API keys management - Delete API key
When this user requested to delete some API key "name" in some Organization
Then this user should receive the error message: "Token verification failed"


#MPA-8170 (#48.1)
Scenario: Fail to delete the API key (token) from non-existent Organization
Given the user "A" have got a valid "token" issued by relevant authority
When the user "A" requested to delete some API key "name" from "non-existent" organizationId
Then user "A" should receive the error message: "Organization [id=non-existent] not found"



Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ Feature: Organization service Org management - Get Organization
Scenario: Fail to get a non-existent Organization info
Given the user "A" have got a valid "token" issued by relevant authority
And there is no organization "organizationId" was created and stored
When the user "A" requested to get the non-existent organization "organizationId" info
Then user "A" should receive the error message: "Organization [id="organizationId"] not found"
When the user "A" requested to get the "non-existent" organizationId info
Then user "A" should receive the error message: "Organization [id=non-existent] not found"


#MPA-7603 (#18)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,20 @@ Feature: Organization service Org management - Leave Organization
Then user "A" should should receive the error message:"At least one Owner should be persisted in the organization: 'org A id'"


#MPA-7603 (#32) - should we return an error like " is not a "member" of organization" instead of empty object?
#MPA-7603 (#32)
Scenario: Fail to leave the Organization upon the user wasn't invited to any of the relevant Organizations
Given each of the users "A" and "B" have got personal valid "token" issued by relevant authority
And only single organization "organizationId" with specified "name" and "email" already created and owned by user "A"
When the user "B" requested to leave the user's "A" organization
Then the user "B" should receive successful response with empty object
Then the user "B" should receive the error message: "user: 'userId-B' is not a member of organization: ORG-ID


#MPA-7603 (#33)
Scenario: Fail to leave a non-existent Organization
Given the user "A" have got a valid "token" issued by relevant authority
And there is no organization "organizationId" was created and stored
When the user "A" requested to leave the non-existent organization "organizationId"
Then user "A" should receive the error message with non-existent: "organizationId"
When the user "A" requested to leave the "non-existent" organizationId
Then user "A" should receive the error message: "Organization [id=non-existent] not found"


#MPA-7603 (#34)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ Feature: Organization service Org management - Update Organization
Scenario: Fail to update the non-existent Organization
Given the user "A" have got a valid "token" issued by relevant authority
And there is no organization "organizationId" was created and stored
When the user "A" requested to update the non-existent organization "organizationId" with some "name" or "email"
Then user "A" should receive the error message with non-existent: "organizationId"
When the user "A" requested to update the "non-existent" organizationId with some "name" or "email"
Then user "A" should receive the error message: "Organization [id=non-existent] not found"


#MPA-7603 (#26)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Feature: Creation of the Organization

#CREATE ORG

#__________________________________________________POSITIVE___________________________________________________________

#MPA-7657 (#1)
Scenario: Successful creation of the Organization
Given the user "A" have got a valid "token" issued by relevant authority
Expand All @@ -15,6 +17,8 @@ Feature: Creation of the Organization
And "secret" for the relevant organization should be stored in Vault


#__________________________________________________NEGATIVE___________________________________________________________

#MPA-7657 (#2)
Scenario: Fail to create the Organization if the token is invalid (expired)
Given a user have got the invalid either expired "token"
Expand All @@ -31,10 +35,41 @@ Feature: Creation of the Organization


#MPA-7657 (#4)
Scenario: Fail to create the Organization without email
Scenario: Fail to create the Organization without email either undefined email (i.e. null)
Given the user "A" have got a valid "token" issued by relevant authority
When user "A" requested to create the organization with following details
| name | email |
| Org-1 | |
| Org-1 | null |
Then for each request user "A" should get an error message: "Please specify an Organization email"


#MPA-7657 (#4.1)
Scenario: Fail to create the Organization upon the "email" key is missed
Given the user "A" have got a valid "token" issued by relevant authority
When user "A" requested to create the organization without "email" key at all
| name |
| Org-1 |
Then the user "A" should get an error message: "Please specify an Organization email"


#MPA-7657 (#4.2)
Scenario: Fail to create the Organization without name either undefined name (i.e. null)
Given the user "A" have got a valid "token" issued by relevant authority
When user "A" requested to create the organization with following details
| name | email |
| | [email protected] |
| null | [email protected] |
Then for each request user "A" should get an error message: "Please specify an Organization name"


#MPA-7657 (#4.3)
Scenario: Fail to create the Organization upon the "name" key is missed
Given the user "A" have got a valid "token" issued by relevant authority
When user "A" requested to create the organization with specified non-existent "name" but without "empty" email
Then user "A" should get an error message: "Organization email cannot be empty"
When user "A" requested to create the organization without "name" key at all
| email |
| [email protected] |
Then the user "A" should get an error message: "Please specify an Organization name"


#MPA-7657 (#5)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Feature: Delete of the Organization

#DELETE ORG

#__________________________________________________POSITIVE___________________________________________________________

#MPA-7657 (#6)
Scenario: Successful delete of specific Organization
Given the user "A" have got a valid "token" issued by relevant authority
Expand All @@ -29,6 +31,8 @@ Feature: Delete of the Organization
And the relevant secret should be deleted from the Vault


#__________________________________________________NEGATIVE___________________________________________________________

#MPA-7657 (#8)
Scenario: Fail to delete a specific Organization upon the origin owner was removed from own Organization
Given the user "A" have got a valid "token" issued by relevant authority
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,26 @@ Feature: Organization service members management - Invite member


#MPA-7679 (#53)
Scenario: Ignore to invite the existent "member" (duplicate) to the same Organization
Scenario: Fail to invite the existent "member" (duplicate) to the same Organization with the new role "Admin"
Given the user "A" have got a valid "token" issued by relevant authority
And only single organization "organizationId" with specified "name" and "email" already created and owned by this user "A"
And the user "B" who have got the "userId" issued by relevant authority was invited to user's "A" organization with a "member" role
When the user "A" requested to invite the existent user "B" to step into organization of user's "A" again with an "admin" role
Then the user "B" shouldn't be duplicated as the existent member in the user's "A" organization thus ignored by the system
And user "A" should get successful response with the empty object
Then the user "B" shouldn't be duplicated as the existent member in the user's "A" organization
And user "A" should get an error message:"user:'id@clients' already exists"


#__________________________________________________NEGATIVE___________________________________________________________

#MPA-8170 (#54)
Scenario: Fail to invite the user with invalid role to specific Organization
Given the user "A" have got a valid "token" issued by relevant authority
And only single organization "organizationId" with specified "name" and "email" already created and owned by this user "A"
And the user "B" who have got the "userId" issued by relevant authority
When the user "A" requested to invite the user "B" to step into organization of user's "A" with invalid "Boss" role
Then user "A" should get an error message:"Role 'Boss' is invalid"


#MPA-7679 (#55)
Scenario: Fail to invite the user into relevant Organization upon the existing member (requester) got "member" role permission level
Given the user "A" have got a valid "token" issued by relevant authority
Expand Down Expand Up @@ -98,3 +107,10 @@ Feature: Organization service members management - Invite member
Given a user "D" have got the invalid either expired "token"
When user "D" requested to invite some another user to step into some organization with some role
Then user "D" should receive the error message: "Token verification failed"


#MPA-8170 (#58.1)
Scenario: Fail to invite the user to non-existent Organization
Given the user "A" have got a valid "token" issued by relevant authority
When user "A" requested to invite some user to step into "non-existent" organizationId with some role
Then user "A" should receive the error message: "Organization [id=non-existent] not found"
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Feature: Organization service members management - Kick-out member


/**
* ##MPA-7679 (#65) - API key permission level is updated to "member" role upon the related manager was removed from organization
* ##MPA-7679 (#65) - API key permission level is updated to "member" role upon the related manager (Owner) was removed from organization
* #Scenario: Admin API key (token) for relevant Organization is downgraded to "member" one upon the issuer (Owner) of that API key was removed from Organization
* #Given the user "A" have got a valid "token" issued by relevant authority
* #And only single organization "organizationId" with specified "name" and "email" already created and owned by user "A"
Expand All @@ -90,7 +90,7 @@ Feature: Organization service members management - Kick-out member
* #And the API key with assigned role "member" should be persisted for the relevant organization
*
*
* ##MPA-7679 (#66) - API key permission level is updated to "member" role upon the related manager was removed from organization
* ##MPA-7679 (#65.a) - API key permission level is updated to "member" role upon the related manager (Admin) was removed from organization
* #Scenario: Admin API key (token) for relevant Organization is downgraded to "member" one upon the issuer (Admin) of that API key was removed from Organization
* #Given the user "A" have got a valid "token" issued by relevant authority
* #And only single organization "organizationId" with specified "name" and "email" already created and owned by user "A"
Expand All @@ -105,6 +105,14 @@ Feature: Organization service members management - Kick-out member

#__________________________________________________NEGATIVE___________________________________________________________

#MPA-8170 (#66)
Scenario: Fail to kick-out non-existent "member" from some Organization
Given the user "A" have got a valid "token" issued by relevant authority
And only single organization "organizationId" with specified "name" and "email" already created and owned by this user "A"
When the user "A" requested to remove the non-existent user "non-existent-id@clients" from own organization
Then user "A" should get an error message:"user: 'userId' is not a member of organization: ORG-ID"


#MPA-7679 (#67)
Scenario: Fail to kick-out (remove) yourself as the single "owner" from relevant Organization
Given the user "A" have got a valid "token" issued by relevant authority
Expand Down Expand Up @@ -146,3 +154,10 @@ Feature: Organization service members management - Kick-out member
Given a user "D" have got the invalid either expired "token"
When user "D" requested to remove some user from some organization
Then user "D" should receive the error message: "Token verification failed"


#MPA-8170 (#71.1)
Scenario: Fail to remove the user from non-existent Organization
Given the user "A" have got a valid "token" issued by relevant authority
When user "A" requested to remove some user from "non-existent" organizationId
Then user "A" should receive the error message: "Organization [id=non-existent] not found"
Loading