mirror of
https://github.com/Alfresco/SearchServices.git
synced 2025-10-08 14:51:20 +00:00
TAS-983 getSiteContainer call returns status code 401 with Manager role
This commit is contained in:
@@ -38,6 +38,7 @@ public class GetSiteContainerSanityTests extends RestTest
|
|||||||
private SiteModel siteModel;
|
private SiteModel siteModel;
|
||||||
private ListUserWithRoles usersWithRoles;
|
private ListUserWithRoles usersWithRoles;
|
||||||
private List<RestSiteContainerModel> listOfFoldersIds;
|
private List<RestSiteContainerModel> listOfFoldersIds;
|
||||||
|
private UserModel userModel;
|
||||||
|
|
||||||
@BeforeClass(alwaysRun=true)
|
@BeforeClass(alwaysRun=true)
|
||||||
public void initTest() throws Exception
|
public void initTest() throws Exception
|
||||||
@@ -98,4 +99,18 @@ public class GetSiteContainerSanityTests extends RestTest
|
|||||||
siteAPI.getSiteContainer(siteModel, listOfFoldersIds.get(0));
|
siteAPI.getSiteContainer(siteModel, listOfFoldersIds.get(0));
|
||||||
siteAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
siteAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestRail(section = { "rest-api", "sites" }, executionType = ExecutionType.SANITY,
|
||||||
|
description = "Failed authentication get site container call returns status code 401 with Manager role")
|
||||||
|
public void unauthenticatedUserIsNotAuthorizedToRetrieveSiteContainer() throws JsonToModelConversionException, Exception
|
||||||
|
{
|
||||||
|
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager));
|
||||||
|
userModel = dataUser.createRandomTestUser();
|
||||||
|
userModel.setPassword("user wrong password");
|
||||||
|
dataUser.addUserToSite(userModel, siteModel, UserRole.SiteManager);
|
||||||
|
restClient.authenticateUser(userModel);
|
||||||
|
listOfFoldersIds = siteAPI.getSiteContainers(siteModel).getSiteContainersList();
|
||||||
|
siteAPI.getSiteContainer(siteModel, listOfFoldersIds.get(0));
|
||||||
|
siteAPI.usingRestWrapper().assertStatusCodeIs(HttpStatus.UNAUTHORIZED);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user