mirror of
https://github.com/Alfresco/SearchServices.git
synced 2026-09-16 18:12:56 +00:00
call getSites using maxItems parameter
This commit is contained in:
@@ -23,12 +23,6 @@ import org.testng.annotations.Test;
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.SANITY })
|
||||
public class GetSitesSanityTests extends RestTest
|
||||
{
|
||||
@Autowired
|
||||
DataUser dataUser;
|
||||
|
||||
@Autowired
|
||||
DataSite dataSite;
|
||||
|
||||
private UserModel adminUserModel;
|
||||
private UserModel userModel;
|
||||
private ListUserWithRoles usersWithRoles;
|
||||
@@ -38,7 +32,6 @@ public class GetSitesSanityTests extends RestTest
|
||||
public void dataPreparation() throws Exception
|
||||
{
|
||||
adminUserModel = dataUser.getAdminUser();
|
||||
restClient.authenticateUser(adminUserModel);
|
||||
siteModel = dataSite.usingUser(adminUserModel).createPublicRandomSite();
|
||||
usersWithRoles = dataUser.addUsersWithRolesToSite(siteModel,UserRole.SiteManager, UserRole.SiteCollaborator, UserRole.SiteConsumer, UserRole.SiteContributor);
|
||||
}
|
||||
@@ -46,8 +39,7 @@ public class GetSitesSanityTests extends RestTest
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.SANITY, description = "Verify user with Manager role gets sites information and gets status code OK (200)")
|
||||
public void managerIsAbleToRetrieveSites() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager))
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager)).withParams("maxItems=1000")
|
||||
.withCoreAPI().getSites()
|
||||
.assertThat().entriesListIsNotEmpty()
|
||||
.assertThat().entriesListContains("id", siteModel.getId())
|
||||
@@ -59,7 +51,7 @@ public class GetSitesSanityTests extends RestTest
|
||||
description = "Verify user with Collaborator role gets sites information and gets status code OK (200)")
|
||||
public void collaboratorIsAbleToRetrieveSites() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator))
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteCollaborator)).withParams("maxItems=1000")
|
||||
.withCoreAPI().getSites().assertThat().entriesListIsNotEmpty()
|
||||
.assertThat().entriesListContains("id", siteModel.getId())
|
||||
.and().paginationExist();
|
||||
@@ -72,7 +64,7 @@ public class GetSitesSanityTests extends RestTest
|
||||
public void contributorIsAbleToRetrieveSites() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteContributor))
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteContributor)).withParams("maxItems=1000")
|
||||
.withCoreAPI().getSites()
|
||||
.assertThat().entriesListIsNotEmpty()
|
||||
.assertThat().entriesListContains("id", siteModel.getId())
|
||||
@@ -85,7 +77,7 @@ public class GetSitesSanityTests extends RestTest
|
||||
public void consumerIsAbleToRetrieveSites() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteConsumer))
|
||||
restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteConsumer)).withParams("maxItems=1000")
|
||||
.withCoreAPI().getSites()
|
||||
.assertThat().entriesListIsNotEmpty()
|
||||
.assertThat().entriesListContains("id", siteModel.getId())
|
||||
@@ -97,7 +89,7 @@ public class GetSitesSanityTests extends RestTest
|
||||
description = "Verify user with Admin user gets sites information and gets status code OK (200)")
|
||||
public void adminUserIsAbleToRetrieveSites() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
restClient.authenticateUser(adminUserModel)
|
||||
restClient.authenticateUser(adminUserModel).withParams("maxItems=1000")
|
||||
.withCoreAPI().getSites()
|
||||
.assertThat().entriesListIsNotEmpty()
|
||||
.assertThat().entriesListContains("id", siteModel.getId())
|
||||
@@ -114,7 +106,7 @@ public class GetSitesSanityTests extends RestTest
|
||||
userModel = dataUser.createRandomTestUser();
|
||||
userModel.setPassword("user wrong password");
|
||||
dataUser.addUserToSite(userModel, siteModel, UserRole.SiteManager);
|
||||
restClient.authenticateUser(userModel)
|
||||
restClient.authenticateUser(userModel).withParams("maxItems=1000")
|
||||
.withCoreAPI().getSites();
|
||||
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user