Merged 5.1.N (5.1.2) to 5.2.N (5.2.1)

127218 arebegea: Merged 5.0.N (5.0.4) to 5.1.N (5.1.2)
      127187 cturlica: MNT-15630: CLONE - people rest api does not accept the skipCount param
         - merged initial solution with some changes required for 5.0.N, because the people web script was split in people.get.js and people-enterprise.get.js


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@127253 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Andrei Rebegea
2016-05-19 14:54:32 +00:00
parent 36b2e9782f
commit 337f5bc8a3
2 changed files with 29 additions and 5 deletions

View File

@@ -245,6 +245,27 @@ public class PersonServiceTest extends BaseWebScriptTest
response = sendRequest(new GetRequest(URL_PEOPLE + "/" + userName), 200);
}
public void testGetPeopleSkipCount() throws Exception
{
// Test case for MNT-15357 skipCount
int skipCount = 1;
// Ensure that the REST call with no filter will always be routed to a DB canned query rather than a FTS
// (see ALF-18876 for details)
String filter = "*%20[hint:useCQ]";
Response response = sendRequest(new GetRequest(URL_PEOPLE + "?filter=" + filter), 200);
JSONObject res = new JSONObject(response.getContentAsString());
int peopleFound = res.getJSONArray("people").length();
assertTrue("No people found", peopleFound > 0);
response = sendRequest(new GetRequest(URL_PEOPLE + "?filter=" + filter + "&skipCount=" + skipCount), 200);
res = new JSONObject(response.getContentAsString());
assertTrue("skipCount ignored", res.getJSONArray("people").length() < peopleFound);
}
public void testUpdatePerson() throws Exception
{
// Create a new person