This is an automated email from the ASF dual-hosted git repository.

snagel pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nutch.git


The following commit(s) were added to refs/heads/master by this push:
     new ddabe9694 NUTCH-3144 URLUtil unit tests fail after upgrade to 
crawler-commons 1.6
ddabe9694 is described below

commit ddabe969426e0822d425986fb9c3b1ef7aa56006
Author: Sebastian Nagel <[email protected]>
AuthorDate: Wed Jan 7 23:05:54 2026 +0100

    NUTCH-3144 URLUtil unit tests fail after upgrade to crawler-commons 1.6
    
    - adapt unit tests to changes introduced in
      https://github.com/crawler-commons/crawler-commons/pull/478
    - test for example given in Javadoc of getDomainSuffix
---
 src/java/org/apache/nutch/util/URLUtil.java     | 2 +-
 src/test/org/apache/nutch/util/TestURLUtil.java | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/java/org/apache/nutch/util/URLUtil.java 
b/src/java/org/apache/nutch/util/URLUtil.java
index afd6f1385..44c6309d2 100644
--- a/src/java/org/apache/nutch/util/URLUtil.java
+++ b/src/java/org/apache/nutch/util/URLUtil.java
@@ -262,7 +262,7 @@ public class URLUtil {
 
     EffectiveTldFinder.EffectiveTLD suffix = 
EffectiveTldFinder.getEffectiveTLD(host, true);
     if (suffix != null) {
-      return suffix.getDomain();
+      return suffix.getSuffix();
     }
 
     return null;
diff --git a/src/test/org/apache/nutch/util/TestURLUtil.java 
b/src/test/org/apache/nutch/util/TestURLUtil.java
index 32dda0929..092edb9c1 100644
--- a/src/test/org/apache/nutch/util/TestURLUtil.java
+++ b/src/test/org/apache/nutch/util/TestURLUtil.java
@@ -147,6 +147,8 @@ public class TestURLUtil {
     assertEquals("2000.hu", URLUtil.getDomainSuffix(url));
 
     // test non-ASCII
+    url = new URL("https://www.taiuru.māori.nz/";);
+    assertEquals("xn--mori-qsa.nz", URLUtil.getDomainSuffix(url));
     url = new URL("http://www.example.flå.no";);
     assertEquals("xn--fl-zia.no", URLUtil.getDomainSuffix(url));
     url = new URL("http://www.example.栃木.jp";);

Reply via email to