Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-4647

Tests don't pass on JDK20 because we try to mock InetAddress

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • None
    • 3.9.0, 3.8.2
    • None

    Description

      This test fails on JDK20-Ea

      org.apache.zookeeper.test.StaticHostProviderTest.testEmptyResolution

      Mockito cannot mock this class: class java.net.InetAddress. Mockito can only mock non-private & non-final classes. If you're not sure why you're getting this error, please report to the mailing list.

      if I try to upgrade  Mockito to 4.9.0  the error is

      org.mockito.exceptions.base.MockitoException:

      Cannot mock/spy class java.net.InetAddress

      Mockito cannot mock/spy because :

      • sealed class

       

      at org.apache.zookeeper.test.StaticHostProviderTest.testReResolvingSingle(StaticHostProviderTest.jav

      Attachments

        Issue Links

          Activity

            People

              eolivelli Enrico Olivelli
              eolivelli Enrico Olivelli
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1.5h
                  1.5h