0

Please help me to pass this Date object to MVCMock. Since param() only accepts String as values. I am not sure how to pass Date value here

MockHttpServletRequestBuilder mvcBuilder = get("/pam/holdings/getholdings")
                                                   .accept(MediaType.ALL)
                                                   .flashAttr("holdingsFilterViewData", holdingsFilter)
                                                   .param("group","")
                                                   .param("account","")
                                                   .param("selectedHoldingsview","");




public String loadSelectedHoldings(
            @ModelAttribute("holdingsFilterViewData") HoldingsFilter holdingsFilter,
            @RequestParam(value = "account", required = false) String account,
            @RequestParam(value = "group", required = false) String group,
            @RequestParam(value = "asOfDate", required = false) Date asOfDate,
            @RequestParam(value = "selectedHoldingsview", required = false) String selectedViewName,
            Model model, HttpServletResponse servletResponse)
            throws NoUserLoggedInException, NoKeyOfTypeFoundException,
            ParseException, IOException {
zero323
  • 322,348
  • 103
  • 959
  • 935
  • 2
    What have you tried so far? Maybe passing the string with the Date format? Or anything else? – Urosh T. Nov 28 '18 at 10:56
  • Possible duplicate of [Passing date to request param in Spring MVC](https://stackoverflow.com/questions/14766818/passing-date-to-request-param-in-spring-mvc). Use your search engine for more. And next time please search *before* posting your question, that’ll be really nice. :-) – Ole V.V. Nov 28 '18 at 14:00

0 Answers0