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:
[email protected]