Fixed MockMvc example code

Issue: SPR-10389
(cherry picked from commit 35847ad)
This commit is contained in:
Juergen Hoeller
2013-05-07 21:38:45 +02:00
parent 7bbd38b9e0
commit 7298c3d669

View File

@@ -3177,10 +3177,10 @@ public class ExampleTests {
@Test
public void getAccount() throws Exception {
this.mockMvc.perform(get("/accounts/1").accept("application/json;charset=UTF-8"))
this.mockMvc.perform(get("/accounts/1").accept(MediaType.parseMediaType("application/json;charset=UTF-8")))
.andExpect(status().isOk())
.andExpect(content().contentType("application/json"))
.andExpect(jsonPath("$.name").value("Lee");
.andExpect(jsonPath("$.name").value("Lee"));
}
}</programlisting>