Add a setter for unit tests
@@ -44,13 +44,19 @@ import java.util.TreeSet;
public class BaseJpaProvider {
public static final String REMOTE_ADDR = "req.remoteAddr";
public static final String REMOTE_UA = "req.userAgent";
-
+ private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(BaseJpaProvider.class);
@Autowired
protected DaoConfig myDaoConfig;
-
- private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(BaseJpaProvider.class);
private FhirContext myContext;
+ public BaseJpaProvider() {
+ super();
+ }
+
+ public void setDaoConfigForUnitTest(DaoConfig theDaoConfig) {
+ myDaoConfig = theDaoConfig;
+ }
+
protected ExpungeOptions createExpungeOptions(IPrimitiveType<? extends Integer> theLimit, IPrimitiveType<? extends Boolean> theExpungeDeletedResources, IPrimitiveType<? extends Boolean> theExpungeOldVersions, IPrimitiveType<? extends Boolean> theExpungeEverything) {
ExpungeOptions options = new ExpungeOptions();
if (theLimit != null && theLimit.getValue() != null) {
