fix test
This commit is contained in:
parent
5588da5ff8
commit
09d2599ce5
|
@ -142,6 +142,11 @@ public class ResourceReindexingSvcImpl implements IResourceReindexingSvc {
|
||||||
myContext = theContext;
|
myContext = theContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@VisibleForTesting
|
||||||
|
void setSchedulerServiceForUnitTest(ISchedulerService theSchedulerService) {
|
||||||
|
mySchedulerService = theSchedulerService;
|
||||||
|
}
|
||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void start() {
|
public void start() {
|
||||||
myTxTemplate = new TransactionTemplate(myTxManager);
|
myTxTemplate = new TransactionTemplate(myTxManager);
|
||||||
|
|
|
@ -1,16 +1,13 @@
|
||||||
package ca.uhn.fhir.jpa.search.reindex;
|
package ca.uhn.fhir.jpa.search.reindex;
|
||||||
|
|
||||||
import ca.uhn.fhir.context.FhirContext;
|
import ca.uhn.fhir.context.FhirContext;
|
||||||
import ca.uhn.fhir.jpa.dao.BaseHapiFhirDao;
|
import ca.uhn.fhir.jpa.dao.*;
|
||||||
import ca.uhn.fhir.jpa.dao.BaseJpaTest;
|
|
||||||
import ca.uhn.fhir.jpa.dao.DaoConfig;
|
|
||||||
import ca.uhn.fhir.jpa.dao.DaoRegistry;
|
|
||||||
import ca.uhn.fhir.jpa.dao.IFhirResourceDao;
|
|
||||||
import ca.uhn.fhir.jpa.dao.data.IForcedIdDao;
|
import ca.uhn.fhir.jpa.dao.data.IForcedIdDao;
|
||||||
import ca.uhn.fhir.jpa.dao.data.IResourceReindexJobDao;
|
import ca.uhn.fhir.jpa.dao.data.IResourceReindexJobDao;
|
||||||
import ca.uhn.fhir.jpa.dao.data.IResourceTableDao;
|
import ca.uhn.fhir.jpa.dao.data.IResourceTableDao;
|
||||||
import ca.uhn.fhir.jpa.entity.ResourceReindexJobEntity;
|
import ca.uhn.fhir.jpa.entity.ResourceReindexJobEntity;
|
||||||
import ca.uhn.fhir.jpa.model.entity.ResourceTable;
|
import ca.uhn.fhir.jpa.model.entity.ResourceTable;
|
||||||
|
import ca.uhn.fhir.jpa.model.sched.ISchedulerService;
|
||||||
import ca.uhn.fhir.jpa.searchparam.registry.ISearchParamRegistry;
|
import ca.uhn.fhir.jpa.searchparam.registry.ISearchParamRegistry;
|
||||||
import org.apache.commons.lang3.time.DateUtils;
|
import org.apache.commons.lang3.time.DateUtils;
|
||||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||||
|
@ -72,6 +69,8 @@ public class ResourceReindexingSvcImplTest extends BaseJpaTest {
|
||||||
private ISearchParamRegistry mySearchParamRegistry;
|
private ISearchParamRegistry mySearchParamRegistry;
|
||||||
@Mock
|
@Mock
|
||||||
private TransactionStatus myTxStatus;
|
private TransactionStatus myTxStatus;
|
||||||
|
@Mock
|
||||||
|
private ISchedulerService mySchedulerService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected FhirContext getContext() {
|
protected FhirContext getContext() {
|
||||||
|
@ -97,6 +96,7 @@ public class ResourceReindexingSvcImplTest extends BaseJpaTest {
|
||||||
mySvc.setResourceTableDaoForUnitTest(myResourceTableDao);
|
mySvc.setResourceTableDaoForUnitTest(myResourceTableDao);
|
||||||
mySvc.setTxManagerForUnitTest(myTxManager);
|
mySvc.setTxManagerForUnitTest(myTxManager);
|
||||||
mySvc.setSearchParamRegistryForUnitTest(mySearchParamRegistry);
|
mySvc.setSearchParamRegistryForUnitTest(mySearchParamRegistry);
|
||||||
|
mySvc.setSchedulerServiceForUnitTest(mySchedulerService);
|
||||||
mySvc.start();
|
mySvc.start();
|
||||||
|
|
||||||
when(myTxManager.getTransaction(any())).thenReturn(myTxStatus);
|
when(myTxManager.getTransaction(any())).thenReturn(myTxStatus);
|
||||||
|
|
Loading…
Reference in New Issue