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

130028 gjames: SEARCH-120: Moving SearchContext and facets to its own package


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@130289 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gethin James
2016-09-06 15:36:44 +00:00
parent 8cdfa5f8de
commit f0f886be92
8 changed files with 65 additions and 37 deletions

View File

@@ -31,8 +31,8 @@ import org.alfresco.rest.api.search.model.Default;
import org.alfresco.rest.api.search.model.SearchQuery;
import org.alfresco.rest.framework.jacksonextensions.ExecutionResult;
import org.alfresco.rest.framework.resource.parameters.CollectionWithPagingInfo;
import org.alfresco.rest.framework.resource.parameters.SearchContext;
import org.alfresco.rest.framework.resource.parameters.SearchContext.FacetQueryResult;
import org.alfresco.rest.api.search.context.SearchContext;
import org.alfresco.rest.api.search.context.FacetQueryContext;
import org.alfresco.rest.framework.tests.api.mocks.Farmer;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -92,7 +92,7 @@ public class SearchQuerySerializerTests
public void testSerializeContext() throws IOException
{
ExecutionResult exec1 = new ExecutionResult(new Farmer("180"),null);
SearchContext searchContext = new SearchContext(23l, Arrays.asList(new FacetQueryResult("f1", 15), new FacetQueryResult("f2", 20)));
SearchContext searchContext = new SearchContext(23l, Arrays.asList(new FacetQueryContext("f1", 15), new FacetQueryContext("f2", 20)));
CollectionWithPagingInfo<ExecutionResult> coll = CollectionWithPagingInfo.asPaged(null, Arrays.asList(exec1), false, 2, null, searchContext);
String out = helper.writeResponse(coll);
assertTrue("There must 'context' json output", out.contains("\"context\":{\"consistency\":{\"lastTxId\":23}"));