@Test public void referenceGetsPersistedCorrectly() { when(referensService.referensExists(eq(INTYGSID))).thenReturn(false); String ref = "referens"; IntegrationParameters parameters = new IntegrationParameters(ref, null, ALTERNATE_SSN, null, null, null, null, null, null, false, false, false, false); WebCertUser user = createDefaultUser(); user.setParameters(parameters); Response res = testee.handleRedirectToIntyg(uriInfo, INTYGSTYP, INTYGSID, ENHETSID, user); assertEquals(Response.Status.TEMPORARY_REDIRECT.getStatusCode(), res.getStatus()); verify(referensService).saveReferens(eq(INTYGSID), eq(ref)); }
protected Response handleRedirectToIntyg(final UriInfo uriInfo, final String intygId, final String enhetId, final WebCertUser user) { return handleRedirectToIntyg(uriInfo, null, intygId, enhetId, user); }
IntygIntegrationController extends BaseIntegrationController { protected Response handleRedirectToIntyg(final UriInfo uriInfo, final String intygId, final String enhetId, final WebCertUser user) { return handleRedirectToIntyg(uriInfo, null, intygId, enhetId, user); } }
IntygIntegrationController extends BaseIntegrationController { protected Response handleRedirectToIntyg(final UriInfo uriInfo, final String intygId, final String enhetId, final WebCertUser user) { return handleRedirectToIntyg(uriInfo, null, intygId, enhetId, user); }  }
IntygIntegrationController extends BaseIntegrationController { protected Response handleRedirectToIntyg(final UriInfo uriInfo, final String intygId, final String enhetId, final WebCertUser user) { return handleRedirectToIntyg(uriInfo, null, intygId, enhetId, user); }  @GET @Path("/{certType}/{certId}") @PrometheusTimeMethod Response getRedirectToIntyg(@Context UriInfo uriInfo,
        @PathParam(PARAM_CERT_TYPE) String intygTyp,
        @PathParam(PARAM_CERT_ID) String intygId,
        @DefaultValue("") @QueryParam(PARAM_ENHET_ID) String enhetId,
        @DefaultValue("") @QueryParam(PARAM_PATIENT_ALTERNATE_SSN) String alternatePatientSSn,
        @DefaultValue("") @QueryParam(PARAM_RESPONSIBLE_HOSP_NAME) String responsibleHospName,
        @QueryParam(PARAM_PATIENT_FORNAMN) String fornamn,
        @QueryParam(PARAM_PATIENT_EFTERNAMN) String efternamn,
        @QueryParam(PARAM_PATIENT_MELLANNAMN) String mellannamn,
        @QueryParam(PARAM_PATIENT_POSTADRESS) String postadress,
        @QueryParam(PARAM_PATIENT_POSTNUMMER) String postnummer,
        @QueryParam(PARAM_PATIENT_POSTORT) String postort,
        @QueryParam(PARAM_REFERENCE) String reference,
        @DefaultValue("false") @QueryParam(PARAM_COHERENT_JOURNALING) boolean coherentJournaling,
        @DefaultValue("false") @QueryParam(PARAM_INACTIVE_UNIT) boolean inactiveUnit,
        @DefaultValue("false") @QueryParam(PARAM_PATIENT_DECEASED) boolean deceased,
        @DefaultValue("true") @QueryParam(PARAM_FORNYA_OK) boolean fornyaOk); @GET @Path("{certId}") @PrometheusTimeMethod Response getRedirectToIntyg(@Context UriInfo uriInfo,
        @PathParam(PARAM_CERT_ID) String intygId,
        @DefaultValue("") @QueryParam(PARAM_ENHET_ID) String enhetId,
        @DefaultValue("") @QueryParam(PARAM_PATIENT_ALTERNATE_SSN) String alternatePatientSSn,
        @DefaultValue("") @QueryParam(PARAM_RESPONSIBLE_HOSP_NAME) String responsibleHospName,
        @QueryParam(PARAM_PATIENT_FORNAMN) String fornamn,
        @QueryParam(PARAM_PATIENT_EFTERNAMN) String efternamn,
        @QueryParam(PARAM_PATIENT_MELLANNAMN) String mellannamn,
        @QueryParam(PARAM_PATIENT_POSTADRESS) String postadress,
        @QueryParam(PARAM_PATIENT_POSTNUMMER) String postnummer,
        @QueryParam(PARAM_PATIENT_POSTORT) String postort,
        @DefaultValue("false") @QueryParam(PARAM_COHERENT_JOURNALING) boolean coherentJournaling,
        @QueryParam(PARAM_REFERENCE) String reference,
        @DefaultValue("false") @QueryParam(PARAM_INACTIVE_UNIT) boolean inactiveUnit,
        @DefaultValue("false") @QueryParam(PARAM_PATIENT_DECEASED) boolean deceased,
        @DefaultValue("true") @QueryParam(PARAM_FORNYA_OK) boolean fornyaOk); @GET @Path("{certId}/saved") @PrometheusTimeMethod Response getRedirectToIntyg(@Context UriInfo uriInfo,
        @PathParam(PARAM_CERT_ID) String intygId,
        @DefaultValue("") @QueryParam(PARAM_ENHET_ID) String enhetId); @POST @Path("/{certId}") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) @PrometheusTimeMethod Response postRedirectToIntyg(@Context UriInfo uriInfo,
        @PathParam(PARAM_CERT_ID) String intygId,
        @DefaultValue("") @FormParam(PARAM_ENHET_ID) String enhetId,
        @DefaultValue("") @FormParam(PARAM_PATIENT_ALTERNATE_SSN) String alternatePatientSSn,
        @DefaultValue("") @FormParam(PARAM_RESPONSIBLE_HOSP_NAME) String responsibleHospName,
        @FormParam(PARAM_PATIENT_FORNAMN) String fornamn,
        @FormParam(PARAM_PATIENT_EFTERNAMN) String efternamn,
        @FormParam(PARAM_PATIENT_MELLANNAMN) String mellannamn,
        @FormParam(PARAM_PATIENT_POSTADRESS) String postadress,
        @FormParam(PARAM_PATIENT_POSTNUMMER) String postnummer,
        @FormParam(PARAM_PATIENT_POSTORT) String postort,
        @DefaultValue("false") @FormParam(PARAM_COHERENT_JOURNALING) boolean coherentJournaling,
        @FormParam(PARAM_REFERENCE) String reference,
        @DefaultValue("false") @FormParam(PARAM_INACTIVE_UNIT) boolean inactiveUnit,
        @DefaultValue("false") @FormParam(PARAM_PATIENT_DECEASED) boolean deceased,
        @DefaultValue("true") @FormParam(PARAM_FORNYA_OK) boolean fornyaOk); @GET @Path("/{certType}/{certTypeVersion}/{certId}/resume") @PrometheusTimeMethod Response resumeRedirectToIntyg(
        @Context UriInfo uriInfo,
        @PathParam(PARAM_CERT_TYPE) String intygTyp,
        @PathParam(PARAM_CERT_TYPE_VERSION) String certTypeVersion,
        @PathParam(PARAM_CERT_ID) String intygId,
        @DefaultValue("") @QueryParam(PARAM_ENHET_ID) String enhetId); void setUrlIntygFragmentTemplate(String urlFragmentTemplate); void setUrlUtkastFragmentTemplate(String urlFragmentTemplate); }
IntygIntegrationController extends BaseIntegrationController { protected Response handleRedirectToIntyg(final UriInfo uriInfo, final String intygId, final String enhetId, final WebCertUser user) { return handleRedirectToIntyg(uriInfo, null, intygId, enhetId, user); }  @GET @Path("/{certType}/{certId}") @PrometheusTimeMethod Response getRedirectToIntyg(@Context UriInfo uriInfo,
        @PathParam(PARAM_CERT_TYPE) String intygTyp,
        @PathParam(PARAM_CERT_ID) String intygId,
        @DefaultValue("") @QueryParam(PARAM_ENHET_ID) String enhetId,
        @DefaultValue("") @QueryParam(PARAM_PATIENT_ALTERNATE_SSN) String alternatePatientSSn,
        @DefaultValue("") @QueryParam(PARAM_RESPONSIBLE_HOSP_NAME) String responsibleHospName,
        @QueryParam(PARAM_PATIENT_FORNAMN) String fornamn,
        @QueryParam(PARAM_PATIENT_EFTERNAMN) String efternamn,
        @QueryParam(PARAM_PATIENT_MELLANNAMN) String mellannamn,
        @QueryParam(PARAM_PATIENT_POSTADRESS) String postadress,
        @QueryParam(PARAM_PATIENT_POSTNUMMER) String postnummer,
        @QueryParam(PARAM_PATIENT_POSTORT) String postort,
        @QueryParam(PARAM_REFERENCE) String reference,
        @DefaultValue("false") @QueryParam(PARAM_COHERENT_JOURNALING) boolean coherentJournaling,
        @DefaultValue("false") @QueryParam(PARAM_INACTIVE_UNIT) boolean inactiveUnit,
        @DefaultValue("false") @QueryParam(PARAM_PATIENT_DECEASED) boolean deceased,
        @DefaultValue("true") @QueryParam(PARAM_FORNYA_OK) boolean fornyaOk); @GET @Path("{certId}") @PrometheusTimeMethod Response getRedirectToIntyg(@Context UriInfo uriInfo,
        @PathParam(PARAM_CERT_ID) String intygId,
        @DefaultValue("") @QueryParam(PARAM_ENHET_ID) String enhetId,
        @DefaultValue("") @QueryParam(PARAM_PATIENT_ALTERNATE_SSN) String alternatePatientSSn,
        @DefaultValue("") @QueryParam(PARAM_RESPONSIBLE_HOSP_NAME) String responsibleHospName,
        @QueryParam(PARAM_PATIENT_FORNAMN) String fornamn,
        @QueryParam(PARAM_PATIENT_EFTERNAMN) String efternamn,
        @QueryParam(PARAM_PATIENT_MELLANNAMN) String mellannamn,
        @QueryParam(PARAM_PATIENT_POSTADRESS) String postadress,
        @QueryParam(PARAM_PATIENT_POSTNUMMER) String postnummer,
        @QueryParam(PARAM_PATIENT_POSTORT) String postort,
        @DefaultValue("false") @QueryParam(PARAM_COHERENT_JOURNALING) boolean coherentJournaling,
        @QueryParam(PARAM_REFERENCE) String reference,
        @DefaultValue("false") @QueryParam(PARAM_INACTIVE_UNIT) boolean inactiveUnit,
        @DefaultValue("false") @QueryParam(PARAM_PATIENT_DECEASED) boolean deceased,
        @DefaultValue("true") @QueryParam(PARAM_FORNYA_OK) boolean fornyaOk); @GET @Path("{certId}/saved") @PrometheusTimeMethod Response getRedirectToIntyg(@Context UriInfo uriInfo,
        @PathParam(PARAM_CERT_ID) String intygId,
        @DefaultValue("") @QueryParam(PARAM_ENHET_ID) String enhetId); @POST @Path("/{certId}") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) @PrometheusTimeMethod Response postRedirectToIntyg(@Context UriInfo uriInfo,
        @PathParam(PARAM_CERT_ID) String intygId,
        @DefaultValue("") @FormParam(PARAM_ENHET_ID) String enhetId,
        @DefaultValue("") @FormParam(PARAM_PATIENT_ALTERNATE_SSN) String alternatePatientSSn,
        @DefaultValue("") @FormParam(PARAM_RESPONSIBLE_HOSP_NAME) String responsibleHospName,
        @FormParam(PARAM_PATIENT_FORNAMN) String fornamn,
        @FormParam(PARAM_PATIENT_EFTERNAMN) String efternamn,
        @FormParam(PARAM_PATIENT_MELLANNAMN) String mellannamn,
        @FormParam(PARAM_PATIENT_POSTADRESS) String postadress,
        @FormParam(PARAM_PATIENT_POSTNUMMER) String postnummer,
        @FormParam(PARAM_PATIENT_POSTORT) String postort,
        @DefaultValue("false") @FormParam(PARAM_COHERENT_JOURNALING) boolean coherentJournaling,
        @FormParam(PARAM_REFERENCE) String reference,
        @DefaultValue("false") @FormParam(PARAM_INACTIVE_UNIT) boolean inactiveUnit,
        @DefaultValue("false") @FormParam(PARAM_PATIENT_DECEASED) boolean deceased,
        @DefaultValue("true") @FormParam(PARAM_FORNYA_OK) boolean fornyaOk); @GET @Path("/{certType}/{certTypeVersion}/{certId}/resume") @PrometheusTimeMethod Response resumeRedirectToIntyg(
        @Context UriInfo uriInfo,
        @PathParam(PARAM_CERT_TYPE) String intygTyp,
        @PathParam(PARAM_CERT_TYPE_VERSION) String certTypeVersion,
        @PathParam(PARAM_CERT_ID) String intygId,
        @DefaultValue("") @QueryParam(PARAM_ENHET_ID) String enhetId); void setUrlIntygFragmentTemplate(String urlFragmentTemplate); void setUrlUtkastFragmentTemplate(String urlFragmentTemplate); static final String PARAM_CERT_ID; static final String PARAM_CERT_TYPE; static final String PARAM_CERT_TYPE_VERSION; static final String PARAM_ENHET_ID; static final String PARAM_COHERENT_JOURNALING; static final String PARAM_INACTIVE_UNIT; static final String PARAM_FORNYA_OK; static final String PARAM_PATIENT_ALTERNATE_SSN; static final String PARAM_PATIENT_DECEASED; static final String PARAM_PATIENT_EFTERNAMN; static final String PARAM_PATIENT_FORNAMN; static final String PARAM_PATIENT_MELLANNAMN; static final String PARAM_PATIENT_POSTADRESS; static final String PARAM_PATIENT_POSTNUMMER; static final String PARAM_PATIENT_POSTORT; static final String PARAM_REFERENCE; static final String PARAM_RESPONSIBLE_HOSP_NAME; static final String INTYG_TYP; }