@Test public void saveSetsOnlySpecifiedFieldsUnderMergePolicy() { final Map<String, String> map = new LinkedHashMap<>(); map.put(PROPERTY_1, PROPERTY_1); map.put(PROPERTY_3, PROPERTY_3); final PatientData<String> patientData = new DictionaryPatientData<>(DATA_NAME, map); doReturn(patientData).when(this.patient).getData(DATA_NAME); this.component.save(this.patient, PatientWritePolicy.MERGE); verify(this.doc, times(1)).getXObject(eq(Patient.CLASS_REFERENCE), eq(true), any()); verify(this.data, times(1)).setStringValue(PROPERTY_1, PROPERTY_1); verify(this.data, never()).setStringValue(Matchers.matches(PROPERTY_2), anyString()); verify(this.data, times(1)).setStringValue(PROPERTY_3, PROPERTY_3); verifyNoMoreInteractions(this.data); }
@Override public void save(Patient patient) { save(patient, PatientWritePolicy.UPDATE); }
AbstractSimpleController implements PatientDataController<String> { @Override public void save(Patient patient) { save(patient, PatientWritePolicy.UPDATE); } }
AbstractSimpleController implements PatientDataController<String> { @Override public void save(Patient patient) { save(patient, PatientWritePolicy.UPDATE); }  }
AbstractSimpleController implements PatientDataController<String> { @Override public void save(Patient patient) { save(patient, PatientWritePolicy.UPDATE); }  @Override PatientData<String> 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<String> readJSON(JSONObject json); }
AbstractSimpleController implements PatientDataController<String> { @Override public void save(Patient patient) { save(patient, PatientWritePolicy.UPDATE); }  @Override PatientData<String> 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<String> readJSON(JSONObject json);  }