MvcResult mvcResult = mockMvc.perform(post("/user/addItemIntoCart").andExpect(status().isOk()).andReturn();
@PostMapping(value = "/addItemIntoCart",consumes = {"application/json"})
public ResponseEntity<String> addItemToCart(@RequestBody CartDto cartDto) {
return cartService.addItemIntoCart(cartDto);
}
how can I pass object of CartDto to the mockmvc
I am trying to test addItemIntoCart method, but not sure how to pass object to the mockmvc