Skip to content

Commit 3b69a89

Browse files
author
Dmitry Radchuk
committed
Add null event map test
DEVSIX-7418
1 parent b0ded2b commit 3b69a89

File tree

2 files changed

+20
-246
lines changed

2 files changed

+20
-246
lines changed

kernel/src/main/java/com/itextpdf/kernel/pdf/function/PdfFunction.java

Lines changed: 0 additions & 246 deletions
This file was deleted.

kernel/src/test/java/com/itextpdf/kernel/actions/events/FlushPdfDocumentEventTest.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,15 @@ public void doActionNullDocumentTest() {
141141
AssertUtil.doesNotThrow(() -> closeEvent.doAction());
142142
}
143143

144+
@Test
145+
public void doActionNullEventMapTest() throws IOException {
146+
try (PdfDocument document = new DummyPdfDocument(new PdfReader(SOURCE_FOLDER + "hello.pdf"))) {
147+
AssertUtil.doesNotThrow(() -> new FlushPdfDocumentEvent(document).doAction());
148+
Assert.assertTrue(document.getDocumentInfo().getProducer()
149+
.contains("Apryse Group NV (no registered products)"));
150+
}
151+
}
152+
144153
@Test
145154
public void flushEventAfterEachEventTest() throws IOException {
146155
String resourceInit = SOURCE_FOLDER + "hello.pdf";
@@ -157,6 +166,17 @@ public void flushEventAfterEachEventTest() throws IOException {
157166
}
158167
}
159168

169+
private static class DummyPdfDocument extends PdfDocument {
170+
171+
public DummyPdfDocument(PdfReader reader) {
172+
super(reader);
173+
}
174+
175+
public SequenceId getDocumentIdWrapper() {
176+
return null;
177+
}
178+
}
179+
160180
private static class TestProductEventProcessor implements ITextProductEventProcessor {
161181
private final String processorId;
162182

0 commit comments

Comments
 (0)