juicewcode commented on code in PR #7146:
URL: https://github.com/apache/shenyu/pull/7146#discussion_r4057229533


##########
shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-rpc/shenyu-plugin-grpc/src/test/java/org/apache/shenyu/plugin/grpc/GrpcPluginTest.java:
##########
@@ -94,21 +95,40 @@ public void tearDown() {
     @Test
     public void testDoExecute() throws ClassNotFoundException, 
NoSuchFieldException, IllegalAccessException {
         ServerWebExchange exchange = getServerWebExchange(new 
InetSocketAddress("127.0.0.1", 8090));
-        executeRequest(exchange, "127.0.0.1");
+        executeRequest(exchange, "127.0.0.1", getMetaData(), 
MethodDescriptor.MethodType.SERVER_STREAMING);
     }
 
     @Test
     public void testDoExecuteWithNullRemoteAddress()
             throws ClassNotFoundException, NoSuchFieldException, 
IllegalAccessException {
         ServerWebExchange exchange = getServerWebExchange();
-        executeRequest(exchange, "");
+        executeRequest(exchange, "", getMetaData(), 
MethodDescriptor.MethodType.SERVER_STREAMING);
+    }
+
+    @Test
+    public void testDoExecuteWithNullRpcExt()
+            throws ClassNotFoundException, NoSuchFieldException, 
IllegalAccessException {
+        ServerWebExchange exchange = getServerWebExchange();
+        MetaData metaData = getMetaData();
+        metaData.setRpcExt(null);
+        executeRequest(exchange, "", metaData, 
MethodDescriptor.MethodType.UNARY);
+    }
+
+    @Test
+    public void testDoExecuteWithBlankRpcExt()
+            throws ClassNotFoundException, NoSuchFieldException, 
IllegalAccessException {
+        ServerWebExchange exchange = getServerWebExchange();
+        MetaData metaData = getMetaData();
+        metaData.setRpcExt(" ");

Review Comment:
   Thanks for your review. I have added a separate test for an empty rpcExt 
value and moved the blank check before Gson deserialization. Null, empty, and 
whitespace-only values are now handled explicitly without relying on Gson's 
behavior.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to