Spring 3.2 mvc testing post request
From the spring tutorial.
MvcResult mvcResult =
mockMvc.perform(post("/person")).andExpect(status().isOk()).andReturn();
This is good and good, but if my controller has a signature
@RequestMapping(value = "/person", method = RequestMethod.POST)
public String postPerson(Person person) {}
If the person is a simple DTO, usually filled with a spring form in jsp (for example, for two fields String and getter / setters); how to send this data to the test?
+3
source to share