Source:
public void testHistory_Server() { runInTransaction(() -> { Patient p = new Patient(); p.setId("A"); p.addIdentifier().setSystem("urn:system").setValue("1"); myPatientDao.update(p).getId().toUnqualified(); p = new Patient(); p.setId("B"); p.addIdentifier().setSystem("urn:system").setValue("2"); myPatientDao.update(p).getId().toUnqualified(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue("2"); myPatientDao.create(p).getId().toUnqualified(); }); myCaptureQueriesListener.clear(); runInTransaction(() -> { IBundleProvider history = mySystemDao.history(null, null, null); assertEquals(3, history.getResources(0, 3).size()); }); myCaptureQueriesListener.logSelectQueriesForCurrentThread(); assertEquals(3, myCaptureQueriesListener.getSelectQueriesForCurrentThread().size()); myCaptureQueriesListener.logUpdateQueriesForCurrentThread(); assertEquals(0, myCaptureQueriesListener.getUpdateQueriesForCurrentThread().size()); myCaptureQueriesListener.logInsertQueriesForCurrentThread(); assertEquals(0, myCaptureQueriesListener.getInsertQueriesForCurrentThread().size()); myCaptureQueriesListener.logDeleteQueriesForCurrentThread(); assertEquals(0, myCaptureQueriesListener.getDeleteQueriesForCurrentThread().size()); myCaptureQueriesListener.clear(); runInTransaction(() -> { IBundleProvider history = mySystemDao.history(null, null, null); assertEquals(3, history.getResources(0, 3).size()); }); myCaptureQueriesListener.logSelectQueriesForCurrentThread(); assertEquals(2, myCaptureQueriesListener.getSelectQueriesForCurrentThread().size()); myCaptureQueriesListener.logUpdateQueriesForCurrentThread(); assertEquals(0, myCaptureQueriesListener.getUpdateQueriesForCurrentThread().size()); myCaptureQueriesListener.logInsertQueriesForCurrentThread(); assertEquals(0, myCaptureQueriesListener.getInsertQueriesForCurrentThread().size()); myCaptureQueriesListener.logDeleteQueriesForCurrentThread(); assertEquals(0, myCaptureQueriesListener.getDeleteQueriesForCurrentThread().size()); }

Target:
public void testHistory_Server() { runInTransaction(() -> { Patient p = new Patient(); p.setId("A"); p.addIdentifier().setSystem("urn:system").setValue("1"); myPatientDao.update(p).getId().toUnqualified(); p = new Patient(); p.setId("B"); p.addIdentifier().setSystem("urn:system").setValue("2"); myPatientDao.update(p).getId().toUnqualified(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue("2"); myPatientDao.create(p).getId().toUnqualified(); }); myCaptureQueriesListener.clear(); runInTransaction(() -> { IBundleProvider history = mySystemDao.history(null, null, null); assertEquals(3, history.getResources(0, 99).size()); }); myCaptureQueriesListener.logSelectQueriesForCurrentThread(); assertEquals(3, myCaptureQueriesListener.getSelectQueriesForCurrentThread().size()); assertNoPartitionSelectors(); myCaptureQueriesListener.logUpdateQueriesForCurrentThread(); assertEquals(0, myCaptureQueriesListener.getUpdateQueriesForCurrentThread().size()); myCaptureQueriesListener.logInsertQueriesForCurrentThread(); assertEquals(0, myCaptureQueriesListener.getInsertQueriesForCurrentThread().size()); myCaptureQueriesListener.logDeleteQueriesForCurrentThread(); assertEquals(0, myCaptureQueriesListener.getDeleteQueriesForCurrentThread().size()); myCaptureQueriesListener.clear(); runInTransaction(() -> { IBundleProvider history = mySystemDao.history(null, null, null); assertEquals(3, history.getResources(0, 99).size()); }); myCaptureQueriesListener.logSelectQueriesForCurrentThread(); assertEquals(2, myCaptureQueriesListener.getSelectQueriesForCurrentThread().size()); myCaptureQueriesListener.logUpdateQueriesForCurrentThread(); assertEquals(0, myCaptureQueriesListener.getUpdateQueriesForCurrentThread().size()); myCaptureQueriesListener.logInsertQueriesForCurrentThread(); assertEquals(0, myCaptureQueriesListener.getInsertQueriesForCurrentThread().size()); myCaptureQueriesListener.logDeleteQueriesForCurrentThread(); assertEquals(0, myCaptureQueriesListener.getDeleteQueriesForCurrentThread().size()); }