Skip to content

Commit f8066ac

Browse files
committed
OD-17176 feat: replace get endpoint of entity api with post getAll endpoint into api tests
1 parent e32631d commit f8066ac

File tree

53 files changed

+346
-186
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+346
-186
lines changed

api-test/src/test/resources/ish/oncourse/api/test/checkout/fullPaymentCycle.feature

+4-4
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,15 @@ Feature: re-usable feature to performance of full payment cycle and delete all o
108108

109109
Given path ishPathList
110110
And param entity = 'Outcome'
111-
And param search = 'enrolment.id == ' + enrolmentId
112-
When method GET
111+
And request {search: '#("enrolment.id == " +enrolmentId)'}
112+
When method POST
113113
Then status 200
114114
And match karate.sizeOf(response.rows) == outcomesCount
115115

116116
Given path ishPathList
117117
And param entity = 'Course'
118-
And param search = 'courseClasses.id == ' + classId
119-
When method GET
118+
And request {search: '#("courseClasses.id == " +classId)'}
119+
When method POST
120120
Then status 200
121121
And def courseId = response.rows[0].id
122122

api-test/src/test/resources/ish/oncourse/api/test/list/entity/account/delete.feature

+6-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ Feature: Main feature for all DELETE requests with path 'list/entity/account'
3232

3333
Given path ishPathList
3434
And param entity = 'Account'
35-
When method GET
35+
And request {}
36+
When method POST
3637
Then status 200
3738

3839
* def id = get[0] response.rows[?(@.values == ["code100","true","asset","some descriptions"])].id
@@ -71,7 +72,8 @@ Feature: Main feature for all DELETE requests with path 'list/entity/account'
7172

7273
Given path ishPathList
7374
And param entity = 'Account'
74-
When method GET
75+
And request {}
76+
When method POST
7577
Then status 200
7678

7779
* def id = get[0] response.rows[?(@.values == ["code101","true","asset","some descriptions"])].id
@@ -119,7 +121,8 @@ Feature: Main feature for all DELETE requests with path 'list/entity/account'
119121

120122
Given path ishPathList
121123
And param entity = 'Account'
122-
When method GET
124+
And request {}
125+
When method POST
123126
Then status 200
124127

125128
* def id = get[0] response.rows[?(@.values == ["code102","true","asset","some descriptions"])].id

api-test/src/test/resources/ish/oncourse/api/test/list/entity/account/get.feature

+6-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ Feature: Main feature for all GET requests with path 'list/entity/account'
1515

1616
Given path ishPathList
1717
And param entity = 'Account'
18-
When method GET
18+
And request {}
19+
When method POST
1920
Then status 200
2021
And match $.rows[*].id contains ["1","2","3","4","5","6","7","8","9","10","11","12"]
2122

@@ -35,7 +36,8 @@ Feature: Main feature for all GET requests with path 'list/entity/account'
3536

3637
Given path ishPathList
3738
And param entity = 'Account'
38-
When method GET
39+
And request {}
40+
When method POST
3941
Then status 200
4042
And match $.rows[*].id contains ["1","2","3","4","5","6","7","8","9","10","11","12"]
4143

@@ -115,7 +117,8 @@ Feature: Main feature for all GET requests with path 'list/entity/account'
115117

116118
Given path ishPathList
117119
And param entity = 'Account'
118-
When method GET
120+
And request {}
121+
When method POST
119122
Then status 403
120123
And match $.errorMessage == "Sorry, you have no permissions to view this entity. Please contact your administrator"
121124

api-test/src/test/resources/ish/oncourse/api/test/list/entity/account/post.feature

+6-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ Feature: Main feature for all POST requests with path 'list/entity/account'
3131

3232
Given path ishPathList
3333
And param entity = 'Account'
34-
When method GET
34+
And request {}
35+
When method POST
3536
Then status 200
3637

3738
* def id = get[0] response.rows[?(@.values == ["code1","true","income","some descriptions"])].id
@@ -88,7 +89,8 @@ Feature: Main feature for all POST requests with path 'list/entity/account'
8889

8990
Given path ishPathList
9091
And param entity = 'Account'
91-
When method GET
92+
And request {}
93+
When method POST
9294
Then status 200
9395

9496
* def id = get[0] response.rows[?(@.values == ["code2","false","asset","some descriptions"])].id
@@ -139,7 +141,8 @@ Feature: Main feature for all POST requests with path 'list/entity/account'
139141

140142
Given path ishPathList
141143
And param entity = 'Account'
142-
When method GET
144+
And request {}
145+
When method POST
143146
Then status 200
144147

145148
* def id = get[0] response.rows[?(@.values == ["A3A5A7A9A12A15A18A21A24A27A30A33A36A39A4","true","asset","A3A5A7A9A12A15A18A21A24A27A30A33A36A39A42A45A48A51A54A57A60A63A66A69A72A75A78A81A84A87A90A93A96A100A104A108A112A116A120A124A128A132A136A140A144A148A152A156A160A164A168A172A176A180A184A188A192A196A200A204A208A212A216A220A224A228A232A236A240A244A248A252A256A260A264A268A272A276A280A284A288A292A296A300A304A308A312A316A320A324A328A332A336A340A344A348A352A356A360A364A368A372A376A380A384A388A392A396A400A404A408A412A416A420A424A428A432A436A440A444A448A452A456A460A464A468A472A476A480A484A488A492A496A500A"])].id

api-test/src/test/resources/ish/oncourse/api/test/list/entity/account/put.feature

+14-7
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ Feature: Main feature for all PUT requests with path 'list/entity/account'
3131

3232
Given path ishPathList
3333
And param entity = 'Account'
34-
When method GET
34+
And request {}
35+
When method POST
3536
Then status 200
3637

3738
* def id = get[0] response.rows[?(@.values == ["code1000","true","asset","some descriptions_1000"])].id
@@ -86,7 +87,8 @@ Feature: Main feature for all PUT requests with path 'list/entity/account'
8687

8788
Given path ishPathList
8889
And param entity = 'Account'
89-
When method GET
90+
And request {}
91+
When method POST
9092
Then status 200
9193

9294
* def id = get[0] response.rows[?(@.values == ["code1001","true","asset","some descriptions_1001"])].id
@@ -159,7 +161,8 @@ Feature: Main feature for all PUT requests with path 'list/entity/account'
159161

160162
Given path ishPathList
161163
And param entity = 'Account'
162-
When method GET
164+
And request {}
165+
When method POST
163166
Then status 200
164167

165168
* def id = get[0] response.rows[?(@.values == ["code1002","true","asset","some descriptions_1002"])].id
@@ -227,7 +230,8 @@ Feature: Main feature for all PUT requests with path 'list/entity/account'
227230

228231
Given path ishPathList
229232
And param entity = 'Account'
230-
When method GET
233+
And request {}
234+
When method POST
231235
Then status 200
232236

233237
* def id = get[0] response.rows[?(@.values == ["code1003","true","asset","some descriptions_1003"])].id
@@ -314,7 +318,8 @@ Feature: Main feature for all PUT requests with path 'list/entity/account'
314318

315319
Given path ishPathList
316320
And param entity = 'Account'
317-
When method GET
321+
And request {}
322+
When method POST
318323
Then status 200
319324

320325
* def id = get[0] response.rows[?(@.values == ["code1004","true","asset","some descriptions_1004"])].id
@@ -365,7 +370,8 @@ Feature: Main feature for all PUT requests with path 'list/entity/account'
365370

366371
Given path ishPathList
367372
And param entity = 'Account'
368-
When method GET
373+
And request {}
374+
When method POST
369375
Then status 200
370376

371377
* def id = get[0] response.rows[?(@.values == ["code1005","true","asset","some descriptions_1005"])].id
@@ -416,7 +422,8 @@ Feature: Main feature for all PUT requests with path 'list/entity/account'
416422

417423
Given path ishPathList
418424
And param entity = 'Account'
419-
When method GET
425+
And request {}
426+
When method POST
420427
Then status 200
421428

422429
* def id = get[0] response.rows[?(@.values == ["code1006","true","asset","some descriptions_1006"])].id

api-test/src/test/resources/ish/oncourse/api/test/list/entity/accountTransaction/get.feature

+6-5
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ Feature: Main feature for all GET requests with path 'list/entity/accountTransac
1414
Scenario: (+) Get list of all account transactions by admin
1515

1616
Given path ishPathList
17-
And param pageSize = 1000
1817
And param entity = 'AccountTransaction'
19-
When method GET
18+
And request {pageSize: 1000}
19+
When method pOST
2020
Then status 200
2121
And match $.rows[*].id contains ["104","103","102","101","28","27","26","25","24","23","22","21","20","19","18","17","16","15","14","13","12","11","10","9","8","7","6","5","4","3","2","1","118","117","116","115","114","113","112","111","110","109","108","107","106","105","208","207","206","205"]
2222

@@ -27,9 +27,9 @@ Feature: Main feature for all GET requests with path 'list/entity/accountTransac
2727
* configure headers = { Authorization: 'UserWithRightsView' }
2828

2929
Given path ishPathList
30-
And param pageSize = 1000
3130
And param entity = 'AccountTransaction'
32-
When method GET
31+
And request {pageSize: 1000}
32+
When method POST
3333
Then status 200
3434
And match $.rows[*].id contains ["104","103","102","101","28","27","26","25","24","23","22","21","20","19","18","17","16","15","14","13","12","11","10","9","8","7","6","5","4","3","2","1","118","117","116","115","114","113","112","111","110","109","108","107","106","105","208","207","206","205"]
3535

@@ -61,7 +61,8 @@ Feature: Main feature for all GET requests with path 'list/entity/accountTransac
6161

6262
Given path ishPathList
6363
And param entity = 'AccountTransaction'
64-
When method GET
64+
And request {}
65+
When method POST
6566
Then status 403
6667
And match $.errorMessage == "Sorry, you have no permissions to view this entity. Please contact your administrator"
6768

api-test/src/test/resources/ish/oncourse/api/test/list/entity/application/get.feature

+5-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ Feature: Main feature for all GET requests with path 'list/entity/application'
1515

1616
Given path ishPathList
1717
And param entity = 'Application'
18-
When method GET
18+
And request {}
19+
When method POST
1920
Then status 200
2021
And match $.rows[*].id contains ["1000"]
2122

@@ -72,7 +73,8 @@ Feature: Main feature for all GET requests with path 'list/entity/application'
7273

7374
Given path ishPathList
7475
And param entity = 'Application'
75-
When method GET
76+
And request {}
77+
When method POST
7678
Then status 200
7779
And match $.rows[*].id contains ["1000"]
7880

@@ -132,7 +134,7 @@ Feature: Main feature for all GET requests with path 'list/entity/application'
132134

133135
Given path ishPathList
134136
And param entity = 'Application'
135-
When method GET
137+
When method POST
136138
Then status 403
137139
And match $.errorMessage == "Sorry, you have no permissions to view this entity. Please contact your administrator"
138140

api-test/src/test/resources/ish/oncourse/api/test/list/entity/articleProduct/get.feature

+4-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ Feature: Main feature for all GET requests with path 'list/entity/articleProduct
1515

1616
Given path ishPathList
1717
And param entity = 'ArticleProduct'
18-
When method GET
18+
And request {}
19+
When method POST
1920
Then status 200
2021
And match $.rows[*].id contains ["1001"]
2122

@@ -31,7 +32,8 @@ Feature: Main feature for all GET requests with path 'list/entity/articleProduct
3132

3233
Given path ishPathList
3334
And param entity = 'ArticleProduct'
34-
When method GET
35+
And request {}
36+
When method POST
3537
Then status 200
3638
And match $.rows[*].id contains ["1001"]
3739

api-test/src/test/resources/ish/oncourse/api/test/list/entity/assessment/get.feature

+4-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ Feature: Main feature for all GET requests with path 'list/entity/assessment'
1515

1616
Given path ishPathList
1717
And param entity = 'Assessment'
18-
When method GET
18+
And request {}
19+
When method POST
1920
Then status 200
2021
And match $.rows[*].id contains ["1000","1001"]
2122

@@ -61,7 +62,8 @@ Feature: Main feature for all GET requests with path 'list/entity/assessment'
6162

6263
Given path ishPathList
6364
And param entity = 'Assessment'
64-
When method GET
65+
And request {}
66+
When method POST
6567
Then status 200
6668
And match $.rows[*].id contains ["1000","1001"]
6769

api-test/src/test/resources/ish/oncourse/api/test/list/entity/audit/get.feature

+13-13
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ Feature: Main feature for all GET requests with path 'list/entity/audit'
1515

1616
Given path ishPathList
1717
And param entity = 'Audit'
18-
And param search = "id in ( 1, 2, 3 )"
19-
When method GET
18+
And request {search: 'id in ( 1, 2, 3 )'}
19+
When method POST
2020
Then status 200
2121
And match $.rows[*].id contains ["3","2","1"]
2222

@@ -47,17 +47,17 @@ Feature: Main feature for all GET requests with path 'list/entity/audit'
4747
Given path '/logout'
4848
And request {}
4949
When method PUT
50-
50+
5151
# <---> Login as notadmin
5252
* configure headers = { Authorization: 'UserWithRightsView'}
5353

54-
54+
5555
# <--->
5656

5757
Given path ishPathList
5858
And param entity = 'Audit'
59-
And param search = "id in ( 1, 2, 3 )"
60-
When method GET
59+
And request {search: 'id in ( 1, 2, 3 )'}
60+
When method POST
6161
Then status 200
6262
And match $.rows[*].id contains ["3","2","1"]
6363

@@ -68,11 +68,11 @@ Feature: Main feature for all GET requests with path 'list/entity/audit'
6868
Given path '/logout'
6969
And request {}
7070
When method PUT
71-
71+
7272
# <---> Login as notadmin
7373
* configure headers = { Authorization: 'UserWithRightsView'}
7474

75-
75+
7676
# <--->
7777

7878
Given path ishPath + '/2'
@@ -98,16 +98,16 @@ Feature: Main feature for all GET requests with path 'list/entity/audit'
9898
Given path '/logout'
9999
And request {}
100100
When method PUT
101-
101+
102102
# <---> Login as notadmin
103103
* configure headers = { Authorization: 'UserWithRightsHide'}
104104

105-
105+
106106
# <--->
107107

108108
Given path ishPathList
109109
And param entity = 'Audit'
110-
When method GET
110+
When method POST
111111
Then status 403
112112
And match $.errorMessage == "Sorry, you have no permissions to view this entity. Please contact your administrator"
113113

@@ -118,11 +118,11 @@ Feature: Main feature for all GET requests with path 'list/entity/audit'
118118
Given path '/logout'
119119
And request {}
120120
When method PUT
121-
121+
122122
# <---> Login as notadmin
123123
* configure headers = { Authorization: 'UserWithRightsHide'}
124124

125-
125+
126126
# <--->
127127

128128
Given path ishPath + '/1'

api-test/src/test/resources/ish/oncourse/api/test/list/entity/banking/get.feature

+6-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ Feature: Main feature for all GET requests with path 'list/entity/banking'
1515

1616
Given path ishPathList
1717
And param entity = 'Banking'
18-
When method GET
18+
And request {}
19+
When method POST
1920
Then status 200
2021
And match $.rows[*].id contains ["1000","1001"]
2122

@@ -31,7 +32,8 @@ Feature: Main feature for all GET requests with path 'list/entity/banking'
3132

3233
Given path ishPathList
3334
And param entity = 'Banking'
34-
When method GET
35+
And request {}
36+
When method POST
3537
Then status 200
3638
And match $.rows[*].id contains ["1000","1001"]
3739

@@ -107,7 +109,8 @@ Feature: Main feature for all GET requests with path 'list/entity/banking'
107109

108110
Given path ishPathList
109111
And param entity = 'Banking'
110-
When method GET
112+
And request {}
113+
When method POST
111114
Then status 403
112115
And match $.errorMessage == "Sorry, you have no permissions to view this entity. Please contact your administrator"
113116

0 commit comments

Comments
 (0)