@@ -2030,21 +2030,50 @@ public void invokeMethod(@RequestBody String request, HttpServletRequest servlet
2030
2030
super .invokeMethod (request , servletRequest );
2031
2031
}
2032
2032
2033
+ // 为 UnitAuto 提供的单元测试接口 https://github.com/TommyLemon/UnitAuto >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2034
+
2035
+
2036
+ // 为 APIAuto, UnitAuto, SQLAuto 提供的后台 Headless 无 UI 测试转发接口 <<<<<<<<<<<<<<<<<<<<<<<<<<<
2033
2037
2034
2038
@ GetMapping ("/api/test/start" )
2035
- public String startApiTest (HttpServletResponse response , HttpSession session ) throws Exception {
2039
+ public String startApiTest (HttpSession session ) {
2036
2040
//response.sendRedirect("http://localhost:3000/test/start");
2037
2041
long id = 100000 + Math .round (899999 *Math .random ());
2038
- DemoParser .KEY_MAP .put (id , session ); // 调这个接口一般是前端/CI/CD,调查询接口的是 Node,Session 不同 session.setAttribute("key", id);
2042
+ DemoParser .KEY_MAP .put (String . valueOf ( id ) , session ); // 调这个接口一般是前端/CI/CD,调查询接口的是 Node,Session 不同 session.setAttribute("key", id);
2039
2043
return delegate ("http://localhost:3000/test/start?key=" + id , null , null , null , null , HttpMethod .GET , session );
2040
2044
}
2041
2045
@ GetMapping ("/api/test/status" )
2042
- public String getApiTestStatus (HttpServletResponse response , HttpSession session ) throws Exception {
2046
+ public String getApiTestStatus (@ RequestParam ( value = "key" , required = false ) String key , HttpSession session ) {
2043
2047
//response.sendRedirect("http://localhost:3000/test/status");
2048
+ DemoParser .KEY_MAP .remove (key );
2044
2049
return delegate ("http://localhost:3000/test/status" , null , null , null , null , HttpMethod .GET , session );
2045
2050
}
2046
2051
2047
- // 为 UnitAuto 提供的单元测试接口 https://github.com/TommyLemon/UnitAuto >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2052
+ @ GetMapping ("/unit/test/start" )
2053
+ public String startUnitTest (HttpSession session ) {
2054
+ long id = 100000 + Math .round (899999 *Math .random ());
2055
+ DemoParser .KEY_MAP .put (String .valueOf (id ), session ); // 调这个接口一般是前端/CI/CD,调查询接口的是 Node,Session 不同 session.setAttribute("key", id);
2056
+ return delegate ("http://localhost:3001/test/start?key=" + id , null , null , null , null , HttpMethod .GET , session );
2057
+ }
2058
+ @ GetMapping ("/unit/test/status" )
2059
+ public String getUnitTestStatus (@ RequestParam (value = "key" , required = false ) String key , HttpSession session ) {
2060
+ DemoParser .KEY_MAP .remove (key );
2061
+ return delegate ("http://localhost:3001/test/status" , null , null , null , null , HttpMethod .GET , session );
2062
+ }
2063
+
2064
+ @ GetMapping ("/sql/test/start" )
2065
+ public String startSQLTest (HttpSession session ) {
2066
+ long id = 100000 + Math .round (899999 *Math .random ());
2067
+ DemoParser .KEY_MAP .put (String .valueOf (id ), session ); // 调这个接口一般是前端/CI/CD,调查询接口的是 Node,Session 不同 session.setAttribute("key", id);
2068
+ return delegate ("http://localhost:3002/test/start?key=" + id , null , null , null , null , HttpMethod .GET , session );
2069
+ }
2070
+ @ GetMapping ("/sql/test/status" )
2071
+ public String getSQLTestStatus (@ RequestParam ("key" ) String key , HttpSession session ) {
2072
+ DemoParser .KEY_MAP .remove (key );
2073
+ return delegate ("http://localhost:3002/test/status" , null , null , null , null , HttpMethod .GET , session );
2074
+ }
2075
+
2076
+ // 为 APIAuto, UnitAuto, SQLAuto 提供的后台 Headless 无 UI 测试转发接口 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2048
2077
2049
2078
2050
2079
}
0 commit comments