zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] ivmaykov commented on a change in pull request #728: ZOOKEEPER-3160: Custom User SSLContext
Date Thu, 17 Jan 2019 01:39:32 GMT
ivmaykov commented on a change in pull request #728: ZOOKEEPER-3160: Custom User SSLContext
URL: https://github.com/apache/zookeeper/pull/728#discussion_r248513615
 
 

 ##########
 File path: zookeeper-server/src/test/java/org/apache/zookeeper/common/X509UtilTest.java
 ##########
 @@ -389,6 +393,27 @@ public void testGetSslHandshakeDetectionTimeoutMillisProperty() {
         }
     }
 
+    @Test
+    public void testCreateSSLContext_invalidCustomSSLContextClass() {
+        ZKConfig zkConfig = new ZKConfig();
+        ClientX509Util clientX509Util = new ClientX509Util();
+        zkConfig.setProperty(clientX509Util.getSslClientContextProperty(), String.class.getCanonicalName());
+        try {
+            clientX509Util.createSSLContext(zkConfig);
+            fail("SSLContextException expected.");
 
 Review comment:
   nit: can remove the try-catch and modify the annotation on the method to be `@Test(expected
= X509Exception.SSLContextException.class)`. Though this approach does not check the message,
I think it's probably ok - testing for specific error messages is fragile anyway. We should
either not care about the message, or we should create a specific sublcass of SSLContextException
for this case and check for that exception type.

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


With regards,
Apache Git Services

Mime
View raw message