@Test public void saveUsesCurrentUserWhenSpecifiedUserDoesNotExist() throws ComponentLookupException, IOException, XWikiException { when(this.xwiki.exists(this.author2, this.context)).thenReturn(false); this.mocker.getComponentUnderTest().save(this.patient); verify(this.doc).removeXObjects(AdditionalDocumentsController.CLASS_REFERENCE); verify(this.doc, times(2)).newXObject(AdditionalDocumentsController.CLASS_REFERENCE, this.context); verify(this.xattachment1).setAuthorReference(this.author1); verify(this.xattachment2).setAuthorReference(this.author1); }
@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; }