More test logging

This commit is contained in:
jamesagnew 2019-12-15 07:45:29 -05:00
parent ba8f50f0c8
commit 5f4355017d
2 changed files with 8 additions and 2 deletions

View File

@ -932,7 +932,10 @@ public class SearchCoordinatorSvcImpl implements ISearchCoordinatorSvc {
private void doSaveSearch() {
Search newSearch = mySearchCacheSvc.save(mySearch);
// This is an attempt to track down an intermittent test
// failure in testAsyncSearchLargeResultSetBigCountSameCoordinator
Object searchObj = mySearchCacheSvc.save(mySearch);
Search newSearch = (Search) searchObj;
// mySearchDao.save is not supposed to return null, but in unit tests
// it can if the mock search dao isn't set up to handle that

View File

@ -349,7 +349,10 @@ public class SearchCoordinatorSvcImplTest {
List<ResourcePersistentId> pids = createPidSequence(800);
IResultIterator iter = new SlowIterator(pids.iterator(), 2);
when(mySearchBuilder.createQuery(same(params), any(), any())).thenReturn(iter);
when(mySearchCacheSvc.save(any())).thenAnswer(t -> t.getArguments()[0]);
when(mySearchCacheSvc.save(any())).thenAnswer(t ->{
ourLog.info("Saving search");
return t.getArgument( 0, Search.class);
});
doAnswer(loadPids()).when(mySearchBuilder).loadResourcesByPid(any(Collection.class), any(Collection.class), any(List.class), anyBoolean(), any());
IBundleProvider result = mySvc.registerSearch(myCallingDao, params, "Patient", new CacheControlDirective(), null);