Skip to content

Commit

Permalink
Added another test
Browse files Browse the repository at this point in the history
  • Loading branch information
phax committed Jan 14, 2025
1 parent f994af2 commit a5361e3
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import java.net.URL;

import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.helger.network.port.NetworkOnlineStatusDeterminator;
import com.helger.peppol.sml.ESML;
Expand All @@ -36,6 +38,8 @@
*/
public final class PeppolNaptrURLProviderTest
{
private static final Logger LOGGER = LoggerFactory.getLogger (PeppolNaptrURLProviderTest.class);

@Test
// @Ignore ("Because it may take long to execute")
@IgnoredNaptrTest
Expand Down Expand Up @@ -78,4 +82,19 @@ public void testResolveNamePeppol () throws SMPDNSResolutionException
aURLProvider.getDNSNameOfParticipant (PeppolIdentifierFactory.INSTANCE.createParticipantIdentifierWithDefaultScheme ("0010:5798000000001"),
ESML.DIGIT_TEST));
}

@Test
public void testFindRegisteredSMPURL () throws SMPDNSResolutionException
{
// Only if online
if (NetworkOnlineStatusDeterminator.getNetworkStatus ().isOnline ())
{
final IPeppolURLProvider aURLProvider = PeppolNaptrURLProvider.INSTANCE;
final IParticipantIdentifier aPI = PeppolIdentifierFactory.INSTANCE.createParticipantIdentifierWithDefaultScheme ("0007:123456");

final URL x = aURLProvider.getSMPURLOfParticipant (aPI, ESML.DIGIT_TEST);
assertNotNull (x);
LOGGER.info ("PID " + aPI.getValue () + " is registered at '" + x.toString () + "'");
}
}
}

0 comments on commit a5361e3

Please sign in to comment.