@Test public void patchPatientNoPatientWithSpecifiedEidExistsResultsPatientBeingCreated() throws QueryException { when(this.repository.get(PATIENT_ID)).thenReturn(null); final Query query = mock(Query.class); when(this.qm.createQuery(anyString(), eq(Query.XWQL))).thenReturn(query); when(query.execute()).thenReturn(Collections.emptyList()); final Response response = this.component.patchPatient(EMPTY_JSON, PATIENT_ID); Assert.assertEquals(Response.Status.NO_CONTENT.getStatusCode(), response.getStatus()); verify(this.repository, times(1)).create(); }
@Override public Response patchPatient(final String json, final String eid) { return updatePatient(json, eid, PatientWritePolicy.MERGE); }
DefaultPatientByExternalIdResourceImpl extends XWikiResource implements PatientByExternalIdResource { @Override public Response patchPatient(final String json, final String eid) { return updatePatient(json, eid, PatientWritePolicy.MERGE); } }
DefaultPatientByExternalIdResourceImpl extends XWikiResource implements PatientByExternalIdResource { @Override public Response patchPatient(final String json, final String eid) { return updatePatient(json, eid, PatientWritePolicy.MERGE); }  }
DefaultPatientByExternalIdResourceImpl extends XWikiResource implements PatientByExternalIdResource { @Override public Response patchPatient(final String json, final String eid) { return updatePatient(json, eid, PatientWritePolicy.MERGE); }  @Override Response getPatient(String eid); @Override Response updatePatient(final String json, final String eid, final String policy); @Override Response patchPatient(final String json, final String eid); @Override Response deletePatient(String eid); }
DefaultPatientByExternalIdResourceImpl extends XWikiResource implements PatientByExternalIdResource { @Override public Response patchPatient(final String json, final String eid) { return updatePatient(json, eid, PatientWritePolicy.MERGE); }  @Override Response getPatient(String eid); @Override Response updatePatient(final String json, final String eid, final String policy); @Override Response patchPatient(final String json, final String eid); @Override Response deletePatient(String eid);  }