Skip to content

Commit

Permalink
Fixed test after bacport of #3849
Browse files Browse the repository at this point in the history
Signed-off-by: Alberto Codutti <alberto.codutti@eurotech.com>
  • Loading branch information
Coduz committed Sep 14, 2023
1 parent c650b27 commit a0e3109
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 100 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@

@RunWith(CucumberWithProperties.class)
@CucumberOptions(
features = { "classpath:features/authorization/AccessInfoService.feature",
features = {
"classpath:features/authorization/AccessInfoService.feature",
"classpath:features/authorization/DomainService.feature",
"classpath:features/authorization/GroupService.feature",
"classpath:features/authorization/MiscAuthorization.feature",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ Scenario: Init Security Context for all scenarios
| name | displayName | email | phoneNumber |
| kapua-u1 | Kapua User 1 | kapua_u1@kapua.com | +386 31 323 555 |
And I create the domain
| name | actions |
| test | read,write, execute |
| name | actions | serviceName |
| test | read,write, execute | test |
And The permissions "read, write, execute"
When I create the access info entity
Then No exception was thrown
Expand All @@ -82,8 +82,8 @@ Scenario: Init Security Context for all scenarios
| name | displayName | email | phoneNumber |
| kapua-u1 | Kapua User 1 | kapua_u1@kapua.com | +386 31 323 555 |
And I create the domain
| name | actions |
| test | read,write, execute |
| name | actions | serviceName |
| test | read,write, execute | test |
And The permissions "read, write, execute"
And The role "test_role_1"
When I create the access info entity
Expand All @@ -110,8 +110,8 @@ Scenario: Init Security Context for all scenarios
| name | displayName | email | phoneNumber |
| kapua-u1 | Kapua User 1 | kapua_u1@kapua.com | +386 31 323 555 |
And I create the domain
| name | actions |
| test | read,write, execute |
| name | actions | serviceName |
| test | read,write, execute | test |
And The permissions "read, write, execute"
And An invalid role ID
Given I expect the exception "KapuaAuthorizationException" with the text "Error: Role not found in the scope"
Expand Down Expand Up @@ -213,8 +213,8 @@ Scenario: Init Security Context for all scenarios
| name | displayName | email | phoneNumber |
| kapua-u1 | Kapua User 1 | kapua_u1@kapua.com | +386 31 323 555 |
And I create the domain
| name | actions |
| test | read,write, execute |
| name | actions | serviceName |
| test | read,write, execute | test |
And The permissions "read, write, execute"
And The role "test_role_1"
And I create the access info entity
Expand Down Expand Up @@ -359,8 +359,8 @@ Scenario: Init Security Context for all scenarios

When I login as user with name "kapua-sys" and password "kapua-password"
Given I create the domain
| name | actions |
| test | read,write, execute |
| name | actions | serviceName |
| test | read,write, execute | test |
Given Scope with ID 10
When I configure the user service for the account with the id 10
| type | name | value |
Expand Down Expand Up @@ -402,8 +402,8 @@ Scenario: Init Security Context for all scenarios
| name | displayName | email | phoneNumber |
| kapua-u1 | Kapua User 1 | kapua_u1@kapua.com | +386 31 323 555 |
And I create the domain
| name | actions |
| test | read,write, execute |
| name | actions | serviceName |
| test | read,write, execute | test |
When I create the access info entity
And The permissions "read, write, execute"
And I create the permissions
Expand All @@ -424,8 +424,8 @@ Scenario: Init Security Context for all scenarios
| name | displayName | email | phoneNumber |
| kapua-u1 | Kapua User 1 | kapua_u1@kapua.com | +386 31 323 555 |
And I create the domain
| name | actions |
| test | read,write, execute |
| name | actions | serviceName |
| test | read,write, execute | test |
When I create the access info entity
And The permissions "read, write, execute"
And I create the permissions
Expand All @@ -450,8 +450,8 @@ Scenario: Init Security Context for all scenarios
| name | displayName | email | phoneNumber |
| kapua-u1 | Kapua User 1 | kapua_u1@kapua.com | +386 31 323 555 |
And I create the domain
| name | actions |
| test | read,write, execute |
| name | actions | serviceName |
| test | read,write, execute | test |
When I create the access info entity
And The permission "read"
And I create the permission
Expand All @@ -476,8 +476,8 @@ Scenario: Init Security Context for all scenarios
| name | displayName | email | phoneNumber |
| kapua-u1 | Kapua User 1 | kapua_u1@kapua.com | +386 31 323 555 |
And I create the domain
| name | actions |
| test | read,write, execute |
| name | actions | serviceName |
| test | read,write, execute | test |
When I create the access info entity
Then No exception was thrown
Given The permissions "read, write, execute"
Expand All @@ -501,8 +501,8 @@ Scenario: Init Security Context for all scenarios
| name | displayName | email | phoneNumber |
| kapua-u1 | Kapua User 1 | kapua_u1@kapua.com | +386 31 323 555 |
And I create the domain
| name | actions |
| test | read,write, execute |
| name | actions | serviceName |
| test | read,write, execute | test |
When I create the access info entity
And The permissions "read, write, execute"
And The role "test_role_1"
Expand All @@ -524,8 +524,8 @@ Scenario: Init Security Context for all scenarios
| name | displayName | email | phoneNumber |
| kapua-u1 | Kapua User 1 | kapua_u1@kapua.com | +386 31 323 555 |
And I create the domain
| name | actions |
| test | read,write, execute |
| name | actions | serviceName |
| test | read,write, execute | test |
When I create the access info entity
And The permissions "read, write, execute"
And The role "test_role_1"
Expand All @@ -547,8 +547,8 @@ Scenario: Init Security Context for all scenarios
| name | displayName | email | phoneNumber |
| kapua-u1 | Kapua User 1 | kapua_u1@kapua.com | +386 31 323 555 |
And I create the domain
| name | actions |
| test | read,write, execute |
| name | actions | serviceName |
| test | read,write, execute | test |
When I create the access info entity
And The permissions "read, write, execute"
And The role "test_role_1"
Expand All @@ -569,8 +569,8 @@ Scenario: Init Security Context for all scenarios
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
And I create the domain
| name | actions |
| test | read,write, execute |
| name | actions | serviceName |
| test | read,write, execute | test |
And I have the following user
| name | displayName | email | phoneNumber |
| kapua-u1 | Kapua User 1 | kapua_u1@kapua.com | +386 31 323 555 |
Expand Down Expand Up @@ -631,8 +631,8 @@ Scenario: Init Security Context for all scenarios
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
And I create the domain
| name | actions |
| test | read,write, execute |
| name | actions | serviceName |
| test | read,write, execute | test |
And I have the following user
| name | displayName | email | phoneNumber |
| kapua-u1 | Kapua User 1 | kapua_u1@kapua.com | +386 31 323 555 |
Expand Down Expand Up @@ -668,8 +668,8 @@ Scenario: Init Security Context for all scenarios
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
And I create the domain
| name | actions |
| test | read,write, execute |
| name | actions | serviceName |
| test | read,write, execute | test |
And I have the following user
| name | displayName | email | phoneNumber |
| kapua-u1 | Kapua User 1 | kapua_u1@kapua.com | +386 31 323 555 |
Expand All @@ -693,8 +693,8 @@ Scenario: Init Security Context for all scenarios
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 5 |
And I create the domain
| name | actions |
| test | read,write, execute |
| name | actions | serviceName |
| test | read,write, execute | test |
And I have the following user
| name | displayName | email | phoneNumber |
| kapua-u1 | Kapua User 1 | kapua_u1@kapua.com | +386 31 323 555 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ Scenario: Init Security Context for all scenarios

When I login as user with name "kapua-sys" and password "kapua-password"
Given I create the domain
| name | actions |
| test_name_1 | read,write |
| name | actions | serviceName |
| test_name_1 | read,write | test |
Then A domain was created
And The domain matches the creator

Expand All @@ -45,8 +45,8 @@ Scenario: Init Security Context for all scenarios
When I login as user with name "kapua-sys" and password "kapua-password"
Given I expect the exception "KapuaIllegalNullArgumentException" with the text "An illegal null value was provided"
When I create the domain
| actions |
| read,write |
| actions | serviceName |
| read,write | test |
Then An exception was thrown

Scenario: Domain with null actions
Expand All @@ -56,8 +56,8 @@ Scenario: Init Security Context for all scenarios
When I login as user with name "kapua-sys" and password "kapua-password"
Given I expect the exception "KapuaIllegalNullArgumentException" with the text "An illegal null value was provided"
When I create the domain
| name |
| test_name_1 |
| name | serviceName |
| test_name_1 | test |
Then An exception was thrown

Scenario: Domains with duplicate names
Expand All @@ -66,23 +66,23 @@ Scenario: Init Security Context for all scenarios

When I login as user with name "kapua-sys" and password "kapua-password"
Given I create the domain
| name | actions |
| test_name_1 | read,write |
| name | actions | serviceName |
| test_name_1 | read,write | test |
Then A domain was created
And The domain matches the creator
Given I expect the exception "KapuaException" with the text "Error during Persistence Operation"
When I create the domain
| name | actions |
| test_name_1 | read,write |
| name | actions | serviceName |
| test_name_1 | read,write | test |
Then An exception was thrown

Scenario: Find the last created domain entry
It must be possible to find a dmain entry based on its unique ID.

When I login as user with name "kapua-sys" and password "kapua-password"
Given I create the domain
| name | actions |
| test_name_2 | read,execute |
| name | actions | serviceName |
| test_name_2 | read,execute | test |
When I search for the last created domain
Then The domain matches the creator

Expand All @@ -98,8 +98,8 @@ Scenario: Init Security Context for all scenarios

When I login as user with name "kapua-sys" and password "kapua-password"
Given I create the domain
| name | actions |
| test_name_2 | read,execute |
| name | actions | serviceName |
| test_name_2 | read,execute | test |
When I search for the last created domain
Then The domain matches the creator
When I delete the last created domain
Expand All @@ -122,10 +122,10 @@ Scenario: Init Security Context for all scenarios
When I count the domain entries in the database
Then This is the initial count
Given I create the domains
| name | actions |
| test_name_1 | read,write |
| test_name_2 | read,execute |
| test_name_3 | write,delete |
| name | actions | serviceName |
| test_name_1 | read,write | test |
| test_name_2 | read,execute | test |
| test_name_3 | write,delete | test |
When I count the domain entries in the database
Then 3 more domains were created

Expand All @@ -134,10 +134,10 @@ Scenario: Init Security Context for all scenarios

When I login as user with name "kapua-sys" and password "kapua-password"
Given I create the domains
| name | actions |
| test_name_1 | read,write |
| test_name_2 | read,execute |
| test_name_3 | write,delete |
| name | actions | serviceName |
| test_name_1 | read,write | test |
| test_name_2 | read,execute | test |
| test_name_3 | write,delete | test |
When I query for domains with the name "test_name_2"
Then I count 1

Expand Down
Loading

0 comments on commit a0e3109

Please sign in to comment.