Fix tests
This commit is contained in:
parent
19c6369175
commit
b420d02f2a
|
@ -180,6 +180,7 @@ public class FhirResourceDaoDstu2InterceptorTest extends BaseJpaDstu2Test {
|
||||||
IIdType id = myPatientDao.create(p, mySrd).getId();
|
IIdType id = myPatientDao.create(p, mySrd).getId();
|
||||||
assertEquals(1L, id.getVersionIdPartAsLong().longValue());
|
assertEquals(1L, id.getVersionIdPartAsLong().longValue());
|
||||||
|
|
||||||
|
verify(myRequestOperationCallback, times(1)).resourcePreCreate(any(IBaseResource.class));
|
||||||
verify(myRequestOperationCallback, times(1)).resourceCreated(any(IBaseResource.class));
|
verify(myRequestOperationCallback, times(1)).resourceCreated(any(IBaseResource.class));
|
||||||
verifyNoMoreInteractions(myRequestOperationCallback);
|
verifyNoMoreInteractions(myRequestOperationCallback);
|
||||||
}
|
}
|
||||||
|
@ -203,7 +204,9 @@ public class FhirResourceDaoDstu2InterceptorTest extends BaseJpaDstu2Test {
|
||||||
IIdType newId = myPatientDao.delete(new IdDt("Patient/" + id), mySrd).getId();
|
IIdType newId = myPatientDao.delete(new IdDt("Patient/" + id), mySrd).getId();
|
||||||
assertEquals(2L, newId.getVersionIdPartAsLong().longValue());
|
assertEquals(2L, newId.getVersionIdPartAsLong().longValue());
|
||||||
|
|
||||||
|
verify(myRequestOperationCallback, times(1)).resourcePreDelete(any(IBaseResource.class));
|
||||||
verify(myRequestOperationCallback, times(1)).resourceDeleted(any(IBaseResource.class));
|
verify(myRequestOperationCallback, times(1)).resourceDeleted(any(IBaseResource.class));
|
||||||
|
verify(myRequestOperationCallback, times(1)).resourcePreCreate(any(IBaseResource.class));
|
||||||
verify(myRequestOperationCallback, times(1)).resourceCreated(any(IBaseResource.class));
|
verify(myRequestOperationCallback, times(1)).resourceCreated(any(IBaseResource.class));
|
||||||
verifyNoMoreInteractions(myRequestOperationCallback);
|
verifyNoMoreInteractions(myRequestOperationCallback);
|
||||||
}
|
}
|
||||||
|
@ -236,7 +239,9 @@ public class FhirResourceDaoDstu2InterceptorTest extends BaseJpaDstu2Test {
|
||||||
ourLog.info(oo);
|
ourLog.info(oo);
|
||||||
assertThat(oo, containsString("deleted 2 resource(s)"));
|
assertThat(oo, containsString("deleted 2 resource(s)"));
|
||||||
|
|
||||||
|
verify(myRequestOperationCallback, times(2)).resourcePreDelete(any(IBaseResource.class));
|
||||||
verify(myRequestOperationCallback, times(2)).resourceDeleted(any(IBaseResource.class));
|
verify(myRequestOperationCallback, times(2)).resourceDeleted(any(IBaseResource.class));
|
||||||
|
verify(myRequestOperationCallback, times(2)).resourcePreCreate(any(IBaseResource.class));
|
||||||
verify(myRequestOperationCallback, times(2)).resourceCreated(any(IBaseResource.class));
|
verify(myRequestOperationCallback, times(2)).resourceCreated(any(IBaseResource.class));
|
||||||
verifyNoMoreInteractions(myRequestOperationCallback);
|
verifyNoMoreInteractions(myRequestOperationCallback);
|
||||||
}
|
}
|
||||||
|
@ -258,16 +263,17 @@ public class FhirResourceDaoDstu2InterceptorTest extends BaseJpaDstu2Test {
|
||||||
Bundle xactBundle = new Bundle();
|
Bundle xactBundle = new Bundle();
|
||||||
xactBundle.setType(BundleTypeEnum.TRANSACTION);
|
xactBundle.setType(BundleTypeEnum.TRANSACTION);
|
||||||
xactBundle
|
xactBundle
|
||||||
.addEntry()
|
.addEntry()
|
||||||
.setResource(p)
|
.setResource(p)
|
||||||
.getRequest()
|
.getRequest()
|
||||||
.setUrl("Patient")
|
.setUrl("Patient")
|
||||||
.setMethod(HTTPVerbEnum.POST);
|
.setMethod(HTTPVerbEnum.POST);
|
||||||
Bundle resp = mySystemDao.transaction(mySrd, xactBundle);
|
Bundle resp = mySystemDao.transaction(mySrd, xactBundle);
|
||||||
|
|
||||||
IdDt newId = new IdDt(resp.getEntry().get(0).getResponse().getLocation());
|
IdDt newId = new IdDt(resp.getEntry().get(0).getResponse().getLocation());
|
||||||
assertEquals(1L, newId.getVersionIdPartAsLong().longValue());
|
assertEquals(1L, newId.getVersionIdPartAsLong().longValue());
|
||||||
|
|
||||||
|
verify(myRequestOperationCallback, times(1)).resourcePreCreate(any(IBaseResource.class));
|
||||||
verify(myRequestOperationCallback, times(1)).resourceCreated(any(IBaseResource.class));
|
verify(myRequestOperationCallback, times(1)).resourceCreated(any(IBaseResource.class));
|
||||||
verifyNoMoreInteractions(myRequestOperationCallback);
|
verifyNoMoreInteractions(myRequestOperationCallback);
|
||||||
}
|
}
|
||||||
|
@ -290,16 +296,18 @@ public class FhirResourceDaoDstu2InterceptorTest extends BaseJpaDstu2Test {
|
||||||
Bundle xactBundle = new Bundle();
|
Bundle xactBundle = new Bundle();
|
||||||
xactBundle.setType(BundleTypeEnum.TRANSACTION);
|
xactBundle.setType(BundleTypeEnum.TRANSACTION);
|
||||||
xactBundle
|
xactBundle
|
||||||
.addEntry()
|
.addEntry()
|
||||||
.getRequest()
|
.getRequest()
|
||||||
.setUrl("Patient/" + id)
|
.setUrl("Patient/" + id)
|
||||||
.setMethod(HTTPVerbEnum.DELETE);
|
.setMethod(HTTPVerbEnum.DELETE);
|
||||||
Bundle resp = mySystemDao.transaction(mySrd, xactBundle);
|
Bundle resp = mySystemDao.transaction(mySrd, xactBundle);
|
||||||
|
|
||||||
IdDt newId = new IdDt(resp.getEntry().get(0).getResponse().getLocation());
|
IdDt newId = new IdDt(resp.getEntry().get(0).getResponse().getLocation());
|
||||||
assertEquals(2L, newId.getVersionIdPartAsLong().longValue());
|
assertEquals(2L, newId.getVersionIdPartAsLong().longValue());
|
||||||
|
|
||||||
|
verify(myRequestOperationCallback, times(1)).resourcePreDelete(any(IBaseResource.class));
|
||||||
verify(myRequestOperationCallback, times(1)).resourceDeleted(any(IBaseResource.class));
|
verify(myRequestOperationCallback, times(1)).resourceDeleted(any(IBaseResource.class));
|
||||||
|
verify(myRequestOperationCallback, times(1)).resourcePreCreate(any(IBaseResource.class));
|
||||||
verify(myRequestOperationCallback, times(1)).resourceCreated(any(IBaseResource.class));
|
verify(myRequestOperationCallback, times(1)).resourceCreated(any(IBaseResource.class));
|
||||||
verifyNoMoreInteractions(myRequestOperationCallback);
|
verifyNoMoreInteractions(myRequestOperationCallback);
|
||||||
}
|
}
|
||||||
|
@ -328,14 +336,16 @@ public class FhirResourceDaoDstu2InterceptorTest extends BaseJpaDstu2Test {
|
||||||
Bundle xactBundle = new Bundle();
|
Bundle xactBundle = new Bundle();
|
||||||
xactBundle.setType(BundleTypeEnum.TRANSACTION);
|
xactBundle.setType(BundleTypeEnum.TRANSACTION);
|
||||||
xactBundle
|
xactBundle
|
||||||
.addEntry()
|
.addEntry()
|
||||||
.getRequest()
|
.getRequest()
|
||||||
.setUrl("Patient?name=PATIENT")
|
.setUrl("Patient?name=PATIENT")
|
||||||
.setMethod(HTTPVerbEnum.DELETE);
|
.setMethod(HTTPVerbEnum.DELETE);
|
||||||
Bundle resp = mySystemDao.transaction(mySrd, xactBundle);
|
Bundle resp = mySystemDao.transaction(mySrd, xactBundle);
|
||||||
assertNotNull(resp);
|
assertNotNull(resp);
|
||||||
|
|
||||||
|
verify(myRequestOperationCallback, times(2)).resourcePreDelete(any(IBaseResource.class));
|
||||||
verify(myRequestOperationCallback, times(2)).resourceDeleted(any(IBaseResource.class));
|
verify(myRequestOperationCallback, times(2)).resourceDeleted(any(IBaseResource.class));
|
||||||
|
verify(myRequestOperationCallback, times(2)).resourcePreCreate(any(IBaseResource.class));
|
||||||
verify(myRequestOperationCallback, times(2)).resourceCreated(any(IBaseResource.class));
|
verify(myRequestOperationCallback, times(2)).resourceCreated(any(IBaseResource.class));
|
||||||
verifyNoMoreInteractions(myRequestOperationCallback);
|
verifyNoMoreInteractions(myRequestOperationCallback);
|
||||||
}
|
}
|
||||||
|
@ -361,18 +371,20 @@ public class FhirResourceDaoDstu2InterceptorTest extends BaseJpaDstu2Test {
|
||||||
Bundle xactBundle = new Bundle();
|
Bundle xactBundle = new Bundle();
|
||||||
xactBundle.setType(BundleTypeEnum.TRANSACTION);
|
xactBundle.setType(BundleTypeEnum.TRANSACTION);
|
||||||
xactBundle
|
xactBundle
|
||||||
.addEntry()
|
.addEntry()
|
||||||
.setResource(p)
|
.setResource(p)
|
||||||
.getRequest()
|
.getRequest()
|
||||||
.setUrl("Patient/" + id)
|
.setUrl("Patient/" + id)
|
||||||
.setMethod(HTTPVerbEnum.PUT);
|
.setMethod(HTTPVerbEnum.PUT);
|
||||||
Bundle resp = mySystemDao.transaction(mySrd, xactBundle);
|
Bundle resp = mySystemDao.transaction(mySrd, xactBundle);
|
||||||
|
|
||||||
IdDt newId = new IdDt(resp.getEntry().get(0).getResponse().getLocation());
|
IdDt newId = new IdDt(resp.getEntry().get(0).getResponse().getLocation());
|
||||||
assertEquals(2L, newId.getVersionIdPartAsLong().longValue());
|
assertEquals(2L, newId.getVersionIdPartAsLong().longValue());
|
||||||
|
|
||||||
verify(myRequestOperationCallback, times(1)).resourceUpdated(any(IBaseResource.class));
|
verify(myRequestOperationCallback, times(1)).resourceUpdated(any(IBaseResource.class));
|
||||||
|
verify(myRequestOperationCallback, times(1)).resourcePreUpdate(any(IBaseResource.class), any(IBaseResource.class));
|
||||||
verify(myRequestOperationCallback, times(1)).resourceUpdated(any(IBaseResource.class), any(IBaseResource.class));
|
verify(myRequestOperationCallback, times(1)).resourceUpdated(any(IBaseResource.class), any(IBaseResource.class));
|
||||||
|
verify(myRequestOperationCallback, times(1)).resourcePreCreate(any(IBaseResource.class));
|
||||||
verify(myRequestOperationCallback, times(1)).resourceCreated(any(IBaseResource.class));
|
verify(myRequestOperationCallback, times(1)).resourceCreated(any(IBaseResource.class));
|
||||||
verifyNoMoreInteractions(myRequestOperationCallback);
|
verifyNoMoreInteractions(myRequestOperationCallback);
|
||||||
}
|
}
|
||||||
|
@ -398,7 +410,9 @@ public class FhirResourceDaoDstu2InterceptorTest extends BaseJpaDstu2Test {
|
||||||
assertEquals(2L, newId.getVersionIdPartAsLong().longValue());
|
assertEquals(2L, newId.getVersionIdPartAsLong().longValue());
|
||||||
|
|
||||||
verify(myRequestOperationCallback, times(1)).resourceUpdated(any(IBaseResource.class));
|
verify(myRequestOperationCallback, times(1)).resourceUpdated(any(IBaseResource.class));
|
||||||
|
verify(myRequestOperationCallback, times(1)).resourcePreUpdate(any(IBaseResource.class), any(IBaseResource.class));
|
||||||
verify(myRequestOperationCallback, times(1)).resourceUpdated(any(IBaseResource.class), any(IBaseResource.class));
|
verify(myRequestOperationCallback, times(1)).resourceUpdated(any(IBaseResource.class), any(IBaseResource.class));
|
||||||
|
verify(myRequestOperationCallback, times(1)).resourcePreCreate(any(IBaseResource.class));
|
||||||
verify(myRequestOperationCallback, times(1)).resourceCreated(any(IBaseResource.class));
|
verify(myRequestOperationCallback, times(1)).resourceCreated(any(IBaseResource.class));
|
||||||
verifyNoMoreInteractions(myRequestOperationCallback);
|
verifyNoMoreInteractions(myRequestOperationCallback);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue