Open
Description
Description
Although @RequestParam
annotation is supported after #2487, there is a not very often occured scenario that we can not deal with. Actually, the same problem happens for @PathVariable
.
Expected behavior
Integration tests can be generated properly for the following syntax of the annotation
@PostMapping("/api/foos")
@ResponseBody
public String updateFoos(@RequestParam Map<String,String> allParams) {
return "Parameters are " + allParams.entrySet();
}
curl -X POST -F 'name=abc' -F 'id=123' http://localhost:8080/spring-mvc-basics/api/foos
or
@GetMapping("/api/employeeswithmapvariable/{id}/{name}")
@ResponseBody
public String getEmployeesByIdAndNameWithMapVariable(@PathVariable Map<String, String> pathVarsMap) {
String id = pathVarsMap.get("id");
String name = pathVarsMap.get("name");
if (id != null && name != null) {
return "ID: " + id + ", name: " + name;
} else {
return "Missing Parameters";
}
}
http://localhost:8080/api/employees/1/bar
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Todo