mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2026-01-14 13:51:12 +00:00
Fix content negotiation for /vets
See gh-326
This commit is contained in:
parent
6905e38c1f
commit
8eb5074770
3 changed files with 4 additions and 5 deletions
|
|
@ -65,7 +65,7 @@ public class VetControllerTests {
|
|||
|
||||
@Test
|
||||
public void testShowResourcesVetList() throws Exception {
|
||||
ResultActions actions = mockMvc.perform(get("/vets.json").accept(MediaType.APPLICATION_JSON))
|
||||
ResultActions actions = mockMvc.perform(get("/vets").accept(MediaType.APPLICATION_JSON))
|
||||
.andExpect(status().isOk());
|
||||
actions.andExpect(content().contentType("application/json;charset=UTF-8"))
|
||||
.andExpect(jsonPath("$.vetList[0].id").value(1));
|
||||
|
|
@ -73,7 +73,7 @@ public class VetControllerTests {
|
|||
|
||||
@Test
|
||||
public void testShowVetListXml() throws Exception {
|
||||
mockMvc.perform(get("/vets.xml").accept(MediaType.APPLICATION_XML))
|
||||
mockMvc.perform(get("/vets").accept(MediaType.APPLICATION_XML))
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(content().contentType(MediaType.APPLICATION_XML_VALUE))
|
||||
.andExpect(content().node(hasXPath("/vets/vetList[id=1]/id")));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue