mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-19 14:05:50 +00:00
Unit test lenght
This commit is contained in:
parent
04e44e195c
commit
d1d7c968df
1 changed files with 13 additions and 0 deletions
|
@ -114,6 +114,17 @@ public class PetControllerTests {
|
|||
.andExpect(view().name("redirect:/owners/{ownerId}"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testProcessUpdateFormHasErrorsLength2() throws Exception {
|
||||
mockMvc.perform(post("/owners/{ownerId}/pets/{petId}/edit", TEST_OWNER_ID, TEST_PET_ID)
|
||||
.param("name", "")
|
||||
)
|
||||
.andExpect(model().attributeHasErrors("pet"))
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(view().name("pets/createOrUpdatePetForm"));
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testProcessUpdateFormHasErrors() throws Exception {
|
||||
mockMvc.perform(post("/owners/{ownerId}/pets/{petId}/edit", TEST_OWNER_ID, TEST_PET_ID)
|
||||
|
@ -126,6 +137,8 @@ public class PetControllerTests {
|
|||
.andExpect(view().name("pets/createOrUpdatePetForm"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Test
|
||||
public void testProcessUpdateFormHasErrorsLength() throws Exception {
|
||||
mockMvc.perform(post("/owners/{ownerId}/pets/{petId}/edit", TEST_OWNER_ID, TEST_PET_ID)
|
||||
|
|
Loading…
Reference in a new issue