File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
java/com/itextpdf/kernel/crypto
resources/com/itextpdf/kernel/crypto/PdfReaderCustomFilterTest Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ package com .itextpdf .kernel .crypto ;
2
+
3
+ import com .itextpdf .io .util .MessageFormatUtil ;
4
+ import com .itextpdf .kernel .crypto .securityhandler .UnsupportedSecurityHandlerException ;
5
+ import com .itextpdf .kernel .pdf .PdfDocument ;
6
+ import com .itextpdf .kernel .pdf .PdfReader ;
7
+ import com .itextpdf .test .ExtendedITextTest ;
8
+ import com .itextpdf .test .annotations .type .IntegrationTest ;
9
+
10
+ import java .io .IOException ;
11
+ import org .junit .Rule ;
12
+ import org .junit .Test ;
13
+ import org .junit .experimental .categories .Category ;
14
+ import org .junit .rules .ExpectedException ;
15
+
16
+ @ Category (IntegrationTest .class )
17
+ public class PdfReaderCustomFilterTest extends ExtendedITextTest {
18
+ public static final String sourceFolder = "./src/test/resources/com/itextpdf/kernel/crypto/PdfReaderCustomFilterTest/" ;
19
+
20
+ @ Rule
21
+ public ExpectedException junitExpectedException = ExpectedException .none ();
22
+
23
+ @ Test
24
+ public void encryptedDocumentCustomFilterStandartTest () throws IOException {
25
+ junitExpectedException .expect (UnsupportedSecurityHandlerException .class );
26
+ junitExpectedException .expectMessage (MessageFormatUtil .
27
+ format (UnsupportedSecurityHandlerException .UnsupportedSecurityHandler , "/Standart" ));
28
+
29
+ PdfDocument doc = new PdfDocument (new PdfReader (sourceFolder + "customSecurityHandler.pdf" ));
30
+ doc .close ();
31
+ }
32
+ }
You can’t perform that action at this time.
0 commit comments