added eeisi test

This commit is contained in:
jstaerk
2024-09-20 11:53:30 +02:00
parent 3d9bfbfa36
commit c8beb71b15

View File

@@ -313,4 +313,36 @@ public class ZF2ZInvoiceImporterTest extends ResourceCase {
}
public void testEEISI_300_cii_Import() {
boolean hasExceptions = false;
File input = getResourceAsFile("not_validating_full_invoice_based_onTest_EeISI_300_CENfullmodel2.ubl.xml");
ZUGFeRDInvoiceImporter zii = new ZUGFeRDInvoiceImporter();
try {
zii.fromXML(new String(Files.readAllBytes(input.toPath()), StandardCharsets.UTF_8));
} catch (IOException e) {
hasExceptions = true;
}
Invoice invoice = null;
try {
invoice = zii.extractInvoice();
assertEquals("Seller contact point",invoice.getSender().getName());
/*
<cbc:Name>Seller contact point</cbc:Name>
<cbc:Telephone>+41 345 654455</cbc:Telephone>
<cbc:ElectronicMail>seller@contact.de);*/
} catch (XPathExpressionException | ParseException e) {
hasExceptions = true;
}
assertFalse(hasExceptions);
TransactionCalculator tc = new TransactionCalculator(invoice);
assertEquals(new BigDecimal("205.00"), tc.getGrandTotal());
}
}