You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by ni...@apache.org on 2018/01/29 14:46:53 UTC

[incubator-servicecomb-java-chassis] 02/02: SCB-308 Vertx transport server timeout will cause VertxServerRequestToHttpServletRequest getRemoteAddress NullPointException, so save the socketAddress with the servletRequest

This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git

commit 2fca86e704cf59b348ebccb1ff6a15a5f4100520
Author: jeho0815 <je...@email.com>
AuthorDate: Mon Jan 29 15:31:02 2018 +0800

    SCB-308 Vertx transport server timeout will cause VertxServerRequestToHttpServletRequest getRemoteAddress NullPointException, so save the socketAddress with the servletRequest
---
 .../transport/rest/vertx/TestVertxRestDispatcher.java            | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/transports/transport-rest/transport-rest-vertx/src/test/java/org/apache/servicecomb/transport/rest/vertx/TestVertxRestDispatcher.java b/transports/transport-rest/transport-rest-vertx/src/test/java/org/apache/servicecomb/transport/rest/vertx/TestVertxRestDispatcher.java
index 40537a3..6daafab 100644
--- a/transports/transport-rest/transport-rest-vertx/src/test/java/org/apache/servicecomb/transport/rest/vertx/TestVertxRestDispatcher.java
+++ b/transports/transport-rest/transport-rest-vertx/src/test/java/org/apache/servicecomb/transport/rest/vertx/TestVertxRestDispatcher.java
@@ -36,6 +36,8 @@ import org.junit.Before;
 import org.junit.Test;
 
 import io.netty.handler.codec.http.multipart.HttpPostRequestDecoder.ErrorDataDecoderException;
+import io.vertx.core.http.HttpServerRequest;
+import io.vertx.core.net.SocketAddress;
 import io.vertx.ext.web.Router;
 import io.vertx.ext.web.RoutingContext;
 import mockit.Deencapsulation;
@@ -147,7 +149,7 @@ public class TestVertxRestDispatcher {
   }
 
   @Test
-  public void onRequest() {
+  public void onRequest(@Mocked HttpServerRequest request, @Mocked SocketAddress socketAdrress) {
     Map<String, Object> map = new HashMap<>();
     RoutingContext context = new MockUp<RoutingContext>() {
       @Mock
@@ -155,6 +157,11 @@ public class TestVertxRestDispatcher {
         map.put(key, obj);
         return null;
       }
+
+      @Mock
+      HttpServerRequest request() {
+        return request;
+      }
     }.getMockInstance();
     Deencapsulation.invoke(dispatcher, "onRequest", context);
 

-- 
To stop receiving notification emails like this one, please contact
ningjiang@apache.org.