BAEL-842 fix failed build because of UserAccountUnitTest

This commit is contained in:
thibault.faure 2022-07-04 22:08:12 +02:00
parent 9d59e267ac
commit bd44bc5f2d
1 changed files with 3 additions and 7 deletions

View File

@ -1,9 +1,7 @@
package com.baeldung.springvalidation; package com.baeldung.springvalidation;
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.model; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.view;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -15,7 +13,7 @@ import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@AutoConfigureMockMvc @AutoConfigureMockMvc
public class UserAccountUnitTest { public class UserAccountIntegrationTest {
@Autowired @Autowired
private MockMvc mockMvc; private MockMvc mockMvc;
@ -46,10 +44,8 @@ public class UserAccountUnitTest {
public void givenSaveBasicInfoStep1_whenIncorrectInput_thenError() throws Exception { public void givenSaveBasicInfoStep1_whenIncorrectInput_thenError() throws Exception {
this.mockMvc.perform(MockMvcRequestBuilders.post("/saveBasicInfoStep1") this.mockMvc.perform(MockMvcRequestBuilders.post("/saveBasicInfoStep1")
.accept(MediaType.TEXT_HTML)) .accept(MediaType.TEXT_HTML))
// .param("name", "test123")
// .param("password", "pass"))
.andExpect(model().errorCount(2)) .andExpect(model().errorCount(2))
// .andExpect(view().name("error")) .andExpect(view().name("error"))
.andExpect(status().isOk()) .andExpect(status().isOk())
.andDo(print()); .andDo(print());
} }