@Test public void sanityTest() { SpaceTaskAPIController controller=new SpaceTaskAPIController(); SpaceTaskRequest body=new SpaceTaskRequest(); body.language="groovy"; body.target="all"; body.code="println \"here\";return \"success\";"; ModelAndView result=controller.executeTask("space","localhost",body); assertEquals(1,result.getModel().size()); }
@RequestMapping(value = "/execute",method=RequestMethod.POST) public ModelAndView executeTask(@RequestParam String spaceName,@RequestParam String locators,@RequestBody SpaceTaskRequest body) { return execute(spaceName,locators,body); }
SpaceTaskAPIController { @RequestMapping(value = "/execute",method=RequestMethod.POST) public ModelAndView executeTask(@RequestParam String spaceName,@RequestParam String locators,@RequestBody SpaceTaskRequest body) { return execute(spaceName,locators,body); } }
SpaceTaskAPIController { @RequestMapping(value = "/execute",method=RequestMethod.POST) public ModelAndView executeTask(@RequestParam String spaceName,@RequestParam String locators,@RequestBody SpaceTaskRequest body) { return execute(spaceName,locators,body); } SpaceTaskAPIController(); }
SpaceTaskAPIController { @RequestMapping(value = "/execute",method=RequestMethod.POST) public ModelAndView executeTask(@RequestParam String spaceName,@RequestParam String locators,@RequestBody SpaceTaskRequest body) { return execute(spaceName,locators,body); } SpaceTaskAPIController(); @RequestMapping(value = "/execute",method=RequestMethod.POST) ModelAndView executeTask(@RequestParam String spaceName,@RequestParam String locators,@RequestBody SpaceTaskRequest body); }
SpaceTaskAPIController { @RequestMapping(value = "/execute",method=RequestMethod.POST) public ModelAndView executeTask(@RequestParam String spaceName,@RequestParam String locators,@RequestBody SpaceTaskRequest body) { return execute(spaceName,locators,body); } SpaceTaskAPIController(); @RequestMapping(value = "/execute",method=RequestMethod.POST) ModelAndView executeTask(@RequestParam String spaceName,@RequestParam String locators,@RequestBody SpaceTaskRequest body);  }