mirror of
https://github.com/hapifhir/hapi-fhir.git
synced 2025-03-09 14:33:32 +00:00
Try to avoid intermittent test failure
This commit is contained in:
parent
74159dcb26
commit
3173af31ae
@ -14,6 +14,7 @@ import ca.uhn.fhir.jpa.search.cache.DatabaseSearchCacheSvcImpl;
|
|||||||
import ca.uhn.fhir.rest.gclient.IClientExecutable;
|
import ca.uhn.fhir.rest.gclient.IClientExecutable;
|
||||||
import ca.uhn.fhir.rest.gclient.IQuery;
|
import ca.uhn.fhir.rest.gclient.IQuery;
|
||||||
import ca.uhn.fhir.rest.server.exceptions.ResourceGoneException;
|
import ca.uhn.fhir.rest.server.exceptions.ResourceGoneException;
|
||||||
|
import ca.uhn.fhir.test.utilities.UnregisterScheduledProcessor;
|
||||||
import ca.uhn.fhir.util.TestUtil;
|
import ca.uhn.fhir.util.TestUtil;
|
||||||
import org.apache.commons.lang3.time.DateUtils;
|
import org.apache.commons.lang3.time.DateUtils;
|
||||||
import org.hl7.fhir.r4.model.Bundle;
|
import org.hl7.fhir.r4.model.Bundle;
|
||||||
@ -24,6 +25,7 @@ import org.junit.AfterClass;
|
|||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.test.context.TestPropertySource;
|
||||||
import org.springframework.test.util.AopTestUtils;
|
import org.springframework.test.util.AopTestUtils;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@ -33,6 +35,11 @@ import static ca.uhn.fhir.jpa.util.TestUtil.sleepAtLeast;
|
|||||||
import static org.hamcrest.Matchers.*;
|
import static org.hamcrest.Matchers.*;
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
@TestPropertySource(properties = {
|
||||||
|
// Since scheduled tasks can cause searches, which messes up the
|
||||||
|
// value returned by SearchBuilder.getLastHandlerMechanismForUnitTest()
|
||||||
|
UnregisterScheduledProcessor.SCHEDULING_DISABLED_EQUALS_TRUE
|
||||||
|
})
|
||||||
public class StaleSearchDeletingSvcR4Test extends BaseResourceProviderR4Test {
|
public class StaleSearchDeletingSvcR4Test extends BaseResourceProviderR4Test {
|
||||||
|
|
||||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(StaleSearchDeletingSvcR4Test.class);
|
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(StaleSearchDeletingSvcR4Test.class);
|
||||||
|
@ -53,7 +53,7 @@ public class UnregisterScheduledProcessor implements BeanFactoryPostProcessor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (String beanName : beanFactory.getBeanNamesForType(ExecutorConfigurationSupport.class)) {
|
for (String beanName : beanFactory.getBeanNamesForType(ExecutorConfigurationSupport.class)) {
|
||||||
ExecutorConfigurationSupport executorConfigSupport = ((DefaultListableBeanFactory) beanFactory).getBean(beanName, ExecutorConfigurationSupport.class);
|
ExecutorConfigurationSupport executorConfigSupport = beanFactory.getBean(beanName, ExecutorConfigurationSupport.class);
|
||||||
executorConfigSupport.shutdown();
|
executorConfigSupport.shutdown();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user