Tidy test
This commit is contained in:
parent
3428d71023
commit
15ea4fb555
|
@ -129,4 +129,4 @@ X-Retry-On-Version-Conflict: retry; max-retries=100
|
|||
|
||||
# Controlling Delete with Expunge size
|
||||
|
||||
During delete with expunge operations there is an internal synchronous search which locates all the resources to be deleted. By default the maximum size of this search is 10000. This can be configured via the [Internal Synchronous Search Size](/hapi-fhir/apidocs/hapi-fhir-jpaserver-api/ca/uhn/fhir/jpa/api/config/DaoConfig.html#setInternalSynchronousSearchSize(int))
|
||||
During the delete with expunge operation there is an internal synchronous search which locates all the resources to be deleted. The default maximum size of this search is 10000. This can be configured via the [Internal Synchronous Search Size](/hapi-fhir/apidocs/hapi-fhir-jpaserver-api/ca/uhn/fhir/jpa/api/config/DaoConfig.html#setInternalSynchronousSearchSize(int)) property.
|
||||
|
|
|
@ -67,28 +67,29 @@ class DeleteExpungeServiceTest extends BaseJpaR4Test {
|
|||
}
|
||||
@Test
|
||||
public void testDeleteExpungeRespectsSynchronousSize() {
|
||||
//When
|
||||
//Given
|
||||
myDaoConfig.setInternalSynchronousSearchSize(1);
|
||||
|
||||
Patient patient = new Patient();
|
||||
myPatientDao.create(patient);
|
||||
|
||||
Patient otherPatient = new Patient();
|
||||
myPatientDao.create(otherPatient);
|
||||
|
||||
|
||||
//Then
|
||||
//When
|
||||
DeleteMethodOutcome deleteMethodOutcome = myPatientDao.deleteByUrl("Patient?" + JpaConstants.PARAM_DELETE_EXPUNGE + "=true", mySrd);
|
||||
IBundleProvider remaining = myPatientDao.search(new SearchParameterMap().setLoadSynchronous(true));
|
||||
|
||||
//Then
|
||||
assertThat(deleteMethodOutcome.getExpungedResourcesCount(), is(equalTo(1L)));
|
||||
assertThat(remaining.size(), is(equalTo(1)));
|
||||
|
||||
IBundleProvider search = myPatientDao.search(new SearchParameterMap().setLoadSynchronous(true));
|
||||
assertThat(search.size(), is(equalTo(1)));
|
||||
|
||||
//When
|
||||
deleteMethodOutcome = myPatientDao.deleteByUrl("Patient?" + JpaConstants.PARAM_DELETE_EXPUNGE + "=true", mySrd);
|
||||
assertThat(deleteMethodOutcome.getExpungedResourcesCount(), is(equalTo(1L)));
|
||||
remaining = myPatientDao.search(new SearchParameterMap().setLoadSynchronous(true));
|
||||
|
||||
search = myPatientDao.search(new SearchParameterMap().setLoadSynchronous(true));
|
||||
assertThat(search.size(), is(equalTo(0)));
|
||||
//Then
|
||||
assertThat(deleteMethodOutcome.getExpungedResourcesCount(), is(equalTo(1L)));
|
||||
assertThat(remaining.size(), is(equalTo(0)));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue