...
Scenario | sub-scenario(s) | status code | |
---|---|---|---|
1 | Create, Read, Update a consortium for positive cases | Create a consortium | 201 |
Get consortiums | 200 | ||
Get consortium | 200 | ||
Update consortium | 200 | ||
2 | Create, Read, Update a consortium for negative cases | Attempt to get non-existing consortium | 404 |
Attempt to update consortium with non-equal id in payload | 400 | ||
Attempt to update non-existing consortium | 404 | ||
Attempt to create second consortium | 409 |
Tenant API tests
Big picture
...
Scenario | sub-scenarios | status code | |
---|---|---|---|
1 | @Negative Attempt to POST a tenant to the consortium | Attempt to create a tenant for consortia without 'adminUserId' query param ('isCentral' = false) | 400 |
Attempt to create a tenant for consortia before 'central' tenant has been created | 404 | ||
Attempt to create a tenant for non-existing consortium | 404 | ||
Attempt to create a tenant without an 'id' | 422 | ||
Attempt to create a tenant without a 'code' | 422 | ||
Attempt to create a tenant without a 'name' | 422 | ||
Attempt to create a tenant without 'isCentral' | 422 | ||
Attempt to create a tenant with a 'name' that has length more than 150 characters and a 'code' with more than 3 characters | --- | ||
2 | @Positive Do POST a tenant, GET list of tenant(s) ('isCentral' = true) | Get tenants of the consortium (before posting any tenant) | 200 |
Post a tenant with 'isCentral' = true ('centralTenant') | 201 | ||
Get tenants of the consortium (after posting 'centralTenant') | 200 | ||
Verify that 'consortia_configuration' in 'centralTenant' has record for 'central'('isCentral' = true) tenant | 200 | ||
3 | @Negative Attempt to POST a second tenant with existing 'isCentral' = true, 'id', 'name', 'code' | Attempt to create a second central tenant ('isCentral' = true) | 409 |
Attempt to create a tenant with an existing 'id' | 409 | ||
Attempt to create a tenant with an existing 'code' | 409 | ||
Attempt to create a tenant with an existing 'name' | 409 | ||
4 | @Negative Attempt to PUT existing tenant with invalid payload | Attempt to update a tenant with a different 'id' | 400 |
Attempt to update the tenant for non-existing consortium | 404 | ||
Attempt to update non-existing tenant | 404 | ||
Attempt to update the tenant without an 'id' | 422 | ||
Attempt to update the tenant without a 'code' | 422 | ||
Attempt to update the tenant without a 'name' | 422 | ||
Attempt to update the tenant without 'isCentral' | 422 | ||
Attempt to update the tenant with a 'name' that has length more than 150 characters and a 'code' with more than 3 characters | --- | ||
5 | @Positive Do PUT the tenant | Update the tenants' 'code' | 200 |
Update the tenants' 'name' | 200 | ||
6 | @Negative Attempt to DELETE non-existing tenant, with non-existing consortiumId | Attempt to delete non-existing tenant in the consortium | 404 |
Attempt to delete tenant by non-existing consortiumId | 404 | ||
7 | @Positive Do POST a non-central tenant, GET list of tenant(s) ('isCentral' = false) | Create 'university' tenant | 201 |
Get tenants by consortiumId - should get two tenants | 200 | ||
Verify that 'consortia_configuration' in 'universityTenant' has record for 'central' tenant | 200 | ||
Verify 'dummy_user' has been saved in 'user_tenant' table in 'university_mod_users' | 200 |
...
- 'consortiaAdmin' in 'centralTenant';
- 'consortia-system-user' in 'centralTenant' (automatically created when 'mod-consortia' was enabled);
- 'universityUser1' in 'universityTenant';
- 'consortia-system-user' in 'universityTenant' (automatically created when 'mod-consortia' was enabled);
Scenario | sub-scenarios | |
---|---|---|
1 | Verify there are following records for 'consortiaAdmin': | 1. 'consortiaAdmin' has been saved in 'users' table in 'central_mod_users' |
2. 'consortiaAdmin' has been saved in 'user_tenant' table in 'central_mod_users' | ||
3. primary affiliation for 'consortiaAdmin' has been created in 'user_tenant' table in 'central_mod_consortia' | ||
4. shadow 'consortiaAdmin' has been saved in 'users' table in 'university_mod_users' | ||
5. non-primary affiliation for shadow 'consortiaAdmin' has been created in 'user_tenant' table in 'central_mod_consortia' | ||
6. verify shadow 'consortiaAdmin' has required permissions (in 'universityTenant') | ||
2 | Verify there are following records for 'consortia-system-user' of 'centralTenant': | 1. 'consortia-system-user' has been saved in 'users' table in 'central_mod_users' |
2. 'consortia-system-user' has been saved in 'user_tenant' table in 'central_mod_users' | ||
3. primary affiliation for 'consortia-system-user' has been created in 'user_tenant' table in 'central_mod_consortia' | ||
4. 'consortia-system-user' has required permissions | ||
3 | 1. 'universityUser1' has been saved in 'users' table in 'university_mod_users' | |
2. 'universityUser1' has been saved in 'user_tenant' table in 'central_mod_users' | ||
3. primary affiliation for 'universityUser1' has been created in 'user_tenant' table in 'central_mod_consortia' | ||
4. shadow 'universityUser1' has been saved in 'users' table in 'central_mod_users' | ||
5. non-primary affiliation for shadow 'universityUser1' has been created in 'user_tenant' table in 'central_mod_consortia' | ||
6. shadow 'universityUser1' has empty permissions (in 'centralTenant') | ||
4 | Verify there are following records for 'consortia-system-user' of 'universityTenant': | 1. 'consortia-system-user' has been saved in 'users' table in 'university_mod_users' |
2. 'consortia-system-user' has been saved in 'user_tenant' table in 'central_mod_users' | ||
3. primary affiliation for 'consortia-system-user' has been created in 'user_tenant' table in 'central_mod_consortia' | ||
4. 'consortia-system-user' has required permissions | ||
5. shadow 'consortia-system-user' has been saved in 'users' table in 'central_mod_users' | ||
6. non-primary affiliation for shadow 'consortia-system-user' has been created in 'user_tenant' table in 'central_mod_consortia' | ||
7. shadow 'consortia-system-user' of 'universityTenant' has empty permissions (in 'centralTenant') | ||
5 | Add permissions of 'consortiaAdmin' to shadow 'consortiaAdmin' #Note. We need to add permissions of 'consortiaAdmin' to shadow 'consortiaAdmin' |
...