fixed: updated getPersonActivitiesWithRetry to wait til the no of entries is as expected

This commit is contained in:
Cristina Axinte
2017-01-11 17:52:05 +02:00
parent 02499c60eb
commit 80f4f80bd8
5 changed files with 3 additions and 7 deletions
@@ -6,7 +6,6 @@ import org.alfresco.rest.model.RestErrorModel;
import org.alfresco.rest.model.RestSiteMembershipRequestModel;
import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.data.DataUser;
import org.alfresco.utility.data.DataUser.ListUserWithRoles;
import org.alfresco.utility.exception.DataPreparationException;
import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.TestGroup;
@@ -45,7 +45,7 @@ public class GetPeopleActivitiesCoreTests extends RestTest
dataUser.usingUser(userModel).addUserToSite(managerUser, siteModel2, UserRole.SiteManager);
// only once the activity list is checked with retry in order not to wait the entire list in each test
restActivityModelsCollection = restClient.authenticateUser(userModel).withCoreAPI().usingMe().getPersonActivitiesWithRetry();
restActivityModelsCollection = restClient.authenticateUser(userModel).withCoreAPI().usingMe().getPersonActivitiesUntilEntriesCountIs(4);
restClient.assertStatusCodeIs(HttpStatus.OK);
restActivityModelsCollection.assertThat().paginationField("count").is("4");
}
@@ -53,7 +53,7 @@ public class GetPeopleActivitiesFullTests extends RestTest
dataUser.usingUser(userModel).addUserToSite(managerUser, siteModel2, UserRole.SiteManager);
// only once the activity list is checked with retry in order not to wait the entire list in each test
restActivityModelsCollection = restClient.authenticateUser(userModel).withCoreAPI().usingMe().getPersonActivitiesWithRetry();
restActivityModelsCollection = restClient.authenticateUser(userModel).withCoreAPI().usingMe().getPersonActivitiesUntilEntriesCountIs(4);
restClient.assertStatusCodeIs(HttpStatus.OK);
restActivityModelsCollection.assertThat().paginationField("count").is("4");
}
@@ -39,9 +39,8 @@ public class GetPeopleActivitiesSanityTests extends RestTest
unauthenticatedUser.setPassword("newpassword");
// only once the activity list is checked with retry in order not to wait the entire list in each test
restActivityModelsCollection = restClient.authenticateUser(userModel).withCoreAPI().usingAuthUser().getPersonActivitiesWithRetry();
restActivityModelsCollection = restClient.authenticateUser(userModel).withCoreAPI().usingAuthUser().getPersonActivitiesUntilEntriesCountIs(5);
restClient.assertStatusCodeIs(HttpStatus.OK);
restActivityModelsCollection.assertThat().entriesListIsNotEmpty();
}
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.ACTIVITIES, TestGroup.SANITY })
@@ -5,7 +5,6 @@ import org.alfresco.rest.model.RestErrorModel;
import org.alfresco.rest.model.RestSiteMembershipRequestModelsCollection;
import org.alfresco.utility.constants.UserRole;
import org.alfresco.utility.data.DataUser;
import org.alfresco.utility.data.RandomData;
import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel;
@@ -13,7 +12,6 @@ import org.alfresco.utility.report.Bug;
import org.alfresco.utility.testrail.ExecutionType;
import org.alfresco.utility.testrail.annotation.TestRail;
import org.springframework.http.HttpStatus;
import org.springframework.social.alfresco.api.entities.Site.Visibility;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;