Add some extra test logging

This commit is contained in:
James Agnew 2019-09-25 15:27:17 -04:00
parent dfe07e7a2b
commit cddaf058a2
1 changed files with 3 additions and 0 deletions

View File

@ -25,6 +25,7 @@ import ca.uhn.fhir.jpa.entity.Search;
import ca.uhn.fhir.jpa.entity.SearchResult; import ca.uhn.fhir.jpa.entity.SearchResult;
import com.google.common.annotations.VisibleForTesting; import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import org.apache.commons.lang3.Validate;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -57,6 +58,8 @@ public class DatabaseSearchResultCacheSvcImpl implements ISearchResultCacheSvc {
ourLog.trace("fetchResultPids for range {}-{} returned {} pids", theFrom, theTo, retVal.size()); ourLog.trace("fetchResultPids for range {}-{} returned {} pids", theFrom, theTo, retVal.size());
Validate.isTrue(theSearch.getNumFound() < theTo || retVal.size() == (theTo - theFrom), "Failed to find results in cache, requested %d - %d and git %d with numfound= %d", theFrom, theTo, retVal.size(), theSearch.getNumFound());
return new ArrayList<>(retVal); return new ArrayList<>(retVal);
} }