Fix broken tests

This commit is contained in:
Oscar Utbult 2016-12-05 22:18:58 +01:00 committed by Dave Syer
parent 45da5a4d3b
commit 23f65ba7d0

View file

@ -75,7 +75,7 @@ public class PetControllerTests {
mockMvc.perform(post("/owners/{ownerId}/pets/new", TEST_OWNER_ID) mockMvc.perform(post("/owners/{ownerId}/pets/new", TEST_OWNER_ID)
.param("name", "Betty") .param("name", "Betty")
.param("type", "hamster") .param("type", "hamster")
.param("birthDate", "2015/02/12") .param("birthDate", "2015-02-12")
) )
.andExpect(status().is3xxRedirection()) .andExpect(status().is3xxRedirection())
.andExpect(view().name("redirect:/owners/{ownerId}")); .andExpect(view().name("redirect:/owners/{ownerId}"));
@ -85,7 +85,7 @@ public class PetControllerTests {
public void testProcessCreationFormHasErrors() throws Exception { public void testProcessCreationFormHasErrors() throws Exception {
mockMvc.perform(post("/owners/{ownerId}/pets/{petId}/edit", TEST_OWNER_ID, TEST_PET_ID) mockMvc.perform(post("/owners/{ownerId}/pets/{petId}/edit", TEST_OWNER_ID, TEST_PET_ID)
.param("name", "Betty") .param("name", "Betty")
.param("birthDate", "2015/02/12") .param("birthDate", "2015-02-12")
) )
.andExpect(model().attributeHasNoErrors("owner")) .andExpect(model().attributeHasNoErrors("owner"))
.andExpect(model().attributeHasErrors("pet")) .andExpect(model().attributeHasErrors("pet"))
@ -106,7 +106,7 @@ public class PetControllerTests {
mockMvc.perform(post("/owners/{ownerId}/pets/{petId}/edit", TEST_OWNER_ID, TEST_PET_ID) mockMvc.perform(post("/owners/{ownerId}/pets/{petId}/edit", TEST_OWNER_ID, TEST_PET_ID)
.param("name", "Betty") .param("name", "Betty")
.param("type", "hamster") .param("type", "hamster")
.param("birthDate", "2015/02/12") .param("birthDate", "2015-02-12")
) )
.andExpect(status().is3xxRedirection()) .andExpect(status().is3xxRedirection())
.andExpect(view().name("redirect:/owners/{ownerId}")); .andExpect(view().name("redirect:/owners/{ownerId}"));