/
AccountGroupService.feature
129 lines (114 loc) · 5.62 KB
/
AccountGroupService.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
###############################################################################
# Copyright (c) 2020, 2022 Eurotech and/or its affiliates and others
#
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# Eurotech - initial API and implementation
###############################################################################
@account
@group
@integration
Feature: Account Group Service Integration Tests
Scenario: Init Security Context for all scenarios
Given Init Security Context
Scenario: Creating Groups Under Account That Allows Infinite Child Groups
Login as kapua-sys, create an account
Configure GroupService of that account, set infiniteChildGroups to true and maxNumberChildGroups to 0
Create a few groups
No exception should be thrown
Given I login as user with name "kapua-sys" and password "kapua-password"
Then I create an account with name "acc1", organization name "acc1" and email address "acc1@org.com"
And I configure the group service
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 0 |
Then I select account "acc1"
And I create a group with name "Group1"
And I create a group with name "Group2"
Then No exception was thrown
And I logout
Scenario: Creating Groups Under Account That Has Limited Child Groups
Login as kapua-sys, create an account
Configure GroupService of that account, set infiniteChildGroups to false and maxNumberChildGroups to 3
Create a few groups
Only 3 Groups should be created, creating more will throw an Exception
Given I login as user with name "kapua-sys" and password "kapua-password"
Then I create an account with name "acc1", organization name "acc1" and email address "acc1@org.com"
And I configure the group service
| type | name | value |
| boolean | infiniteChildEntities | false |
| integer | maxNumberChildEntities | 3 |
Then I select account "acc1"
And I create a group with name "Group1"
And I create a group with name "Group2"
And I create a group with name "Group3"
Given I expect the exception "KapuaMaxNumberOfItemsReachedException" with the text "*"
And I create a group with name "Group4"
Then An exception was thrown
And I logout
Scenario: Creating Groups Under Account That Does Not Allow Groups
Login as kapua-sys, create an account
Configure GroupService of that account, set infiniteChildGroups to false and maxNumberChildGroups to 0
Try to create a group
Exception should be thrown
Given I login as user with name "kapua-sys" and password "kapua-password"
Then I create an account with name "acc1", organization name "acc1" and email address "acc1@org.com"
And I configure the group service
| type | name | value |
| boolean | infiniteChildEntities | false |
| integer | maxNumberChildEntities | 0 |
Then I select account "acc1"
Given I expect the exception "KapuaMaxNumberOfItemsReachedException" with the text "*"
And I create a group with name "Group1"
Then An exception was thrown
And I logout
Scenario: Creating Groups And Than Setting Group Service So It Does Not Allow Groups
Login as kapua-sys, create an account
Configure GroupService of that account, set infiniteChildGroups to true
Create a few Groups
Configure GroupService of that account, set infiniteChildGroups to false
Exception should be thrown
Given I login as user with name "kapua-sys" and password "kapua-password"
Then I create an account with name "acc1", organization name "acc1" and email address "acc1@org.com"
And I configure the group service
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 0 |
Then I select account "acc1"
And I create a group with name "Group1"
And I create a group with name "Group2"
Given I expect the exception "ServiceConfigurationLimitExceededException" with the text "*"
And I configure the group service
| type | name | value |
| boolean | infiniteChildEntities | false |
| integer | maxNumberChildEntities | 0 |
Then An exception was thrown
And I logout
Scenario: Creating Groups And Then Changing InfiniteChildGroups To False And Set MaxNumberChildGroups
Login as kapua-sys, create an account
Configure GroupService of that account, set infiniteChildGroups to true
Create 2 Groups
Configure GroupService of that account, set infiniteChildGroups to false and maxNumberChildGroups to 2
No exception should be thrown
Given I login as user with name "kapua-sys" and password "kapua-password"
Then I create an account with name "acc1", organization name "acc1" and email address "acc1@org.com"
And I configure the group service
| type | name | value |
| boolean | infiniteChildEntities | true |
| integer | maxNumberChildEntities | 0 |
Then I select account "acc1"
And I create a group with name "Group1"
And I create a group with name "Group2"
And I configure the group service
| type | name | value |
| boolean | infiniteChildEntities | false |
| integer | maxNumberChildEntities | 2 |
Then No exception was thrown
And I logout
Scenario: Reset Security Context for all scenarios
Given Reset Security Context