@Test public void updatePatientThrowsExceptionWhenSentWrongIdInJSON() { JSONObject json = new JSONObject(); json.put("id", "!!!!!"); doReturn(PATIENT_ID).when(this.patient).getId(); WebApplicationException ex = null; try { this.patientResource.updatePatient(json.toString(), PATIENT_ID, UPDATE); } catch (WebApplicationException temp) { ex = temp; } Assert.assertNotNull("updatePatient did not throw a WebApplicationException as expected " + "when json id did not match patient id", ex); Assert.assertEquals(Status.CONFLICT.getStatusCode(), ex.getResponse().getStatus()); }
@Override public Response updatePatient(String json, String id, String policy) { final PatientWritePolicy policyType = PatientWritePolicy.fromString(policy); return updatePatient(json, id, policyType); }
DefaultPatientResourceImpl extends XWikiResource implements PatientResource { @Override public Response updatePatient(String json, String id, String policy) { final PatientWritePolicy policyType = PatientWritePolicy.fromString(policy); return updatePatient(json, id, policyType); } }
DefaultPatientResourceImpl extends XWikiResource implements PatientResource { @Override public Response updatePatient(String json, String id, String policy) { final PatientWritePolicy policyType = PatientWritePolicy.fromString(policy); return updatePatient(json, id, policyType); }  }
DefaultPatientResourceImpl extends XWikiResource implements PatientResource { @Override public Response updatePatient(String json, String id, String policy) { final PatientWritePolicy policyType = PatientWritePolicy.fromString(policy); return updatePatient(json, id, policyType); }  @Override Response getPatient(String id); @Override Response updatePatient(String json, String id, String policy); @Override Response patchPatient(final String json, final String id); @Override Response deletePatient(String id); }
DefaultPatientResourceImpl extends XWikiResource implements PatientResource { @Override public Response updatePatient(String json, String id, String policy) { final PatientWritePolicy policyType = PatientWritePolicy.fromString(policy); return updatePatient(json, id, policyType); }  @Override Response getPatient(String id); @Override Response updatePatient(String json, String id, String policy); @Override Response patchPatient(final String json, final String id); @Override Response deletePatient(String id);  }