Table of Contents
A fluent assertion library for testing document content in JUnit test cases, designed for structured formats like PDF, XML, Word and Excel.
Right now is’s more or less a quick hack, for basic usage see the JUnit test files.
-
Fluent assertions on binary document content (byte arrays, input streams)
-
Supported formats:
-
Text
-
CSV
-
JSON
-
XML
-
-
Word (DOCX)
-
Excel (XLSX)
-
PDF
-
Images
-
PNG
-
JPEG
-
GIF
-
-
ZIP
-
assertDoc(pdfBytes)
.asPDF()
.hasText("Bill")
.hasPageCount(1);
assertDoc(imageBytes)
.asJpeg()
.hasImageSize(100, 100);
.hasCaption("Testimage")
.hasAverageRgbDeltaLessThan(image2Bytes, 3.0);
assertDoc(xmlBytes)
.asXml()
.hasXPath("//total", "100.00")
.hasRootElement("invoice");
assertDoc(jsonBytes)
.asJSON()
.hasValue("$.user.id", "42");|
Warning
|
alpha/wip/poc code |