I have this problem to pass a Date in junit.
I try to pass param dateFrom as String, because as Date is imposible but then i can execute this method because system try to map a Date with a string. Thats the problem.
this is my method in junit.
this.mockMvc
.perform(
get("/findElement/ajax/makeAction").header("Accept", "*/*").sessionAttr(Constants.DATA, this.data)
.param("index", "")
.param("numElems", "50")
.param("dateFrom", "2012-01-01T00:00:00.000Z"))
.andExpect(status().isOk());
}
This is my controller.
@RequestMapping(value = "/ajax/makeAction", headers = "Accept=*/*", method = RequestMethod.GET)
@ResponseBody
public List<Liquidacion> consultaMasLiquidaciones(User user, Product product)
where product has product.dateFrom
Thanks.