use of com.helger.peppolid.IParticipantIdentifier in project peppol-commons by phax.
the class BDXRClientReadOnlyTest method testGetBDXRHostURI_BDXR.
@Test
@Ignore("Because it may take long to execute")
@IgnoredNaptrTest
public void testGetBDXRHostURI_BDXR() throws SMPDNSResolutionException {
final IParticipantIdentifier aPI = PeppolIdentifierFactory.INSTANCE.createParticipantIdentifierWithDefaultScheme("9915:test");
// BDXR URL provider
final BDXRClientReadOnly aBDXRClient = new BDXRClientReadOnly(BDXLURLProvider.INSTANCE, aPI, ESML.DIGIT_TEST);
assertEquals("http://test-infra.peppol.at/", aBDXRClient.getSMPHostURI());
}
use of com.helger.peppolid.IParticipantIdentifier in project peppol-commons by phax.
the class BDXRClientReadOnlyTest method testGetBDXRHostURI_Peppol_WithBDXR.
@Test
public void testGetBDXRHostURI_Peppol_WithBDXR() throws SMPClientException, SMPDNSResolutionException {
// This instance has a BOM inside
final IParticipantIdentifier aPI = PeppolIdentifierFactory.INSTANCE.createParticipantIdentifierWithDefaultScheme("9917:5504033150");
final BDXRClientReadOnly aBDXRClient = new BDXRClientReadOnly(PeppolURLProvider.INSTANCE, aPI, ESML.DIGIT_PRODUCTION);
assertEquals("http://B-2f67a0710cbc13c11ac8c0d64186ac5e.iso6523-actorid-upis.edelivery.tech.ec.europa.eu/", aBDXRClient.getSMPHostURI());
// not OASIS!
try {
aBDXRClient.getServiceGroupOrNull(aPI);
fail();
} catch (final SMPClientBadResponseException ex) {
// Expected "Malformed XML document returned from SMP server"
}
}
use of com.helger.peppolid.IParticipantIdentifier in project peppol-commons by phax.
the class PeppolURLProviderTest method testGetSMPURIOfParticipant.
@Test
public void testGetSMPURIOfParticipant() throws URISyntaxException, MalformedURLException, SMPDNSResolutionException {
final IParticipantIdentifier aPI = IF.createParticipantIdentifierWithDefaultScheme("0088:123ABC");
final URI aURI = INSTANCE.getSMPURIOfParticipant(aPI, ESML.DIGIT_PRODUCTION);
assertEquals(new URI("http://B-f5e78500450d37de5aabe6648ac3bb70.iso6523-actorid-upis.edelivery.tech.ec.europa.eu"), aURI);
final URL aURL = INSTANCE.getSMPURLOfParticipant(aPI, ESML.DIGIT_PRODUCTION);
assertEquals(new URL("http://B-f5e78500450d37de5aabe6648ac3bb70.iso6523-actorid-upis.edelivery.tech.ec.europa.eu"), aURL);
}
use of com.helger.peppolid.IParticipantIdentifier in project peppol-commons by phax.
the class BDXR2IdentifierFactoryTest method testParticipantIDCaseInsensitive.
@Test
public void testParticipantIDCaseInsensitive() {
final BDXR2IdentifierFactory aIF = BDXR2IdentifierFactory.INSTANCE;
final String sScheme = PeppolIdentifierHelper.DEFAULT_PARTICIPANT_SCHEME;
final IParticipantIdentifier aID1 = aIF.createParticipantIdentifier(sScheme, "abc");
assertEquals(sScheme, aID1.getScheme());
assertEquals("abc", aID1.getValue());
// Value is lower cased internally
final IParticipantIdentifier aID2 = aIF.createParticipantIdentifier(sScheme, "ABC");
assertEquals(sScheme, aID2.getScheme());
assertEquals("abc", aID2.getValue());
assertTrue(aID1.hasSameContent(aID2));
}
use of com.helger.peppolid.IParticipantIdentifier in project peppol-commons by phax.
the class BDXR2IdentifierFactoryTest method testParticipantIDCaseSensitive.
@Test
public void testParticipantIDCaseSensitive() {
final BDXR2IdentifierFactory aIF = BDXR2IdentifierFactory.INSTANCE;
final String sScheme = "cs-actorid-upis";
final IParticipantIdentifier aID1 = aIF.createParticipantIdentifier(sScheme, "abc");
assertEquals(sScheme, aID1.getScheme());
assertEquals("abc", aID1.getValue());
// Value is NOT lower cased internally
final IParticipantIdentifier aID2 = aIF.createParticipantIdentifier(sScheme, "ABC");
assertEquals(sScheme, aID2.getScheme());
assertEquals("ABC", aID2.getValue());
assertFalse(aID1.hasSameContent(aID2));
}
Aggregations