Skip to content

Commit

Permalink
leave ubl test for branch issues/503
Browse files Browse the repository at this point in the history
  • Loading branch information
jstaerk committed Nov 17, 2024
1 parent bf41558 commit d1aefed
Showing 1 changed file with 1 addition and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -350,11 +350,7 @@ public void testImportDebit() {


}






public void testImportMinimum() {
File CIIinputFile = getResourceAsFile("cii/facturFrMinimum.xml");
try {
Expand All @@ -375,59 +371,5 @@ public void testImportMinimum() {


}
/*
this would test if for all elements/attributes
*/

public void testEEISI_300_cii_Import() throws XPathExpressionException, ParseException {
boolean hasExceptions = false;
File inputCII = getResourceAsFile("not_validating_full_invoice_based_onTest_EeISI_300_CENfullmodel.cii.xml");
File inputUBL = getResourceAsFile("not_validating_full_invoice_based_onTest_EeISI_300_CENfullmodel.ubl.xml");


ZUGFeRDInvoiceImporter zii = new ZUGFeRDInvoiceImporter();
try {
zii.fromXML(new String(Files.readAllBytes(inputCII.toPath()), StandardCharsets.UTF_8));

} catch (IOException e) {
hasExceptions = true;
}

Invoice invoiceUBL = null;
invoiceUBL = zii.extractInvoice();

try {
zii.fromXML(new String(Files.readAllBytes(inputUBL.toPath()), StandardCharsets.UTF_8));

} catch (IOException e) {
hasExceptions = true;
}

Invoice invoiceCII = null;
try {
invoiceCII = zii.extractInvoice();
ObjectMapper mapper = new ObjectMapper();
String ubl=mapper.writeValueAsString(invoiceUBL).replace("," ,"\n");
String cii=mapper.writeValueAsString(invoiceCII).replace("," ,"\n");

assertEquals(cii,ubl);


/*
<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;
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
assertFalse(hasExceptions);

// TransactionCalculator tc = new TransactionCalculator(invoiceCII);
// assertEquals(new BigDecimal("205.00"), tc.getGrandTotal());

}


}

0 comments on commit d1aefed

Please sign in to comment.