Merged 5.2.N (5.2.1) to HEAD (5.2)

130176 gjames: Merged searchapi (5.2.1) to 5.2.N (5.2.1)
      129787 gjames: SEARCH-114: No default paging.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@130327 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2016-09-06 22:04:05 +00:00
parent 7755241834
commit f78d1f81f7
4 changed files with 12 additions and 6 deletions

View File

@@ -111,7 +111,7 @@ public class ResultMapperTests
@Test
public void testNoResults() throws Exception
{
CollectionWithPagingInfo<Node> collection = mapper.toCollectionWithPagingInfo(mockParams(),new EmptyResultSet());
CollectionWithPagingInfo<Node> collection = mapper.toCollectionWithPagingInfo(mockParams(new SearchQuery()),new EmptyResultSet());
assertNotNull(collection);
assertFalse(collection.hasMoreItems());
assertTrue(collection.getTotalItems() < 1);
@@ -121,7 +121,7 @@ public class ResultMapperTests
public void testToCollectionWithPagingInfo() throws Exception
{
ResultSet results = mockResultset();
CollectionWithPagingInfo<Node> collectionWithPage = mapper.toCollectionWithPagingInfo(mockParams(),results);
CollectionWithPagingInfo<Node> collectionWithPage = mapper.toCollectionWithPagingInfo(mockParams(new SearchQuery()),results);
assertNotNull(collectionWithPage);
Long found = results.getNumberFound();
assertEquals(found.intValue(), collectionWithPage.getTotalItems().intValue());
@@ -142,10 +142,11 @@ public class ResultMapperTests
return results;
}
private Params mockParams()
private Params mockParams(SearchQuery searchQuery)
{
Params params = mock(Params.class);
when(params.getInclude()).thenReturn(new ArrayList<String>());
when(params.getPassedIn()).thenReturn(searchQuery);
return params;
}