Skip to content

Release 2.2.0

Choose a tag to compare

@f-lopes f-lopes released this 24 Feb 16:43

Integrates #9

Adds new syntax usage (with(form())):

final AddUserForm addUserForm = new AddUserForm("John", "Doe", null, new Address(1, "Street", 5222, "New York")));

// POST
mockMvc.perform(post("/users").with(MockMvcRequestBuilderUtils.form(addUserForm)))
		.andExpect(MockMvcResultMatchers.model().hasNoErrors());

// GET
mockMvc.perform(get("/users").with(MockMvcRequestBuilderUtils.form(addUserForm)))
		.andExpect(MockMvcResultMatchers.model().hasNoErrors());
		
// PUT
mockMvc.perform(put("/users").with(MockMvcRequestBuilderUtils.form(addUserForm)))
		.andExpect(MockMvcResultMatchers.model().hasNoErrors());
<dependency>
    <groupId>io.florianlopes</groupId>
    <artifactId>spring-mvc-test-utils</artifactId>
    <version>2.2.0</version>
    <scope>test</scope>
</dependency>