DefaultLookupService implements LookupService { @Override public Endpoint lookup(Header header) throws OxalisTransmissionException { try { return lookupClient.getEndpoint(header, transportProfiles); } catch (LookupException | PeppolSecurityException | EndpointNotFoundException e) { throw new OxalisTransmissionException(e.getMessage(), e); } } @Inject  DefaultLookupService(LookupClient lookupClient,
                                @Named("prioritized") List<TransportProfile> transportProfiles); @Override Endpoint lookup(Header header);  }
@Test public void simple() throws Exception { Endpoint endpoint = lookupService.lookup(Header.newInstance() .receiver(ParticipantIdentifier.of("9908:810418052")) .documentType(DocumentTypeIdentifier.of("urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:www.cenbii.eu:transaction:biitrns010:ver2.0:extended:urn:www.peppol.eu:bis:peppol4a:ver2.0::2.1")) .process(ProcessIdentifier.of("urn:www.cenbii.eu:profile:bii04:ver2.0"))); Assert.assertNotNull(endpoint); }
@Test(expectedExceptions = OxalisTransmissionException.class) public void triggerException() throws Exception { lookupService.lookup(Header.newInstance() .receiver(ParticipantIdentifier.of("9908:---")) .documentType(DocumentTypeIdentifier.of("urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:www.cenbii.eu:transaction:biitrns010:ver2.0:extended:urn:www.peppol.eu:bis:peppol4a:ver2.0::2.1")) .process(ProcessIdentifier.of("urn:www.cenbii.eu:profile:bii04:ver2.0"))); }