@Test public void saveSetsCorrectAPGARScoresWhenPolicyIsUpdate() { final Map<String, Integer> dataMap = new LinkedHashMap<>(); dataMap.put(APGAR_1, 5); final PatientData<Integer> data = new DictionaryPatientData<>(DATA_NAME, dataMap); when(this.patient.<Integer>getData(DATA_NAME)).thenReturn(data); this.component.save(this.patient, PatientWritePolicy.UPDATE); verify(this.doc, times(1)).getXObject(eq(Patient.CLASS_REFERENCE), eq(true), any()); verify(this.dataHolder, times(1)).getField(APGAR_1); verify(this.field1, times(1)).setValue("5"); verify(this.dataHolder, never()).getField(APGAR_5); verify(this.field5, never()).setValue(anyString()); verifyNoMoreInteractions(this.dataHolder); verifyNoMoreInteractions(this.doc); }
@Override public void save(Patient patient) { save(patient, PatientWritePolicy.UPDATE); }
APGARController implements PatientDataController<Integer> { @Override public void save(Patient patient) { save(patient, PatientWritePolicy.UPDATE); } }
APGARController implements PatientDataController<Integer> { @Override public void save(Patient patient) { save(patient, PatientWritePolicy.UPDATE); }  }
APGARController implements PatientDataController<Integer> { @Override public void save(Patient patient) { save(patient, PatientWritePolicy.UPDATE); }  @Override PatientData<Integer> 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<Integer> readJSON(JSONObject json); @Override String getName(); }
APGARController implements PatientDataController<Integer> { @Override public void save(Patient patient) { save(patient, PatientWritePolicy.UPDATE); }  @Override PatientData<Integer> 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<Integer> readJSON(JSONObject json); @Override String getName();  }