cleanup
This commit is contained in:
parent
fe21dba4a6
commit
d21304e771
|
@ -59,13 +59,19 @@ public class ExpungeHookTest {
|
||||||
public void expungeEverythingHook() throws InterruptedException {
|
public void expungeEverythingHook() throws InterruptedException {
|
||||||
IIdType id = myPatientDao.create(new Patient()).getId();
|
IIdType id = myPatientDao.create(new Patient()).getId();
|
||||||
assertNotNull(myPatientDao.read(id));
|
assertNotNull(myPatientDao.read(id));
|
||||||
|
|
||||||
myEverythingLatch.setExpectedCount(1);
|
myEverythingLatch.setExpectedCount(1);
|
||||||
ExpungeOptions options = new ExpungeOptions();
|
ExpungeOptions options = new ExpungeOptions();
|
||||||
options.setExpungeEverything(true);
|
options.setExpungeEverything(true);
|
||||||
myExpungeService.expunge(null, null, null, options, null);
|
myExpungeService.expunge(null, null, null, options, null);
|
||||||
myEverythingLatch.awaitExpected();
|
myEverythingLatch.awaitExpected();
|
||||||
|
|
||||||
|
assertPatientGone(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void assertPatientGone(IIdType theId) {
|
||||||
try {
|
try {
|
||||||
myPatientDao.read(id);
|
myPatientDao.read(theId);
|
||||||
fail();
|
fail();
|
||||||
} catch (ResourceNotFoundException e) {
|
} catch (ResourceNotFoundException e) {
|
||||||
assertThat(e.getMessage(), containsString("is not known"));
|
assertThat(e.getMessage(), containsString("is not known"));
|
||||||
|
|
Loading…
Reference in New Issue