You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by jo...@apache.org on 2022/01/03 10:49:36 UTC

[incubator-shenyu] branch master updated: [ISSUE #2679] Add integration test for SpringMvcMappingPathController (#2698)

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

jooks pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-shenyu.git


The following commit(s) were added to refs/heads/master by this push:
     new a81cded  [ISSUE #2679] Add integration test for SpringMvcMappingPathController (#2698)
a81cded is described below

commit a81cded205982b67886fb0b242c26500570b7282
Author: qinghai777 <80...@users.noreply.github.com>
AuthorDate: Mon Jan 3 18:49:29 2022 +0800

    [ISSUE #2679] Add integration test for SpringMvcMappingPathController (#2698)
    
    * FileController
    
    * testSpringMvcMappingPathController
    
    * TestSpringMvcMappingPathController2
    
    * TestSpringMvcMappingPathController3
---
 .../http/SpringMvcMappingPathControllerTest.java   | 46 ++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/shenyu-integrated-test/shenyu-integrated-test-http/src/test/java/org/apache/shenyu/integrated/test/http/SpringMvcMappingPathControllerTest.java b/shenyu-integrated-test/shenyu-integrated-test-http/src/test/java/org/apache/shenyu/integrated/test/http/SpringMvcMappingPathControllerTest.java
new file mode 100644
index 0000000..6f83586
--- /dev/null
+++ b/shenyu-integrated-test/shenyu-integrated-test-http/src/test/java/org/apache/shenyu/integrated/test/http/SpringMvcMappingPathControllerTest.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shenyu.integrated.test.http;
+
+import org.apache.shenyu.integratedtest.common.AbstractTest;
+import org.apache.shenyu.integratedtest.common.helper.HttpHelper;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+
+public class SpringMvcMappingPathControllerTest extends AbstractTest {
+
+    @Test
+    public void testHello() throws IOException {
+        String res = HttpHelper.INSTANCE.postGateway("/http/hello", java.lang.String.class);
+        assertEquals("hello! I'm Shenyu-Gateway System. Welcome!", res);
+    }
+
+    @Test
+    public void testHi()throws IOException {
+        String res = HttpHelper.INSTANCE.postGateway("/http/hi?name=tom", java.lang.String.class);
+        assertEquals("hi! tom! I'm Shenyu-Gateway System. Welcome!", res);
+    }
+
+    @Test
+    public void testPost()throws IOException {
+        String res = HttpHelper.INSTANCE.postGateway("/http/post/hi?name=tom", java.lang.String.class);
+        assertEquals("[post method result]:hi! tom! I'm Shenyu-Gateway System. Welcome!", res);
+    }
+}