diff --git a/scalecube-organization/src/test/resources/features/mpa-7603-Organization-service-Add-Api-Key.feature b/scalecube-organization/src/test/resources/features/mpa-7603-Organization-service-Add-Api-Key.feature index 5c0ef7c..f902a5d 100644 --- a/scalecube-organization/src/test/resources/features/mpa-7603-Organization-service-Add-Api-Key.feature +++ b/scalecube-organization/src/test/resources/features/mpa-7603-Organization-service-Add-Api-Key.feature @@ -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" + diff --git a/scalecube-organization/src/test/resources/features/mpa-7603-Organization-service-Delete-Api-Key.feature b/scalecube-organization/src/test/resources/features/mpa-7603-Organization-service-Delete-Api-Key.feature index c8bbd89..f83c915 100644 --- a/scalecube-organization/src/test/resources/features/mpa-7603-Organization-service-Delete-Api-Key.feature +++ b/scalecube-organization/src/test/resources/features/mpa-7603-Organization-service-Delete-Api-Key.feature @@ -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) @@ -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) @@ -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" + diff --git a/scalecube-organization/src/test/resources/features/mpa-7603-Organization-service-Get-Organization.feature b/scalecube-organization/src/test/resources/features/mpa-7603-Organization-service-Get-Organization.feature index 4bead46..a05dd21 100644 --- a/scalecube-organization/src/test/resources/features/mpa-7603-Organization-service-Get-Organization.feature +++ b/scalecube-organization/src/test/resources/features/mpa-7603-Organization-service-Get-Organization.feature @@ -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) diff --git a/scalecube-organization/src/test/resources/features/mpa-7603-Organization-service-Leave-Organization.feature b/scalecube-organization/src/test/resources/features/mpa-7603-Organization-service-Leave-Organization.feature index f705d54..1117ad1 100644 --- a/scalecube-organization/src/test/resources/features/mpa-7603-Organization-service-Leave-Organization.feature +++ b/scalecube-organization/src/test/resources/features/mpa-7603-Organization-service-Leave-Organization.feature @@ -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) diff --git a/scalecube-organization/src/test/resources/features/mpa-7603-Organization-service-Update-Organization.feature b/scalecube-organization/src/test/resources/features/mpa-7603-Organization-service-Update-Organization.feature index 584883d..9765cc0 100644 --- a/scalecube-organization/src/test/resources/features/mpa-7603-Organization-service-Update-Organization.feature +++ b/scalecube-organization/src/test/resources/features/mpa-7603-Organization-service-Update-Organization.feature @@ -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) diff --git a/scalecube-organization/src/test/resources/features/mpa-7657-Create-organization.feature b/scalecube-organization/src/test/resources/features/mpa-7657-Create-organization.feature index 95f25ed..7fd5d71 100644 --- a/scalecube-organization/src/test/resources/features/mpa-7657-Create-organization.feature +++ b/scalecube-organization/src/test/resources/features/mpa-7657-Create-organization.feature @@ -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 @@ -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" @@ -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 | + | | my@email.com | + | null | some@email.com | + 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 | + | my@email.com | + Then the user "A" should get an error message: "Please specify an Organization name" #MPA-7657 (#5) diff --git a/scalecube-organization/src/test/resources/features/mpa-7657-Delete-organization.feature b/scalecube-organization/src/test/resources/features/mpa-7657-Delete-organization.feature index e5b01e0..7068693 100644 --- a/scalecube-organization/src/test/resources/features/mpa-7657-Delete-organization.feature +++ b/scalecube-organization/src/test/resources/features/mpa-7657-Delete-organization.feature @@ -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 @@ -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 diff --git a/scalecube-organization/src/test/resources/features/mpa-7679-Organization-service-Invite-Member.feature b/scalecube-organization/src/test/resources/features/mpa-7679-Organization-service-Invite-Member.feature index 5cc8c5e..a87f44f 100644 --- a/scalecube-organization/src/test/resources/features/mpa-7679-Organization-service-Invite-Member.feature +++ b/scalecube-organization/src/test/resources/features/mpa-7679-Organization-service-Invite-Member.feature @@ -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 @@ -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" diff --git a/scalecube-organization/src/test/resources/features/mpa-7679-Organization-service-Kick-out-Member.feature b/scalecube-organization/src/test/resources/features/mpa-7679-Organization-service-Kick-out-Member.feature index d3d213f..9a7b0fc 100644 --- a/scalecube-organization/src/test/resources/features/mpa-7679-Organization-service-Kick-out-Member.feature +++ b/scalecube-organization/src/test/resources/features/mpa-7679-Organization-service-Kick-out-Member.feature @@ -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" @@ -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" @@ -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 @@ -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" diff --git a/scalecube-organization/src/test/resources/features/mpa-7679-Organization-service-Update-Member-Role.feature b/scalecube-organization/src/test/resources/features/mpa-7679-Organization-service-Update-Member-Role.feature index 1af36e4..cd4a3bf 100644 --- a/scalecube-organization/src/test/resources/features/mpa-7679-Organization-service-Update-Member-Role.feature +++ b/scalecube-organization/src/test/resources/features/mpa-7679-Organization-service-Update-Member-Role.feature @@ -169,7 +169,7 @@ Feature: Organization service members management - Update member role * # And the API keys with assigned roles: "admin" and "admin" should be persisted for the relevant organization - * ##MPA-7679 (#86) + * ##MPA-7679 (#85.a) * #Scenario: Permission level of the "member" and "admin" API keys (token) successfully upgraded to "owner" API keys upon the Organization "admin" was promoted to "owner" again * # 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" @@ -185,6 +185,15 @@ Feature: Organization service members management - Update member role #__________________________________________________NEGATIVE___________________________________________________________ + #MPA-8170 (#86) + Scenario: Fail to update the existing Member valid role to invalid role in the 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 was invited to user's "A" organization with a "member" role + When the user "A" requested to update user's "B" role "member" to invalid role "Boss" in the own organization + Then user "A" should get an error message:"Role 'Boss' is invalid" + + #MPA-7679 (#87) Scenario: Fail to downgrade yourself as the single "owner" to "member" either "admin" role in the relevant Organization Given the user "A" have got a valid "token" issued by relevant authority @@ -193,7 +202,6 @@ Feature: Organization service members management - Update member role Then user "A" should get an error message: "At least one Owner should be persisted in the organization: 'organizationId'" - #MPA-7679 (#88) Scenario: Fail to upgrade a "member" either "admin" to "owner" role in the relevant Organization by the "admin" Given the user "A" have got a valid "token" issued by relevant authority @@ -204,7 +212,6 @@ Feature: Organization service members management - Update member role Then user "C" for both requests should get an error message: ""user: 'userId "C"', name: 'null', role: 'Admin' cannot promote to a higher role: 'Owner'" - #MPA-7679 (#89) Scenario: Fail to update any accessible member role in the relevant Organization by the "member" Given the user "A" have got a valid "token" issued by relevant authority @@ -231,3 +238,10 @@ Feature: Organization service members management - Update member role Given a user "D" have got the invalid either expired "token" When the user "D" requested to update the some user role in some organization Then user "D" should receive the error message: "Token verification failed" + + + #MPA-8170 (#91.1) + Scenario: Fail to update some member role in the non-existent Organization + Given the user "A" have got a valid "token" issued by relevant authority + When user "A" requested to update some user's role in the "non-existent" organizationId + Then user "A" should receive the error message: "Organization [id=non-existent] not found"