Test fixes
This commit is contained in:
parent
009d6443f5
commit
8a2b799df0
|
@ -1401,12 +1401,12 @@ public enum Pointcut {
|
|||
* </li>
|
||||
* </ul>
|
||||
* <p>
|
||||
* Hooks should return an instance of <code>ca.uhn.fhir.jpa.api.model.PartitionId</code> or <code>null</code>.
|
||||
* Hooks should return an instance of <code>ca.uhn.fhir.jpa.api.model.RequestPartitionId</code> or <code>null</code>.
|
||||
* </p>
|
||||
*/
|
||||
STORAGE_PARTITION_IDENTIFY_CREATE(
|
||||
// Return type
|
||||
"ca.uhn.fhir.interceptor.model.PartitionId",
|
||||
"ca.uhn.fhir.interceptor.model.RequestPartitionId",
|
||||
// Params
|
||||
"org.hl7.fhir.instance.model.api.IBaseResource",
|
||||
"ca.uhn.fhir.rest.api.server.RequestDetails",
|
||||
|
@ -1440,12 +1440,12 @@ public enum Pointcut {
|
|||
* </li>
|
||||
* </ul>
|
||||
* <p>
|
||||
* Hooks should return an instance of <code>ca.uhn.fhir.jpa.api.model.PartitionId</code> or <code>null</code>.
|
||||
* Hooks should return an instance of <code>ca.uhn.fhir.jpa.api.model.RequestPartitionId</code> or <code>null</code>.
|
||||
* </p>
|
||||
*/
|
||||
STORAGE_PARTITION_IDENTIFY_READ(
|
||||
// Return type
|
||||
"ca.uhn.fhir.interceptor.model.PartitionId",
|
||||
"ca.uhn.fhir.interceptor.model.RequestPartitionId",
|
||||
// Params
|
||||
"ca.uhn.fhir.rest.api.server.RequestDetails",
|
||||
"ca.uhn.fhir.rest.server.servlet.ServletRequestDetails"
|
||||
|
|
|
@ -282,7 +282,7 @@ public class IdHelperService {
|
|||
}
|
||||
}
|
||||
|
||||
if (pid.isEmpty()) {
|
||||
if (!pid.isPresent()) {
|
||||
throw new ResourceNotFoundException(new IdDt(theResourceType, theId));
|
||||
}
|
||||
return pid.get();
|
||||
|
|
|
@ -7,6 +7,7 @@ import ca.uhn.fhir.jpa.api.dao.IFhirResourceDaoPatient;
|
|||
import ca.uhn.fhir.jpa.api.model.ExpungeOptions;
|
||||
import ca.uhn.fhir.jpa.config.TestDstu3Config;
|
||||
import ca.uhn.fhir.jpa.api.config.DaoConfig;
|
||||
import ca.uhn.fhir.jpa.dao.dstu3.BaseJpaDstu3Test;
|
||||
import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
|
||||
import ca.uhn.test.concurrency.PointcutLatch;
|
||||
import org.hl7.fhir.dstu3.model.Patient;
|
||||
|
@ -26,9 +27,7 @@ import static org.junit.Assert.assertThat;
|
|||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@ContextConfiguration(classes = {TestDstu3Config.class})
|
||||
public class ExpungeHookTest {
|
||||
public class ExpungeHookTest extends BaseJpaDstu3Test {
|
||||
@Autowired
|
||||
private IFhirResourceDaoPatient<Patient> myPatientDao;
|
||||
@Autowired
|
||||
|
|
|
@ -55,6 +55,11 @@ public class SearchCoordinatorSvcImplTest extends BaseJpaR4Test {
|
|||
DatabaseSearchCacheSvcImpl.setMaximumResultsToDeleteInOnePassForUnitTest(5);
|
||||
DatabaseSearchCacheSvcImpl.setMaximumSearchesToCheckForDeletionCandidacyForUnitTest(10);
|
||||
|
||||
runInTransaction(()->{
|
||||
assertEquals(0, mySearchDao.count());
|
||||
assertEquals(0, mySearchResultDao.count());
|
||||
});
|
||||
|
||||
// Create lots of searches
|
||||
runInTransaction(()->{
|
||||
for (int i = 0; i < 20; i++) {
|
||||
|
|
Loading…
Reference in New Issue