@Test(expected = WebCertServiceException.class) public void testRevokeSignedIntygMissingParameter() { final String intygType = "fk7263"; final String revokeMessage = ""; final String revokeReason = ""; setupUser(AuthoritiesConstants.PRIVILEGE_MAKULERA_INTYG, intygType, false, true, AuthoritiesConstants.FEATURE_MAKULERA_INTYG, AuthoritiesConstants.FEATURE_MAKULERA_INTYG_KRAVER_ANLEDNING); RevokeSignedIntygParameter param = new RevokeSignedIntygParameter(); param.setMessage(revokeMessage); param.setReason(revokeReason); moduleApiController.revokeSignedIntyg(intygType, CERTIFICATE_ID, param); }
@POST @Path("/{intygsTyp}/{intygsId}/aterkalla") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) public Response revokeSignedIntyg(@PathParam("intygsTyp") String intygsTyp, @PathParam("intygsId") String intygsId, RevokeSignedIntygParameter param) { if (authoritiesValidator.given(getWebCertUserService().getUser(), intygsTyp) .features(AuthoritiesConstants.FEATURE_MAKULERA_INTYG_KRAVER_ANLEDNING).isVerified() && !param.isValid()) { LOG.warn("Request to revoke '{}' is not valid", intygsId); throw new WebCertServiceException(WebCertServiceErrorCodeEnum.INTERNAL_PROBLEM, "Missing vital arguments in payload"); } IntygServiceResult result = intygService.revokeIntyg(intygsId, intygsTyp, param.getMessage(), param.getReason()); return Response.ok(result).build(); }
IntygModuleApiController extends AbstractApiController { @POST @Path("/{intygsTyp}/{intygsId}/aterkalla") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) public Response revokeSignedIntyg(@PathParam("intygsTyp") String intygsTyp, @PathParam("intygsId") String intygsId, RevokeSignedIntygParameter param) { if (authoritiesValidator.given(getWebCertUserService().getUser(), intygsTyp) .features(AuthoritiesConstants.FEATURE_MAKULERA_INTYG_KRAVER_ANLEDNING).isVerified() && !param.isValid()) { LOG.warn("Request to revoke '{}' is not valid", intygsId); throw new WebCertServiceException(WebCertServiceErrorCodeEnum.INTERNAL_PROBLEM, "Missing vital arguments in payload"); } IntygServiceResult result = intygService.revokeIntyg(intygsId, intygsTyp, param.getMessage(), param.getReason()); return Response.ok(result).build(); } }
IntygModuleApiController extends AbstractApiController { @POST @Path("/{intygsTyp}/{intygsId}/aterkalla") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) public Response revokeSignedIntyg(@PathParam("intygsTyp") String intygsTyp, @PathParam("intygsId") String intygsId, RevokeSignedIntygParameter param) { if (authoritiesValidator.given(getWebCertUserService().getUser(), intygsTyp) .features(AuthoritiesConstants.FEATURE_MAKULERA_INTYG_KRAVER_ANLEDNING).isVerified() && !param.isValid()) { LOG.warn("Request to revoke '{}' is not valid", intygsId); throw new WebCertServiceException(WebCertServiceErrorCodeEnum.INTERNAL_PROBLEM, "Missing vital arguments in payload"); } IntygServiceResult result = intygService.revokeIntyg(intygsId, intygsTyp, param.getMessage(), param.getReason()); return Response.ok(result).build(); }  }
IntygModuleApiController extends AbstractApiController { @POST @Path("/{intygsTyp}/{intygsId}/aterkalla") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) public Response revokeSignedIntyg(@PathParam("intygsTyp") String intygsTyp, @PathParam("intygsId") String intygsId, RevokeSignedIntygParameter param) { if (authoritiesValidator.given(getWebCertUserService().getUser(), intygsTyp) .features(AuthoritiesConstants.FEATURE_MAKULERA_INTYG_KRAVER_ANLEDNING).isVerified() && !param.isValid()) { LOG.warn("Request to revoke '{}' is not valid", intygsId); throw new WebCertServiceException(WebCertServiceErrorCodeEnum.INTERNAL_PROBLEM, "Missing vital arguments in payload"); } IntygServiceResult result = intygService.revokeIntyg(intygsId, intygsTyp, param.getMessage(), param.getReason()); return Response.ok(result).build(); }  @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 { @POST @Path("/{intygsTyp}/{intygsId}/aterkalla") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) public Response revokeSignedIntyg(@PathParam("intygsTyp") String intygsTyp, @PathParam("intygsId") String intygsId, RevokeSignedIntygParameter param) { if (authoritiesValidator.given(getWebCertUserService().getUser(), intygsTyp) .features(AuthoritiesConstants.FEATURE_MAKULERA_INTYG_KRAVER_ANLEDNING).isVerified() && !param.isValid()) { LOG.warn("Request to revoke '{}' is not valid", intygsId); throw new WebCertServiceException(WebCertServiceErrorCodeEnum.INTERNAL_PROBLEM, "Missing vital arguments in payload"); } IntygServiceResult result = intygService.revokeIntyg(intygsId, intygsTyp, param.getMessage(), param.getReason()); return Response.ok(result).build(); }  @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);  }