@Test public void should_check_personal_certificate() throws Exception { byte[] bytes = new byte[] {1, 2}; doThrow(PersonalCertificateException.class).when(personalCertificateService) .checkPersonalCertificateExistence(bytes, PERMISSION); assertThatThrownBy(() -> personalCertificateResource.checkPersonalCertificate(bytes, PERMISSION)) .isInstanceOf(PersonalCertificateException.class); }
@Path("/personal-certificate-check/{permission}") @GET @Consumes(MediaType.APPLICATION_OCTET_STREAM) public void checkPersonalCertificate(byte[] certificate, @PathParam("permission") String permission) throws LogbookClientServerException, LogbookClientAlreadyExistsException, LogbookClientBadRequestException, InvalidParseOperationException, PersonalCertificateException { ParametersChecker.checkParameter("Permission cannot be null", permission); personalCertificateService.checkPersonalCertificateExistence(certificate, permission); }
PersonalCertificateResource { @Path("/personal-certificate-check/{permission}") @GET @Consumes(MediaType.APPLICATION_OCTET_STREAM) public void checkPersonalCertificate(byte[] certificate, @PathParam("permission") String permission) throws LogbookClientServerException, LogbookClientAlreadyExistsException, LogbookClientBadRequestException, InvalidParseOperationException, PersonalCertificateException { ParametersChecker.checkParameter("Permission cannot be null", permission); personalCertificateService.checkPersonalCertificateExistence(certificate, permission); } }
PersonalCertificateResource { @Path("/personal-certificate-check/{permission}") @GET @Consumes(MediaType.APPLICATION_OCTET_STREAM) public void checkPersonalCertificate(byte[] certificate, @PathParam("permission") String permission) throws LogbookClientServerException, LogbookClientAlreadyExistsException, LogbookClientBadRequestException, InvalidParseOperationException, PersonalCertificateException { ParametersChecker.checkParameter("Permission cannot be null", permission); personalCertificateService.checkPersonalCertificateExistence(certificate, permission); } PersonalCertificateResource(
        PermissionService permissionService,
        PersonalCertificateService personalCertificateService); }
PersonalCertificateResource { @Path("/personal-certificate-check/{permission}") @GET @Consumes(MediaType.APPLICATION_OCTET_STREAM) public void checkPersonalCertificate(byte[] certificate, @PathParam("permission") String permission) throws LogbookClientServerException, LogbookClientAlreadyExistsException, LogbookClientBadRequestException, InvalidParseOperationException, PersonalCertificateException { ParametersChecker.checkParameter("Permission cannot be null", permission); personalCertificateService.checkPersonalCertificateExistence(certificate, 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 { @Path("/personal-certificate-check/{permission}") @GET @Consumes(MediaType.APPLICATION_OCTET_STREAM) public void checkPersonalCertificate(byte[] certificate, @PathParam("permission") String permission) throws LogbookClientServerException, LogbookClientAlreadyExistsException, LogbookClientBadRequestException, InvalidParseOperationException, PersonalCertificateException { ParametersChecker.checkParameter("Permission cannot be null", permission); personalCertificateService.checkPersonalCertificateExistence(certificate, 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);  }