You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@zookeeper.apache.org by GitBox <gi...@apache.org> on 2023/01/18 13:39:03 UTC

[GitHub] [zookeeper] eolivelli commented on a diff in pull request #1959: [ZOOKEEPER-4647] Tests don't pass on JDK20 because we try to mock InetAddress

eolivelli commented on code in PR #1959:
URL: https://github.com/apache/zookeeper/pull/1959#discussion_r1073546869


##########
zookeeper-server/src/test/java/org/apache/zookeeper/common/ZKTrustManagerTest.java:
##########
@@ -148,9 +156,6 @@ public void testServerHostnameVerificationWithHostnameVerificationDisabled() thr
         X509Certificate[] certificateChain = createSelfSignedCertifcateChain(IP_ADDRESS, HOSTNAME);
         zkTrustManager.checkServerTrusted(certificateChain, null, mockSocket);
 
-        verify(mockInetAddress, times(0)).getHostAddress();

Review Comment:
   I knew that we are going to lose these assertions, the problem is that the tests verified that these two methods were not called (or called N times).
   We cannot spy the InetAddress object anymore.
   
   we could create two "versions" of this test, if we are on JDK19+ we do it this way, and if we are on older JDKs we keep the mock and run the test the same way as before.
   I don't think that there will be short term plans to abandon older JDKs soon (years)
   
   



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@zookeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org