for (SearchTestCriteria crit: testCriteria) {
criteria.getDocumentAttributeValues().clear();
for (String fieldName: crit.getFieldNamesToSearchValues().keySet()) {
criteria.addDocumentAttributeValue(fieldName, crit.getFieldNamesToSearchValues().get(fieldName));
}
DocumentSearchResults results = KEWServiceLocator.getDocumentSearchService().lookupDocuments(
KimApiServiceLocator.getIdentityService().getPrincipalByPrincipalName("clerk1").getPrincipalId(),
criteria.build());
assertEquals("expected number of documents not found for " + crit.toString(),
crit.getExpectedDocuments(), results.getSearchResults().size());
resultsList.add(results);
}
return resultsList;
}