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 2018/07/18 08:18:51 UTC
[GitHub] liubao68 commented on a change in pull request #817: [SCB-754] add
null pointer check on AbstractRestInvocation.invocation
liubao68 commented on a change in pull request #817: [SCB-754] add null pointer check on AbstractRestInvocation.invocation
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/817#discussion_r203289391
##########
File path: common/common-rest/src/test/java/org/apache/servicecomb/common/rest/TestAbstractRestInvocation.java
##########
@@ -440,6 +440,26 @@ protected void sendResponse(Response response) {
// just log, check nothing
}
+ @Test
+ public void sendResponseQuietlyExceptionOnNullInvocation(@Mocked Response response) {
+ restInvocation = new AbstractRestInvocationForTest() {
+ @Override
+ protected void doInvoke() {
+ }
+
+ @Override
+ protected void sendResponse(Response response) {
+ throw new Error("");
+ }
+ };
+ initRestInvocation();
+ restInvocation.invocation = null;
+
+ restInvocation.sendResponseQuietly(response);
+
+ // just log, check nothing, and should not throw NPE
Review comment:
Can we add an integration test for this scenario? Call a not exists service and got a 404.
----------------------------------------------------------------
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