CrlResource { @ApiOperation(notes = "Retrieves the Certificate Revocation List", value = "getCurrentCrl", response = String.class) @GET @Produces(MediaType.TEXT_PLAIN) public Response getCurrentCrl(@Context Principal principal) throws CRLException { String filePath = getCrlFilePath(); File crlFile = new File(filePath); try { this.crlFileUtil.syncCRLWithDB(crlFile); if (!crlFile.exists() || crlFile.length() < 1) { pkiUtility.writePemEncoded( pkiUtility.createX509CRL(new LinkedList<>(), BigInteger.ONE), new FileOutputStream(crlFile) ); } return Response.ok().entity(new FileInputStream(crlFile)).build(); } catch (IOException e) { throw new IseException(e.getMessage(), e); } } @Inject  CrlResource(Configuration config, CrlFileUtil crlFileUtil, PKIUtility pkiUtility,
        CertificateSerialCurator certificateSerialCurator); @ApiOperation(notes = "Retrieves the Certificate Revocation List", value = "getCurrentCrl", response = String.class) @GET @Produces(MediaType.TEXT_PLAIN) Response getCurrentCrl(@Context Principal principal); @ApiOperation(notes = "Deletes a Certificate from the Revocation List", value = "unrevoke") @DELETE @Produces(MediaType.APPLICATION_JSON) void unrevoke(@QueryParam("serial") String[] serialIds);  }
@Test public void testGetCurrentCrl() throws Exception { Object response = this.resource.getCurrentCrl(null); assertTrue(response != null); verify(crlFileUtil).syncCRLWithDB(any(File.class)); }
@Test public void testGetCurrentCrlWithNoFile() throws Exception { this.cleanup(); Object response = this.resource.getCurrentCrl(null); assertTrue(response != null); verify(crlFileUtil).syncCRLWithDB(any(File.class)); }