From cde12698f4534f699cddd2e3fbafabf09bad9f26 Mon Sep 17 00:00:00 2001 From: aaron-kumar Date: Sun, 12 Jun 2022 20:34:37 +0530 Subject: [PATCH] Added PINT Dynamic Document Type Scheme support --- .../outbound/lookup/CachedLookupServiceTest.java | 2 +- .../outbound/lookup/DefaultLookupServiceTest.java | 10 ++++++++++ .../oxalis/outbound/lookup/LookupServiceTest.java | 15 +++++++++++++++ ...missionRequestBuilderWithoutOverridesTest.java | 4 ++-- pom.xml | 2 +- 5 files changed, 29 insertions(+), 4 deletions(-) diff --git a/oxalis-outbound/src/test/java/network/oxalis/outbound/lookup/CachedLookupServiceTest.java b/oxalis-outbound/src/test/java/network/oxalis/outbound/lookup/CachedLookupServiceTest.java index a5147c959..e787da60f 100644 --- a/oxalis-outbound/src/test/java/network/oxalis/outbound/lookup/CachedLookupServiceTest.java +++ b/oxalis-outbound/src/test/java/network/oxalis/outbound/lookup/CachedLookupServiceTest.java @@ -41,7 +41,7 @@ public class CachedLookupServiceTest { "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##" + "urn:cen.eu:en16931:2017#compliant#" + "urn:fdc:peppol.eu:2017:poacc:billing:3.0" + - "::2.1"); + "::2.1", DocumentTypeIdentifier.BUSDOX_DOCID_QNS_SCHEME); private static ProcessIdentifier process = ProcessIdentifier.of("urn:fdc:peppol.eu:2017:poacc:billing:01:1.0"); diff --git a/oxalis-outbound/src/test/java/network/oxalis/outbound/lookup/DefaultLookupServiceTest.java b/oxalis-outbound/src/test/java/network/oxalis/outbound/lookup/DefaultLookupServiceTest.java index f4aa1c5a0..0b6aa85c6 100644 --- a/oxalis-outbound/src/test/java/network/oxalis/outbound/lookup/DefaultLookupServiceTest.java +++ b/oxalis-outbound/src/test/java/network/oxalis/outbound/lookup/DefaultLookupServiceTest.java @@ -49,6 +49,16 @@ public void simple() throws Exception { Assert.assertNotNull(endpoint); } + @Test + public void simpleBusdoxDocIdQnsScheme() throws Exception { + Endpoint endpoint = lookupService.lookup(Header.newInstance() + .receiver(ParticipantIdentifier.of("0208:0871221633")) + .documentType(DocumentTypeIdentifier.of("urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0::2.1", DocumentTypeIdentifier.BUSDOX_DOCID_QNS_SCHEME)) + .process(ProcessIdentifier.of("urn:fdc:peppol.eu:2017:poacc:billing:01:1.0"))); + + Assert.assertNotNull(endpoint); + } + @Test(expectedExceptions = OxalisTransmissionException.class) public void triggerException() throws Exception { lookupService.lookup(Header.newInstance() diff --git a/oxalis-outbound/src/test/java/network/oxalis/outbound/lookup/LookupServiceTest.java b/oxalis-outbound/src/test/java/network/oxalis/outbound/lookup/LookupServiceTest.java index faf323750..aabc33f90 100644 --- a/oxalis-outbound/src/test/java/network/oxalis/outbound/lookup/LookupServiceTest.java +++ b/oxalis-outbound/src/test/java/network/oxalis/outbound/lookup/LookupServiceTest.java @@ -49,4 +49,19 @@ public void simple() throws Exception { Assert.assertNotNull(endpoint); } + + @Test + public void simpleBusdoxDocIdQnsScheme() throws Exception { + Endpoint endpoint = lookupService.lookup(Header.newInstance() + .receiver(ParticipantIdentifier.of("0208:0871221633")) + .documentType(DocumentTypeIdentifier.of( + "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##" + + "urn:cen.eu:en16931:2017#compliant#" + + "urn:fdc:peppol.eu:2017:poacc:billing:3.0" + + "::2.1", DocumentTypeIdentifier.BUSDOX_DOCID_QNS_SCHEME)) + .process(ProcessIdentifier.of("urn:fdc:peppol.eu:2017:poacc:billing:01:1.0"))); + + Assert.assertNotNull(endpoint); + } + } diff --git a/oxalis-outbound/src/test/java/network/oxalis/outbound/transmission/TransmissionRequestBuilderWithoutOverridesTest.java b/oxalis-outbound/src/test/java/network/oxalis/outbound/transmission/TransmissionRequestBuilderWithoutOverridesTest.java index 1fca80c20..4b9c60c97 100644 --- a/oxalis-outbound/src/test/java/network/oxalis/outbound/transmission/TransmissionRequestBuilderWithoutOverridesTest.java +++ b/oxalis-outbound/src/test/java/network/oxalis/outbound/transmission/TransmissionRequestBuilderWithoutOverridesTest.java @@ -162,7 +162,7 @@ public void makeSureWeCanSupplySameValuesAsThoseFromTheDocument() throws Excepti "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice" + "##urn:www.cenbii.eu:transaction:biicoretrdm010:ver1.0" + ":#urn:www.peppol.eu:bis:peppol4a:ver1.0" + - "::2.0")); + "::2.0", DocumentTypeIdentifier.BUSDOX_DOCID_QNS_SCHEME)); transmissionRequestBuilder.processType(ProcessIdentifier.of("urn:www.cenbii.eu:profile:bii04:ver1.0")); transmissionRequestBuilder.overrideAs2Endpoint(Endpoint.of( TransportProfile.AS2_1_0, URI.create("https://localhost:8080/oxalis/as2"), certificate)); @@ -180,7 +180,7 @@ public void makeSureWeCanSupplySameValuesAsThoseFromTheDocument() throws Excepti "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice" + "##urn:www.cenbii.eu:transaction:biicoretrdm010:ver1.0" + ":#urn:www.peppol.eu:bis:peppol4a:ver1.0" + - "::2.0")); + "::2.0", DocumentTypeIdentifier.BUSDOX_DOCID_QNS_SCHEME)); assertEquals(header.getProcess(), ProcessIdentifier.of("urn:www.cenbii.eu:profile:bii04:ver1.0")); assertEquals(request.getEndpoint(), Endpoint.of( TransportProfile.AS2_1_0, URI.create("https://localhost:8080/oxalis/as2"), certificate)); diff --git a/pom.xml b/pom.xml index 31ed4f76e..6b248023b 100644 --- a/pom.xml +++ b/pom.xml @@ -64,7 +64,7 @@ 1.2.3 1.57 4.2.2 - 2.2.0 + 2.3.0 5.6.5 9.4.41.v20210516 0.33.0