Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @SpringBootTest
- @AutoConfigureMockMvc
- //@WebMvcTest(Controller.class)
- public class ControllerTest {
- @Autowired
- Pesel pesel;
- @Autowired
- MockMvc mockMvc;
- @Autowired
- ObjectMapper objectMapper;
- @Test
- public void postPeselNumbersTest() throws Exception {
- List <Integer> numberslist = (Lists.newArrayList(2,2,2,2,2,2,2,2,2,2,2));
- pesel.setNumbersList(numberslist);
- mockMvc.perform(post("/validate")
- .contentType(MediaType.APPLICATION_JSON)
- .content(new Gson().toJson(pesel)))
- .andExpect(model().attribute("numbersist", pesel));
- // .andExpect(model().hasNoErrors())
- // .andExpect(view().name("pesel_validate"))
- // .andExpect(status().isOk());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement