@Test public void testRegisterApprovedReceivers() { setupUser(AuthoritiesConstants.PRIVILEGE_GODKANNA_MOTTAGARE, "LISJP"); Response resp = receiverApiController.registerApprovedReceivers("LISJP", INTYG_ID, Arrays.asList("FKASSA")); assertNotNull(resp); assertEquals(200, resp.getStatus()); verify(certificateReceiverService, times(1)).registerApprovedReceivers(anyString(), anyString(), anyList()); }
@POST @Path("/registerapproved/{intygsTyp}/{intygsId}") @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @Consumes(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @PrometheusTimeMethod public Response registerApprovedReceivers(@PathParam("intygsTyp") String intygsTyp, @PathParam("intygsId") String intygsId, List<String> receiverIds) { authoritiesValidator .given(getWebCertUserService().getUser(), intygsTyp) .privilege(AuthoritiesConstants.PRIVILEGE_GODKANNA_MOTTAGARE) .orThrow(); certificateReceiverService.registerApprovedReceivers(intygsId, intygsTyp, receiverIds); return Response.ok().build(); }
ReceiverApiController extends AbstractApiController { @POST @Path("/registerapproved/{intygsTyp}/{intygsId}") @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @Consumes(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @PrometheusTimeMethod public Response registerApprovedReceivers(@PathParam("intygsTyp") String intygsTyp, @PathParam("intygsId") String intygsId, List<String> receiverIds) { authoritiesValidator .given(getWebCertUserService().getUser(), intygsTyp) .privilege(AuthoritiesConstants.PRIVILEGE_GODKANNA_MOTTAGARE) .orThrow(); certificateReceiverService.registerApprovedReceivers(intygsId, intygsTyp, receiverIds); return Response.ok().build(); } }
ReceiverApiController extends AbstractApiController { @POST @Path("/registerapproved/{intygsTyp}/{intygsId}") @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @Consumes(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @PrometheusTimeMethod public Response registerApprovedReceivers(@PathParam("intygsTyp") String intygsTyp, @PathParam("intygsId") String intygsId, List<String> receiverIds) { authoritiesValidator .given(getWebCertUserService().getUser(), intygsTyp) .privilege(AuthoritiesConstants.PRIVILEGE_GODKANNA_MOTTAGARE) .orThrow(); certificateReceiverService.registerApprovedReceivers(intygsId, intygsTyp, receiverIds); return Response.ok().build(); }  }
ReceiverApiController extends AbstractApiController { @POST @Path("/registerapproved/{intygsTyp}/{intygsId}") @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @Consumes(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @PrometheusTimeMethod public Response registerApprovedReceivers(@PathParam("intygsTyp") String intygsTyp, @PathParam("intygsId") String intygsId, List<String> receiverIds) { authoritiesValidator .given(getWebCertUserService().getUser(), intygsTyp) .privilege(AuthoritiesConstants.PRIVILEGE_GODKANNA_MOTTAGARE) .orThrow(); certificateReceiverService.registerApprovedReceivers(intygsId, intygsTyp, receiverIds); return Response.ok().build(); }  @GET @Path("/approvedreceivers/{intygsTyp}/{intygsId}") @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @PrometheusTimeMethod Response listApprovedReceivers(@PathParam("intygsTyp") String intygsTyp, @PathParam("intygsId") String intygsId); @GET @Path("/possiblereceivers/{intygsTyp}") @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @PrometheusTimeMethod Response listApprovedReceivers(@PathParam("intygsTyp") String intygsTyp); @POST @Path("/registerapproved/{intygsTyp}/{intygsId}") @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @Consumes(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @PrometheusTimeMethod Response registerApprovedReceivers(@PathParam("intygsTyp") String intygsTyp, @PathParam("intygsId") String intygsId,
        List<String> receiverIds); }
ReceiverApiController extends AbstractApiController { @POST @Path("/registerapproved/{intygsTyp}/{intygsId}") @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @Consumes(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @PrometheusTimeMethod public Response registerApprovedReceivers(@PathParam("intygsTyp") String intygsTyp, @PathParam("intygsId") String intygsId, List<String> receiverIds) { authoritiesValidator .given(getWebCertUserService().getUser(), intygsTyp) .privilege(AuthoritiesConstants.PRIVILEGE_GODKANNA_MOTTAGARE) .orThrow(); certificateReceiverService.registerApprovedReceivers(intygsId, intygsTyp, receiverIds); return Response.ok().build(); }  @GET @Path("/approvedreceivers/{intygsTyp}/{intygsId}") @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @PrometheusTimeMethod Response listApprovedReceivers(@PathParam("intygsTyp") String intygsTyp, @PathParam("intygsId") String intygsId); @GET @Path("/possiblereceivers/{intygsTyp}") @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @PrometheusTimeMethod Response listApprovedReceivers(@PathParam("intygsTyp") String intygsTyp); @POST @Path("/registerapproved/{intygsTyp}/{intygsId}") @Produces(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @Consumes(MediaType.APPLICATION_JSON + UTF_8_CHARSET) @PrometheusTimeMethod Response registerApprovedReceivers(@PathParam("intygsTyp") String intygsTyp, @PathParam("intygsId") String intygsId,
        List<String> receiverIds);  }