@Test public void isPersonalCertificateRequiredForPermission() throws Exception { IsPersonalCertificateRequiredModel response = mock(IsPersonalCertificateRequiredModel.class); when(permissionService.isPersonalCertificateRequiredForPermission(PERMISSION)) .thenReturn(response); assertThat(personalCertificateResource.isPersonalCertificateRequiredForPermission(PERMISSION)) .isEqualTo(response); }
@GET @Path("/permission-check/{permission}") @Produces(MediaType.APPLICATION_JSON) public IsPersonalCertificateRequiredModel isPersonalCertificateRequiredForPermission( @PathParam("permission") String permission) { ParametersChecker.checkParameter("Permission cannot be null", permission); return permissionService.isPersonalCertificateRequiredForPermission(permission); }
PersonalCertificateResource { @GET @Path("/permission-check/{permission}") @Produces(MediaType.APPLICATION_JSON) public IsPersonalCertificateRequiredModel isPersonalCertificateRequiredForPermission( @PathParam("permission") String permission) { ParametersChecker.checkParameter("Permission cannot be null", permission); return permissionService.isPersonalCertificateRequiredForPermission(permission); } }
PersonalCertificateResource { @GET @Path("/permission-check/{permission}") @Produces(MediaType.APPLICATION_JSON) public IsPersonalCertificateRequiredModel isPersonalCertificateRequiredForPermission( @PathParam("permission") String permission) { ParametersChecker.checkParameter("Permission cannot be null", permission); return permissionService.isPersonalCertificateRequiredForPermission(permission); } PersonalCertificateResource(
        PermissionService permissionService,
        PersonalCertificateService personalCertificateService); }
PersonalCertificateResource { @GET @Path("/permission-check/{permission}") @Produces(MediaType.APPLICATION_JSON) public IsPersonalCertificateRequiredModel isPersonalCertificateRequiredForPermission( @PathParam("permission") String permission) { ParametersChecker.checkParameter("Permission cannot be null", permission); return permissionService.isPersonalCertificateRequiredForPermission(permission); } PersonalCertificateResource(
        PermissionService permissionService,
        PersonalCertificateService personalCertificateService); @Path("/personal-certificate-check/{permission}") @GET @Consumes(MediaType.APPLICATION_OCTET_STREAM) void checkPersonalCertificate(byte[] certificate,
        @PathParam("permission") String permission); @GET @Path("/permission-check/{permission}") @Produces(MediaType.APPLICATION_JSON) IsPersonalCertificateRequiredModel isPersonalCertificateRequiredForPermission(
        @PathParam("permission") String permission); }
PersonalCertificateResource { @GET @Path("/permission-check/{permission}") @Produces(MediaType.APPLICATION_JSON) public IsPersonalCertificateRequiredModel isPersonalCertificateRequiredForPermission( @PathParam("permission") String permission) { ParametersChecker.checkParameter("Permission cannot be null", permission); return permissionService.isPersonalCertificateRequiredForPermission(permission); } PersonalCertificateResource(
        PermissionService permissionService,
        PersonalCertificateService personalCertificateService); @Path("/personal-certificate-check/{permission}") @GET @Consumes(MediaType.APPLICATION_OCTET_STREAM) void checkPersonalCertificate(byte[] certificate,
        @PathParam("permission") String permission); @GET @Path("/permission-check/{permission}") @Produces(MediaType.APPLICATION_JSON) IsPersonalCertificateRequiredModel isPersonalCertificateRequiredForPermission(
        @PathParam("permission") String permission);  }