I have a service that does some work on an HttpServletRequest object, in particular using request.getParameterMap and request.getParameter to create the object.
I was wondering if there is an easy way to take the provided url as a string, say
String url = "http://www.example.com/?param1=value1¶m";
and is it easy to convert it to an HttpServletRequest object so that I can test it with my unit tests? Or at least so that request.getParameterMap and request.getParameter work correctly?
java servlets mocking
Anthony Jun 23 2018-11-11T00: 00Z
source share