@@ -2030,21 +2030,50 @@ public void invokeMethod(@RequestBody String request, HttpServletRequest servlet
20302030 super .invokeMethod (request , servletRequest );
20312031 }
20322032
2033+ // 为 UnitAuto 提供的单元测试接口 https://github.com/TommyLemon/UnitAuto >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2034+
2035+
2036+ // 为 APIAuto, UnitAuto, SQLAuto 提供的后台 Headless 无 UI 测试转发接口 <<<<<<<<<<<<<<<<<<<<<<<<<<<
20332037
20342038 @ GetMapping ("/api/test/start" )
2035- public String startApiTest (HttpServletResponse response , HttpSession session ) throws Exception {
2039+ public String startApiTest (HttpSession session ) {
20362040 //response.sendRedirect("http://localhost:3000/test/start");
20372041 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);
20392043 return delegate ("http://localhost:3000/test/start?key=" + id , null , null , null , null , HttpMethod .GET , session );
20402044 }
20412045 @ 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 ) {
20432047 //response.sendRedirect("http://localhost:3000/test/status");
2048+ DemoParser .KEY_MAP .remove (key );
20442049 return delegate ("http://localhost:3000/test/status" , null , null , null , null , HttpMethod .GET , session );
20452050 }
20462051
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 测试转发接口 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
20482077
20492078
20502079}
0 commit comments