Skip to content

Commit 3fc5a03

Browse files
committed
PDFBOX-5288: improve test coverage
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1930083 13f79535-47bb-0310-9956-ffa450edef68
1 parent 57e46f9 commit 3fc5a03

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

xmpbox/src/test/java/org/apache/xmpbox/xml/DomXmpParserTest.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
import java.nio.charset.StandardCharsets;
2727

2828
import org.apache.xmpbox.XMPMetadata;
29+
import org.apache.xmpbox.schema.XMPMediaManagementSchema;
30+
import org.apache.xmpbox.type.ArrayProperty;
31+
import org.apache.xmpbox.type.ResourceEventType;
2932

3033
import org.junit.jupiter.api.Assertions;
3134
import org.junit.jupiter.api.Test;
@@ -148,6 +151,11 @@ void testPDFBox5288() throws XmpParsingException
148151
"</x:xmpmeta><?xpacket end=\"w\"?>";
149152
DomXmpParser xmpParser = new DomXmpParser();
150153
XMPMetadata xmp = xmpParser.parse(s.getBytes(StandardCharsets.UTF_8));
151-
Assertions.assertNotNull(xmp.getXMPMediaManagementSchema());
154+
XMPMediaManagementSchema xmpMediaManagementSchema = xmp.getXMPMediaManagementSchema();
155+
Assertions.assertEquals("uidd:1f0e03977b90b6365a376454ffdf34a7", xmpMediaManagementSchema.getDocumentID());
156+
ArrayProperty historyProperty = xmpMediaManagementSchema.getHistoryProperty();
157+
ResourceEventType firstHistoryEntry = (ResourceEventType) historyProperty.getAllProperties().iterator().next();
158+
Assertions.assertEquals("created", firstHistoryEntry.getAction());
159+
Assertions.assertEquals("iDRS PDF output engine 7", firstHistoryEntry.getParameters());
152160
}
153161
}

0 commit comments

Comments
 (0)