mirror of
https://github.com/Alfresco/SearchServices.git
synced 2026-09-16 18:12:56 +00:00
SEARCH-561: Improve test case
This commit is contained in:
+7
-3
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+9
-2
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user