Creating a mock HttpServletRequest out of a url string?

后端 未结 5 1143
别跟我提以往
别跟我提以往 2020-12-04 21:04

I have a service that does some work on an HttpServletRequest object, specifically using the request.getParameterMap and request.getParameter to construct an object.

5条回答
  •  眼角桃花
    2020-12-04 21:49

    Spring has MockHttpServletRequest in its spring-test module.

    If you are using maven you may need to add the appropriate dependency to your pom.xml. You can find spring-test at mvnrepository.com.

提交回复
热议问题