Search in sources :

Example 21 with Node

use of org.alfresco.rest.api.model.Node in project alfresco-remote-api by Alfresco.

the class ResultMapperTests method testNoResults.

@Test
public void testNoResults() throws Exception {
    SearchRequestContext searchRequest = SearchRequestContext.from(SearchQuery.EMPTY);
    CollectionWithPagingInfo<Node> collection = mapper.toCollectionWithPagingInfo(EMPTY_PARAMS, searchRequest, null, new EmptyResultSet());
    assertNotNull(collection);
    assertFalse(collection.hasMoreItems());
    assertTrue(collection.getTotalItems() < 1);
    assertNull(collection.getContext());
}
Also used : EmptyResultSet(org.alfresco.repo.search.EmptyResultSet) Node(org.alfresco.rest.api.model.Node) SearchRequestContext(org.alfresco.rest.api.search.context.SearchRequestContext) Test(org.junit.Test)

Aggregations

Node (org.alfresco.rest.api.model.Node)21 NodeRef (org.alfresco.service.cmr.repository.NodeRef)14 HashMap (java.util.HashMap)12 QName (org.alfresco.service.namespace.QName)10 Serializable (java.io.Serializable)7 UserInfo (org.alfresco.rest.api.model.UserInfo)7 ArrayList (java.util.ArrayList)6 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)4 EntityNotFoundException (org.alfresco.rest.framework.core.exceptions.EntityNotFoundException)4 ChildAssociationRef (org.alfresco.service.cmr.repository.ChildAssociationRef)4 FilterPropBoolean (org.alfresco.repo.node.getchildren.FilterPropBoolean)3 SearchRequestContext (org.alfresco.rest.api.search.context.SearchRequestContext)3 WebApiDescription (org.alfresco.rest.framework.WebApiDescription)3 InvalidArgumentException (org.alfresco.rest.framework.core.exceptions.InvalidArgumentException)3 Version (org.alfresco.service.cmr.version.Version)3 List (java.util.List)2 Map (java.util.Map)2 PagingRequest (org.alfresco.query.PagingRequest)2 EmptyResultSet (org.alfresco.repo.search.EmptyResultSet)2 SolrJSONResultSet (org.alfresco.repo.search.impl.lucene.SolrJSONResultSet)2