@Test public void testGetIntygAsPdfForEmployer() { final String intygType = "fk7263"; setupUser(AuthoritiesConstants.PRIVILEGE_VISA_INTYG, intygType, false, true, AuthoritiesConstants.FEATURE_ARBETSGIVARUTSKRIFT); IntygPdf pdfResponse = new IntygPdf(PDF_DATA, PDF_NAME); when(intygService.fetchIntygAsPdf(CERTIFICATE_ID, intygType, true)).thenReturn(pdfResponse); Response response = moduleApiController.getIntygAsPdfForEmployer(intygType, CERTIFICATE_ID); verify(intygService).fetchIntygAsPdf(CERTIFICATE_ID, intygType, true); assertEquals(OK.getStatusCode(), response.getStatus()); assertEquals(PDF_DATA, response.getEntity()); assertNotNull(response.getHeaders().get(CONTENT_DISPOSITION)); }
@GET @Path("/{intygsTyp}/{intygsId}/pdf/arbetsgivarutskrift") @Produces("application/pdf") public final Response getIntygAsPdfForEmployer(@PathParam("intygsTyp") String intygsTyp, @PathParam(value = "intygsId") final String intygsId) { return getPdf(intygsTyp, intygsId, true); }
IntygModuleApiController extends AbstractApiController { @GET @Path("/{intygsTyp}/{intygsId}/pdf/arbetsgivarutskrift") @Produces("application/pdf") public final Response getIntygAsPdfForEmployer(@PathParam("intygsTyp") String intygsTyp, @PathParam(value = "intygsId") final String intygsId) { return getPdf(intygsTyp, intygsId, true); } }
IntygModuleApiController extends AbstractApiController { @GET @Path("/{intygsTyp}/{intygsId}/pdf/arbetsgivarutskrift") @Produces("application/pdf") public final Response getIntygAsPdfForEmployer(@PathParam("intygsTyp") String intygsTyp, @PathParam(value = "intygsId") final String intygsId) { return getPdf(intygsTyp, intygsId, true); }  }
IntygModuleApiController extends AbstractApiController { @GET @Path("/{intygsTyp}/{intygsId}/pdf/arbetsgivarutskrift") @Produces("application/pdf") public final Response getIntygAsPdfForEmployer(@PathParam("intygsTyp") String intygsTyp, @PathParam(value = "intygsId") final String intygsId) { return getPdf(intygsTyp, intygsId, true); }  @GET @Path("/{intygsTyp}/{intygsId}") @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) Response getIntyg(@PathParam("intygsTyp") String intygsTyp, @PathParam("intygsId") String intygsId); @GET @Path("/{intygsTyp}/{intygsId}/pdf") @Produces("application/pdf") final Response getIntygAsPdf(@PathParam("intygsTyp") String intygsTyp, @PathParam(value = "intygsId") final String intygsId); @GET @Path("/{intygsTyp}/{intygsId}/pdf/arbetsgivarutskrift") @Produces("application/pdf") final Response getIntygAsPdfForEmployer(@PathParam("intygsTyp") String intygsTyp,
        @PathParam(value = "intygsId") final String intygsId); @POST @Path("/{intygsTyp}/{intygsId}/skicka") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) Response sendSignedIntyg(@PathParam("intygsTyp") String intygsTyp, @PathParam("intygsId") String intygsId,
        SendSignedIntygParameter param); @POST @Path("/{intygsTyp}/{intygsId}/aterkalla") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) Response revokeSignedIntyg(@PathParam("intygsTyp") String intygsTyp, @PathParam("intygsId") String intygsId,
        RevokeSignedIntygParameter param); @POST @Path("/{intygsTyp}/{intygsId}/komplettera") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) Response createCompletion(CopyIntygRequest request, @PathParam("intygsTyp") String intygsTyp,
        @PathParam("intygsId") String orgIntygsId); @POST @Path("/{intygsTyp}/{intygsId}/fornya") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) Response createRenewal(CopyIntygRequest request, @PathParam("intygsTyp") String intygsTyp,
        @PathParam("intygsId") String orgIntygsId); @POST @Path("/{intygsTyp}/{intygsId}/{newIntygsTyp}/create") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) Response createUtkastFromSignedTemplate(CopyIntygRequest request, @PathParam("intygsTyp") String orgIntygsTyp,
        @PathParam("intygsId") String orgIntygsId, @PathParam("newIntygsTyp") String newIntygsTyp); @POST @Path("/{intygsTyp}/{intygsId}/ersatt") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) Response createReplacement(CopyIntygRequest request, @PathParam("intygsTyp") String intygsTyp,
        @PathParam("intygsId") String orgIntygsId); }
IntygModuleApiController extends AbstractApiController { @GET @Path("/{intygsTyp}/{intygsId}/pdf/arbetsgivarutskrift") @Produces("application/pdf") public final Response getIntygAsPdfForEmployer(@PathParam("intygsTyp") String intygsTyp, @PathParam(value = "intygsId") final String intygsId) { return getPdf(intygsTyp, intygsId, true); }  @GET @Path("/{intygsTyp}/{intygsId}") @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) Response getIntyg(@PathParam("intygsTyp") String intygsTyp, @PathParam("intygsId") String intygsId); @GET @Path("/{intygsTyp}/{intygsId}/pdf") @Produces("application/pdf") final Response getIntygAsPdf(@PathParam("intygsTyp") String intygsTyp, @PathParam(value = "intygsId") final String intygsId); @GET @Path("/{intygsTyp}/{intygsId}/pdf/arbetsgivarutskrift") @Produces("application/pdf") final Response getIntygAsPdfForEmployer(@PathParam("intygsTyp") String intygsTyp,
        @PathParam(value = "intygsId") final String intygsId); @POST @Path("/{intygsTyp}/{intygsId}/skicka") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) Response sendSignedIntyg(@PathParam("intygsTyp") String intygsTyp, @PathParam("intygsId") String intygsId,
        SendSignedIntygParameter param); @POST @Path("/{intygsTyp}/{intygsId}/aterkalla") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) Response revokeSignedIntyg(@PathParam("intygsTyp") String intygsTyp, @PathParam("intygsId") String intygsId,
        RevokeSignedIntygParameter param); @POST @Path("/{intygsTyp}/{intygsId}/komplettera") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) Response createCompletion(CopyIntygRequest request, @PathParam("intygsTyp") String intygsTyp,
        @PathParam("intygsId") String orgIntygsId); @POST @Path("/{intygsTyp}/{intygsId}/fornya") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) Response createRenewal(CopyIntygRequest request, @PathParam("intygsTyp") String intygsTyp,
        @PathParam("intygsId") String orgIntygsId); @POST @Path("/{intygsTyp}/{intygsId}/{newIntygsTyp}/create") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) Response createUtkastFromSignedTemplate(CopyIntygRequest request, @PathParam("intygsTyp") String orgIntygsTyp,
        @PathParam("intygsId") String orgIntygsId, @PathParam("newIntygsTyp") String newIntygsTyp); @POST @Path("/{intygsTyp}/{intygsId}/ersatt") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) Response createReplacement(CopyIntygRequest request, @PathParam("intygsTyp") String intygsTyp,
        @PathParam("intygsId") String orgIntygsId);  }