mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user