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

130185 gjames: Merged searchapi (5.2.1) to 5.2.N (5.2.1)
      129838 gjames: SEARCH-117: Implementing templates


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@130336 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2016-09-06 22:05:32 +00:00
parent 5d442553f5
commit 3db8c1b295
6 changed files with 99 additions and 4 deletions

View File

@@ -37,6 +37,7 @@ import org.alfresco.rest.api.search.impl.SearchMapper;
import org.alfresco.rest.api.search.model.Query;
import org.alfresco.rest.api.search.model.SearchQuery;
import org.alfresco.rest.api.search.model.SortDef;
import org.alfresco.rest.api.search.model.Template;
import org.alfresco.rest.framework.core.exceptions.InvalidArgumentException;
import org.alfresco.rest.framework.resource.parameters.Paging;
import org.alfresco.service.cmr.repository.StoreRef;
@@ -182,6 +183,21 @@ public class SearchMapperTests
});
}
@Test
public void fromTemplate() throws Exception
{
SearchParameters searchParameters = new SearchParameters();
//Doesn't error
searchMapper.fromTemplate(searchParameters, null);
searchMapper.fromTemplate(searchParameters, Arrays.asList(new Template("hedge", "hog"), new Template("king", "kong"), new Template("bish", "bash")));
assertEquals(3 ,searchParameters.getQueryTemplates().size());
assertEquals("hog" ,searchParameters.getQueryTemplates().get("hedge"));
assertEquals("kong" ,searchParameters.getQueryTemplates().get("king"));
assertEquals("bash" ,searchParameters.getQueryTemplates().get("bish"));
}
@Test
public void validateInclude() throws Exception
{
@@ -216,7 +232,7 @@ public class SearchMapperTests
private SearchQuery minimalQuery()
{
Query query = new Query("cmis", "foo", "");
SearchQuery sq = new SearchQuery(query,null, null, null);
SearchQuery sq = new SearchQuery(query,null, null, null, null);
return sq;
}
}