SEARCH-561: Improve test case

This commit is contained in:
Joel
2017-12-11 19:39:33 -05:00
parent e415563d9a
commit 8a6dca0308
2 changed files with 16 additions and 5 deletions
@@ -40,8 +40,12 @@ public class AlfrescoJsonQueryRequest extends QueryRequest
public Collection<ContentStream> getContentStreams()
{
List<ContentStream> streams = new ArrayList<ContentStream>();
streams.add(new ContentStreamBase.StringStream(json));
return streams;
if(json != null) {
List<ContentStream> streams = new ArrayList<ContentStream>();
streams.add(new ContentStreamBase.StringStream(json));
return streams;
} else {
return null;
}
}
}
@@ -98,8 +98,15 @@ public class DistributedAlfrescoSolrJsonTest extends AbstractAlfrescoDistributed
queryResponse = query(getDefaultTestClient(),
true,
"{\"authorities\": [ \"jim\" ], \"tenants\": [ \"\" ], \"locales\":[\"en\"], \"templates\": [{\"name\":\"t1\", \"template\":\"%cm:content\"}]}",
params("q", "t1:world", "qt", "/afts", "fq", "{!afts}AUTHORITY_FILTER_FROM_JSON", "shards.qt", "/afts", "start", "0", "rows", "100", "sort", "id asc"));
null, //Send in null JSON string and pass in the ALFRESCO_JSON parameter instead
params("q", "t1:world",
"ALFRESCO_JSON", "{\"authorities\": [ \"jim\" ], \"tenants\": [ \"\" ], \"locales\":[\"en\"], \"templates\": [{\"name\":\"t1\", \"template\":\"%cm:content\"}]}",
"qt", "/afts",
"fq", "{!afts}AUTHORITY_FILTER_FROM_JSON",
"shards.qt", "/afts",
"start", "0",
"rows", "100",
"sort", "id asc"));
assertEquals(queryResponse.getResults().getNumFound(), 500);
}