|
| 1 | + |
| 2 | +GET http://localhost:9090/plugins/restapi/v1/groups |
| 3 | +Authorization: {{authkey}} |
| 4 | +HTTP 200 |
| 5 | +[Asserts] |
| 6 | +xpath "/groups[not(child::node())]" exists # groups at the root, with no child nodes |
| 7 | + |
| 8 | +POST http://localhost:9090/plugins/restapi/v1/groups |
| 9 | +Authorization: {{authkey}} |
| 10 | +Content-Type: application/xml |
| 11 | +``` |
| 12 | +<?xml version="1.0" encoding="UTF-8"?> |
| 13 | +<group> |
| 14 | + <name>group1</name> |
| 15 | + <description>test-group</description> |
| 16 | + <shared>false</shared> |
| 17 | + <admins> |
| 18 | + <admin>jane</admin> |
| 19 | + </admins> |
| 20 | + <members> |
| 21 | + <member>john</member> |
| 22 | + </members> |
| 23 | +</group> |
| 24 | +``` |
| 25 | +HTTP 201 |
| 26 | + |
| 27 | +GET http://localhost:9090/plugins/restapi/v1/groups # check if the group was created |
| 28 | +Authorization: {{authkey}} |
| 29 | +HTTP 200 |
| 30 | +[Asserts] |
| 31 | +xpath "/groups/group[name='group1']" exists |
| 32 | + |
| 33 | +GET http://localhost:9090/plugins/restapi/v1/groups/group1 |
| 34 | +Authorization: {{authkey}} |
| 35 | +HTTP 200 |
| 36 | +[Asserts] |
| 37 | +xpath "/group[name='group1']" exists |
| 38 | +xpath "string(/group/description)" == "test-group" |
| 39 | + |
| 40 | +PUT http://localhost:9090/plugins/restapi/v1/groups/group1 |
| 41 | +Authorization: {{authkey}} |
| 42 | +Content-Type: application/xml |
| 43 | +``` |
| 44 | +<?xml version="1.0" encoding="UTF-8"?> |
| 45 | +<group> |
| 46 | + <name>group1</name> |
| 47 | + <description>test-group-updated</description> |
| 48 | + <shared>false</shared> |
| 49 | + <admins> |
| 50 | + <admin>jane</admin> |
| 51 | + </admins> |
| 52 | + <members> |
| 53 | + <member>john</member> |
| 54 | + </members> |
| 55 | +</group> |
| 56 | +``` |
| 57 | +HTTP 200 |
| 58 | + |
| 59 | +GET http://localhost:9090/plugins/restapi/v1/groups/group1 |
| 60 | +Authorization: {{authkey}} |
| 61 | +HTTP 200 |
| 62 | +[Asserts] |
| 63 | +xpath "/group[name='group1']" exists |
| 64 | +xpath "string(/group/description)" == "test-group-updated" |
| 65 | + |
| 66 | +DELETE http://localhost:9090/plugins/restapi/v1/groups/group1 |
| 67 | +Authorization: {{authkey}} |
| 68 | +HTTP 200 |
| 69 | + |
0 commit comments