You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@zookeeper.apache.org by "Enrico Olivelli (Jira)" <ji...@apache.org> on 2023/01/17 08:57:00 UTC

[jira] [Commented] (ZOOKEEPER-4647) Tests don't pass on JDK20 because we try to mock InetAddress

    [ https://issues.apache.org/jira/browse/ZOOKEEPER-4647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17677675#comment-17677675 ] 

Enrico Olivelli commented on ZOOKEEPER-4647:
--------------------------------------------

In the linked PR I have upgrade Mockito and I had to introduce  this tool (Burningwave tools)
[https://dev.to/jjbrt/how-to-configure-hostname-resolution-to-use-a-universal-custom-hostname-resolver-in-java-14p0]

 

 

Tests now pass

> Tests don't pass on JDK20 because we try to mock InetAddress
> ------------------------------------------------------------
>
>                 Key: ZOOKEEPER-4647
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-4647
>             Project: ZooKeeper
>          Issue Type: Test
>            Reporter: Enrico Olivelli
>            Priority: Critical
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> 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



--
This message was sent by Atlassian Jira
(v8.20.10#820010)