MockMvcController { @RequestMapping(value = "/postByBean", method = RequestMethod.POST) String postByBean(Role role, String method) { logger.info("role: {}; method: {}", role.toString(), method); return SUCCESS; }    }
@Test public void testPostByBean() throws Exception{ mockMvc.perform(post("/mock/postByBean") .param("id", "2") .param("name", "ROLE_USER") .param("method", "postByBean")) .andExpect(status().is(200)) .andExpect(content().string("success")); }