You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2020/11/27 06:29:12 UTC

[GitHub] [servicecomb-java-chassis] wujimin commented on a change in pull request #2089: fix typo and test case assert not correct in higher version of JDK

wujimin commented on a change in pull request #2089:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2089#discussion_r531404647



##########
File path: foundations/foundation-ssl/src/test/java/org/apache/servicecomb/foundation/ssl/SSLManagerTest.java
##########
@@ -249,8 +250,8 @@ public final SSLContext getInstance(String type) throws NoSuchAlgorithmException
     };
 
     try {
-      SSLContext context = SSLManager.createSSLContext(option, custom);
-      Assert.assertNotNull(context);
+      SSLManager.createSSLContext(option, custom);
+      Assert.assertNotNull(null);
     } catch (Exception e) {
       Assert.assertEquals("java.lang.IllegalArgumentException", e.getClass().getName());
     }

Review comment:
       ```java
   Throwable throwable = Assertions.catchThrowable(()->SSLManager.createSSLContext(option, custom));
   assertThat(throwable).isInstanceOf(IllegalArgumentException.class);
   ```
   
   异常的assert场景,用assertJ会简单清晰得多




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

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