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 {
2
  • 2
    What have you tried so far? Maybe passing the string with the Date format? Or anything else?
    – Urosh T.
    Nov 28, 2018 at 10:56
  • Possible duplicate of 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. :-)
    – Anonymous
    Nov 28, 2018 at 14:00

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.