@Test public void updatePatientNotFoundNewPatientNotCreatedIfUserDoesNotHaveEditRights() { this.exception.expect(HttpStatus.of(Response.Status.FORBIDDEN)); when(this.access.hasAccess(eq(this.currentUser), eq(Right.EDIT), any(EntityReference.class))) .thenReturn(false); try { this.component.updatePatient(EMPTY_JSON, ID_LABEL, ID_VALUE, UPDATE, true); } catch (final WebApplicationException ex) { verify(this.repository, never()).create(); throw ex; } }
@Override public Response updatePatient(final String json, final String label, final String id, final String policy, final boolean create) { final PatientWritePolicy policyType = PatientWritePolicy.fromString(policy); return updatePatient(json, label, id, policyType, create); }
DefaultPatientByLabeledExternalIdentifierResourceImpl extends XWikiResource implements
    PatientByLabeledExternalIdentifierResource { @Override public Response updatePatient(final String json, final String label, final String id, final String policy, final boolean create) { final PatientWritePolicy policyType = PatientWritePolicy.fromString(policy); return updatePatient(json, label, id, policyType, create); } }
DefaultPatientByLabeledExternalIdentifierResourceImpl extends XWikiResource implements
    PatientByLabeledExternalIdentifierResource { @Override public Response updatePatient(final String json, final String label, final String id, final String policy, final boolean create) { final PatientWritePolicy policyType = PatientWritePolicy.fromString(policy); return updatePatient(json, label, id, policyType, create); }  }
DefaultPatientByLabeledExternalIdentifierResourceImpl extends XWikiResource implements
    PatientByLabeledExternalIdentifierResource { @Override public Response updatePatient(final String json, final String label, final String id, final String policy, final boolean create) { final PatientWritePolicy policyType = PatientWritePolicy.fromString(policy); return updatePatient(json, label, id, policyType, create); }  @Override Response getPatient(String label, String id); @Override Response updatePatient(final String json, final String label, final String id,
        final String policy, final boolean create); @Override Response patchPatient(String json, String label, String id, boolean create); @Override Response deletePatient(String label, String id); }
DefaultPatientByLabeledExternalIdentifierResourceImpl extends XWikiResource implements
    PatientByLabeledExternalIdentifierResource { @Override public Response updatePatient(final String json, final String label, final String id, final String policy, final boolean create) { final PatientWritePolicy policyType = PatientWritePolicy.fromString(policy); return updatePatient(json, label, id, policyType, create); }  @Override Response getPatient(String label, String id); @Override Response updatePatient(final String json, final String label, final String id,
        final String policy, final boolean create); @Override Response patchPatient(String json, String label, String id, boolean create); @Override Response deletePatient(String label, String id);  }