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

130181 gjames: Merged searchapi (5.2.1) to 5.2.N (5.2.1)
      129821 gjames: SEARCH-150: Implementing include in the JSON body


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@130332 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2016-09-06 22:04:51 +00:00
parent 7e95472e8c
commit e8e0209f8c
4 changed files with 81 additions and 5 deletions

View File

@@ -37,11 +37,12 @@ import org.alfresco.rest.api.search.model.Query;
import org.alfresco.rest.api.search.model.SearchQuery;
import org.alfresco.rest.framework.core.exceptions.InvalidArgumentException;
import org.alfresco.rest.framework.resource.parameters.Paging;
import org.alfresco.rest.framework.resource.parameters.Params;
import org.alfresco.service.cmr.repository.StoreRef;
import org.alfresco.service.cmr.search.SearchParameters;
import org.junit.Test;
import java.util.Arrays;
/**
* Tests the SearchMapper class
*
@@ -136,10 +137,41 @@ public class SearchMapperTests
assertEquals(searchParameters.getSkipCount(),paging.getSkipCount());
}
@Test
public void validateInclude() throws Exception
{
try
{
searchMapper.validateInclude(Arrays.asList("sausage"));
fail();
}
catch (InvalidArgumentException iae)
{
//Sausage is illegal
assertNotNull(iae);
}
searchMapper.validateInclude(null);
try
{
searchMapper.validateInclude(Arrays.asList("AspectNames"));
fail();
}
catch (InvalidArgumentException iae)
{
//Case sensitive
assertNotNull(iae);
}
searchMapper.validateInclude(Arrays.asList("properties", "aspectNames"));
}
private SearchQuery minimalQuery()
{
Query query = new Query("cmis", "foo", "");
SearchQuery sq = new SearchQuery(query,null);
SearchQuery sq = new SearchQuery(query,null, null);
return sq;
}
}