mirror of
https://github.com/Alfresco/SearchServices.git
synced 2026-09-16 18:12:56 +00:00
fixed 3 tests and added one test to cover the new logged bug REPO-1889
This commit is contained in:
@@ -50,6 +50,9 @@ public class UpdateSiteMemberSanityTests extends RestTest
|
||||
description = "Verify that collaborator is not able to update site member and gets status code FORBIDDEN (403)")
|
||||
public void collaboratorIsNotAbleToUpdateSiteMember() throws Exception
|
||||
{
|
||||
UserModel testUserModel = dataUser.createRandomTestUser();
|
||||
dataUser.addUserToSite(testUserModel, siteModel, UserRole.SiteConsumer);
|
||||
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator));
|
||||
testUserModel.setUserRole(UserRole.SiteCollaborator);
|
||||
restClient.withCoreAPI().usingSite(siteModel).updateSiteMember(testUserModel);
|
||||
@@ -58,11 +61,31 @@ public class UpdateSiteMemberSanityTests extends RestTest
|
||||
.containsSummary(String.format("The current user does not have permissions to modify the membership details of the site %s.", siteModel.getTitle()));
|
||||
}
|
||||
|
||||
@Bug(id = "REPO-1889")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY })
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify that collaborator is not able to update site member and gets status code FORBIDDEN (403)")
|
||||
public void collaboratorIsNotAbleToUpdateSiteMemberWithTheSameRole() throws Exception
|
||||
{
|
||||
UserModel testUserModel = dataUser.createRandomTestUser();
|
||||
dataUser.addUserToSite(testUserModel, siteModel, UserRole.SiteConsumer);
|
||||
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator));
|
||||
testUserModel.setUserRole(UserRole.SiteConsumer);
|
||||
restClient.withCoreAPI().usingSite(siteModel).updateSiteMember(testUserModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.UNPROCESSABLE_ENTITY);
|
||||
restClient.assertLastError()
|
||||
.containsSummary(String.format("The current user does not have permissions to modify the membership details of the site %s.", siteModel.getTitle()));
|
||||
}
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY })
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify that contributor is not able to update site member and gets status code FORBIDDEN (403)")
|
||||
public void contributorIsNotAbleToUpdateSiteMember() throws Exception
|
||||
{
|
||||
UserModel testUserModel = dataUser.createRandomTestUser();
|
||||
dataUser.addUserToSite(testUserModel, siteModel, UserRole.SiteConsumer);
|
||||
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteContributor));
|
||||
testUserModel.setUserRole(UserRole.SiteCollaborator);
|
||||
restClient.withCoreAPI().usingSite(siteModel).updateSiteMember(testUserModel);
|
||||
@@ -76,6 +99,9 @@ public class UpdateSiteMemberSanityTests extends RestTest
|
||||
description = "Verify that consumer is not able to update site member and gets status code FORBIDDEN (403)")
|
||||
public void consumerIsNotAbleToUpdateSiteMember() throws Exception
|
||||
{
|
||||
UserModel testUserModel = dataUser.createRandomTestUser();
|
||||
dataUser.addUserToSite(testUserModel, siteModel, UserRole.SiteConsumer);
|
||||
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteConsumer));
|
||||
testUserModel.setUserRole(UserRole.SiteCollaborator);
|
||||
restClient.withCoreAPI().usingSite(siteModel).updateSiteMember(testUserModel);
|
||||
|
||||
Reference in New Issue
Block a user