@Test public void returnsNormallyWhenPatientDoesNotHavePatientClass() throws ComponentLookupException { doReturn(null).when(this.source).getXObject(Patient.CLASS_REFERENCE); this.mocker.getComponentUnderTest().onEvent(this.event, this.source, this.data); verifyNoMoreInteractions(this.data); }
@Override public void onEvent(Event event, Object source, Object data) { XWikiDocument doc = (XWikiDocument) source; BaseObject patientRecordObj = doc.getXObject(Patient.CLASS_REFERENCE); if (patientRecordObj == null) { return; } if (("alive").equals(patientRecordObj.getStringValue("life_status"))) { patientRecordObj.setDateValue("date_of_death", null); patientRecordObj.setStringValue("date_of_death_entered", null); } }
PatientDeathdateUpdater extends AbstractEventListener { @Override public void onEvent(Event event, Object source, Object data) { XWikiDocument doc = (XWikiDocument) source; BaseObject patientRecordObj = doc.getXObject(Patient.CLASS_REFERENCE); if (patientRecordObj == null) { return; } if (("alive").equals(patientRecordObj.getStringValue("life_status"))) { patientRecordObj.setDateValue("date_of_death", null); patientRecordObj.setStringValue("date_of_death_entered", null); } } }
PatientDeathdateUpdater extends AbstractEventListener { @Override public void onEvent(Event event, Object source, Object data) { XWikiDocument doc = (XWikiDocument) source; BaseObject patientRecordObj = doc.getXObject(Patient.CLASS_REFERENCE); if (patientRecordObj == null) { return; } if (("alive").equals(patientRecordObj.getStringValue("life_status"))) { patientRecordObj.setDateValue("date_of_death", null); patientRecordObj.setStringValue("date_of_death_entered", null); } } PatientDeathdateUpdater(); }
PatientDeathdateUpdater extends AbstractEventListener { @Override public void onEvent(Event event, Object source, Object data) { XWikiDocument doc = (XWikiDocument) source; BaseObject patientRecordObj = doc.getXObject(Patient.CLASS_REFERENCE); if (patientRecordObj == null) { return; } if (("alive").equals(patientRecordObj.getStringValue("life_status"))) { patientRecordObj.setDateValue("date_of_death", null); patientRecordObj.setStringValue("date_of_death_entered", null); } } PatientDeathdateUpdater(); @Override void onEvent(Event event, Object source, Object data); }
PatientDeathdateUpdater extends AbstractEventListener { @Override public void onEvent(Event event, Object source, Object data) { XWikiDocument doc = (XWikiDocument) source; BaseObject patientRecordObj = doc.getXObject(Patient.CLASS_REFERENCE); if (patientRecordObj == null) { return; } if (("alive").equals(patientRecordObj.getStringValue("life_status"))) { patientRecordObj.setDateValue("date_of_death", null); patientRecordObj.setStringValue("date_of_death_entered", null); } } PatientDeathdateUpdater(); @Override void onEvent(Event event, Object source, Object data);  }