@Test public void saveSetsCorrectDiagnosisWhenPolicyIsReplace() { final List<String> dataList = Collections.singletonList(DISORDER1); PatientData<Disorder> data = new IndexedPatientData<>(DATA_NAME, Collections.singletonList(this.disorder1)); when(this.patient.<Disorder>getData(DATA_NAME)).thenReturn(data); this.component.save(this.patient, PatientWritePolicy.REPLACE); verify(this.doc, times(1)).getXObject(Patient.CLASS_REFERENCE, true, this.xcontext); verify(this.dataHolder, times(1)).set(XPROPERTY_NAME, dataList, this.xcontext); verifyNoMoreInteractions(this.dataHolder); verifyNoMoreInteractions(this.doc); }
@Override public void save(Patient patient) { save(patient, PatientWritePolicy.UPDATE); }
ClinicalDiagnosisController implements PatientDataController<Disorder> { @Override public void save(Patient patient) { save(patient, PatientWritePolicy.UPDATE); } }
ClinicalDiagnosisController implements PatientDataController<Disorder> { @Override public void save(Patient patient) { save(patient, PatientWritePolicy.UPDATE); }  }
ClinicalDiagnosisController implements PatientDataController<Disorder> { @Override public void save(Patient patient) { save(patient, PatientWritePolicy.UPDATE); }  @Override String getName(); @Override IndexedPatientData<Disorder> 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<Disorder> readJSON(JSONObject json); }
ClinicalDiagnosisController implements PatientDataController<Disorder> { @Override public void save(Patient patient) { save(patient, PatientWritePolicy.UPDATE); }  @Override String getName(); @Override IndexedPatientData<Disorder> 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<Disorder> readJSON(JSONObject json);  }