allow new ZF2 profiles

This commit is contained in:
Jochen Stärk
2017-11-27 18:31:14 +01:00
parent 0f4dbc1bb5
commit b557dc752c
7 changed files with 65 additions and 17 deletions

View File

@@ -51,13 +51,14 @@ public class MustangReaderWriterCustomXMLTest extends TestCase {
InputStream SOURCE_PDF = this.getClass()
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20170509_505blanko.pdf");
ZUGFeRDExporter zea1 = new ZUGFeRDExporterFromA1Factory().setProducer("My Application").setCreator("Test")
ZUGFeRDExporter zea1 = new ZUGFeRDExporterFromA1Factory().setProducer("My Application").setCreator("Test").setZUGFeRDConformanceLevel(ZUGFeRDConformanceLevel.BASIC)
.load(SOURCE_PDF);
/* we have much more information than just in the basic profile (comfort or extended) but it's perfectly valid to provide more information, just not less. */
String ownZUGFeRDXML = "<rsm:CrossIndustryDocument xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:ram=\"urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:12\" xmlns:udt=\"urn:un:unece:uncefact:data:standard:UnqualifiedDataType:15\" xmlns:rsm=\"urn:ferd:CrossIndustryDocument:invoice:1p0\">\n"
+ "<rsm:SpecifiedExchangedDocumentContext>\n" + "<ram:TestIndicator>\n"
+ "<udt:Indicator>false</udt:Indicator>\n" + "</ram:TestIndicator>\n"
+ "<ram:GuidelineSpecifiedDocumentContextParameter>\n" + "<ram:ID>\n"
+ "urn:ferd:CrossIndustryDocument:invoice:1p0:extended\n" + "</ram:ID>\n"
+ "urn:ferd:CrossIndustryDocument:invoice:1p0:basic\n" + "</ram:ID>\n"
+ "</ram:GuidelineSpecifiedDocumentContextParameter>\n"
+ "</rsm:SpecifiedExchangedDocumentContext>\n" + "<rsm:HeaderExchangedDocument>\n"
+ "<ram:ID>RE-20170509/505</ram:ID>\n" + "<ram:Name>RECHNUNG</ram:Name>\n"

View File

@@ -366,7 +366,7 @@ public class MustangReaderWriterTest extends TestCase implements IZUGFeRDExporta
try (InputStream SOURCE_PDF = this.getClass()
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20171118_506blanko.pdf");
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA1Factory().load(SOURCE_PDF)) {
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA1Factory().load(SOURCE_PDF)) {
ze.setZUGFeRDVersion(2);
ze.PDFattachZugferdFile(this);
@@ -379,6 +379,7 @@ public class MustangReaderWriterTest extends TestCase implements IZUGFeRDExporta
String pdfContent = baos.toString("UTF-8");
assertFalse(pdfContent.indexOf("(via mustangproject.org") == -1);
assertFalse(pdfContent.indexOf("urn:cen.eu:en16931:2017:compliant:factur-x.eu:1p0:extended")==-1);
}
// now check the contents (like MustangReaderTest)