@Test public void saveRemovesEverythingWhenNoDataPresentAndPolicyIsReplace() throws ComponentLookupException { when(this.patient.getData(CONTROLLER_NAME)).thenReturn(null); this.mocker.getComponentUnderTest().save(this.patient, PatientWritePolicy.REPLACE); Mockito.verify(this.doc, times(1)).removeXObjects(AdditionalDocumentsController.CLASS_REFERENCE); Mockito.verifyNoMoreInteractions(this.doc); }
@Override public void save(@Nonnull final Patient patient) { save(patient, PatientWritePolicy.UPDATE); }
AdditionalDocumentsController implements PatientDataController<Attachment> { @Override public void save(@Nonnull final Patient patient) { save(patient, PatientWritePolicy.UPDATE); } }
AdditionalDocumentsController implements PatientDataController<Attachment> { @Override public void save(@Nonnull final Patient patient) { save(patient, PatientWritePolicy.UPDATE); }  }
AdditionalDocumentsController implements PatientDataController<Attachment> { @Override public void save(@Nonnull final Patient patient) { save(patient, PatientWritePolicy.UPDATE); }  @Override PatientData<Attachment> load(Patient patient); @Override void save(@Nonnull final 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<Attachment> readJSON(JSONObject json); @Override String getName(); }
AdditionalDocumentsController implements PatientDataController<Attachment> { @Override public void save(@Nonnull final Patient patient) { save(patient, PatientWritePolicy.UPDATE); }  @Override PatientData<Attachment> load(Patient patient); @Override void save(@Nonnull final 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<Attachment> readJSON(JSONObject json); @Override String getName(); static final EntityReference CLASS_REFERENCE; }