@Test public void saveCorrectlyHandlesNullDataWhenPolicyIsReplace() { doReturn(this.dateData).when(this.patient).getData(DATA_NAME); doReturn(true).when(this.dateData).isNamed(); doReturn(true).when(this.dateData).containsKey(anyString()); doReturn(null).when(this.dateData).get(anyString()); this.component.save(this.patient, PatientWritePolicy.REPLACE); String deathAsEnteredField = DatesController.CORRESPONDING_ASENTERED_FIELDNAMES.get(DatesController.PATIENT_DATEOFDEATH_FIELDNAME); verify(this.data).setStringValue(deathAsEnteredField, ""); verify(this.data).setDateValue(DatesController.PATIENT_DATEOFDEATH_FIELDNAME, null); verify(this.data).setDateValue(DatesController.PATIENT_EXAMDATE_FIELDNAME, null); }
@Override public void save(Patient patient) { save(patient, PatientWritePolicy.UPDATE); }
DatesController implements PatientDataController<PhenoTipsDate> { @Override public void save(Patient patient) { save(patient, PatientWritePolicy.UPDATE); } }
DatesController implements PatientDataController<PhenoTipsDate> { @Override public void save(Patient patient) { save(patient, PatientWritePolicy.UPDATE); }  }
DatesController implements PatientDataController<PhenoTipsDate> { @Override public void save(Patient patient) { save(patient, PatientWritePolicy.UPDATE); }  @Override PatientData<PhenoTipsDate> load(Patient patient); @Override void save(Patient patient); @Override void save(@Nonnull final Patient patient, @Nonnull final PatientWritePolicy policy); @Override void writeJSON(Patient patient, JSONObject json); @Override void writeJSON(Patient patient, JSONObject json, Collection<String> selectedFieldNames); @Override PatientData<PhenoTipsDate> readJSON(JSONObject json); @Override String getName(); }
DatesController implements PatientDataController<PhenoTipsDate> { @Override public void save(Patient patient) { save(patient, PatientWritePolicy.UPDATE); }  @Override PatientData<PhenoTipsDate> load(Patient patient); @Override void save(Patient patient); @Override void save(@Nonnull final Patient patient, @Nonnull final PatientWritePolicy policy); @Override void writeJSON(Patient patient, JSONObject json); @Override void writeJSON(Patient patient, JSONObject json, Collection<String> selectedFieldNames); @Override PatientData<PhenoTipsDate> readJSON(JSONObject json); @Override String getName();  }