Browse Source

Fixed MockMvc example code

Issue: SPR-10389
pull/292/head
Juergen Hoeller 12 years ago
parent
commit
35847ad003
  1. 4
      src/reference/docbook/testing.xml

4
src/reference/docbook/testing.xml

@ -3118,10 +3118,10 @@ public class ExampleTests { @@ -3118,10 +3118,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>

Loading…
Cancel
Save