michael-o commented on a change in pull request #118: [TEXT-170] Add String 
lookup for host names and IP addresses
URL: https://github.com/apache/commons-text/pull/118#discussion_r308011882
 
 

 ##########
 File path: 
src/test/java/org/apache/commons/text/StringSubstitutorWithInterpolatorStringLookupTest.java
 ##########
 @@ -68,6 +68,51 @@ public void testDefaultValueForMissingKeyInResourceBundle() 
{
         assertEquals("defaultValue", 
stringSubstitutor.replace("${keyWithMissingKey}"));
     }
 
+    @Test
+    public void testDnsLookup() throws UnknownHostException {
+        final StringSubstitutor strSubst = 
StringSubstitutor.createInterpolator();
+        
Assertions.assertEquals(InetAddress.getByName("apache.org").getHostAddress(),
+            strSubst.replace("${dns:apache.org}"));
 
 Review comment:
   All of the apache.org tests are also brittle because apache.org has two 
addresses. It can happen that you receive non equal anwers.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to