@Test public void updatePatientRejectsRequestWhenUserDoesNotHaveAccess() { doReturn(false).when(this.access).hasAccess(this.currentUser, Right.EDIT, this.patientDocument); WebApplicationException ex = null; try { this.patientResource.updatePatient("", PATIENT_ID, UPDATE); } catch (WebApplicationException temp) { ex = temp; } Assert.assertNotNull("updatePatient did not throw a WebApplicationException as expected " + "when the User did not have edit rights", ex); Assert.assertEquals(Status.FORBIDDEN.getStatusCode(), ex.getResponse().getStatus()); verify(this.logger).debug("Edit access denied to user [{}] on patient record [{}]", this.currentUser, PATIENT_ID); }
@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);  }