Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
- import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
- private void expectDto(MockHttpServletRequestBuilder mockHttpServletRequestBuilder,
- MyDto myDto) throws Exception {
- MvcResult mvcResult = this.mockMvc.perform(mockHttpServletRequestBuilder)
- // .andDo(print())
- .andExpect(status().isOk())
- .andExpect(jsonPath("$.id").value(myDto.getId()))
- .andExpect(jsonPath("$.name").value(myDto.getName()))
- .andExpect(jsonPath("$.finished").value(myDto.getFinished()))
- .andReturn();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement