|
|
@@ -0,0 +1,83 @@ |
|
|
|
[ |
|
|
|
{ |
|
|
|
"comment": "activate service, create account, login for block_delete", |
|
|
|
"include": "new_account", |
|
|
|
"params": { |
|
|
|
"username": "user-to-partially-delete", |
|
|
|
"password": "foobar1!", |
|
|
|
"email": "user-partially-account-deletion@example.com", |
|
|
|
"verifyEmail": "true" |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
"comment": "look up account policy for block_delete", |
|
|
|
"request": { "uri": "users/{{user.uuid}}/policy" }, |
|
|
|
"response": { |
|
|
|
"store": "policy", |
|
|
|
"check": [ |
|
|
|
{"condition": "json.getAccountContacts() != null"}, |
|
|
|
{"condition": "json.getAccountContacts().length == 1"} |
|
|
|
] |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
"comment": "set deletion policy to block_delete", |
|
|
|
"request": { |
|
|
|
"uri": "users/{{user.uuid}}/policy", |
|
|
|
"data": "policy", |
|
|
|
"entity": { |
|
|
|
"deletionPolicy": "block_delete" |
|
|
|
} |
|
|
|
}, |
|
|
|
"response": { |
|
|
|
"store": "policy", |
|
|
|
"check": [ |
|
|
|
{"condition": "json.getDeletionPolicy().name() == 'block_delete'"} |
|
|
|
] |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
"comment": "as root, block delete account", |
|
|
|
"request": { |
|
|
|
"session": "rootSession", |
|
|
|
"uri": "users/{{user.uuid}}", |
|
|
|
"method": "delete" |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
"comment": "lookup user, expect that it is still there, just empty", |
|
|
|
"request": { "uri": "users/{{user.uuid}}" }, |
|
|
|
"response": { |
|
|
|
"check": [ |
|
|
|
{ "condition": "json.getUuid() == user.getUuid()" }, |
|
|
|
{ "condition": "json.getName() == user.getName()" }, |
|
|
|
{ "condition": "json.deleted()" } |
|
|
|
] |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
"comment": "try logging in as deleted user - failing now", |
|
|
|
"request": { |
|
|
|
"session": "new", |
|
|
|
"uri": "auth/login", |
|
|
|
"entity": { |
|
|
|
"name": "{{user.name}}", |
|
|
|
"password": "foobar1!" |
|
|
|
} |
|
|
|
}, |
|
|
|
"response": { "status": 404 } |
|
|
|
} |
|
|
|
|
|
|
|
// { |
|
|
|
// "comment": "as root, look up account policy again - it should not be found now", |
|
|
|
// "before": "sleep 10s", |
|
|
|
// "request": { "session": "rootSession", "uri": "users/{{user.uuid}}/policy" }, |
|
|
|
// "response": { "status": 404 } |
|
|
|
// } |
|
|
|
|
|
|
|
] |