MockMvcController { @RequestMapping(value = "/http", method = RequestMethod.POST) String http(HttpServletRequest request, HttpServletResponse rsponse){ logger.info("Request RemoteAddr: {};", request.getRemoteAddr()); return SUCCESS; }    }
@Test public void testHttp() throws Exception{ mockMvc.perform(post("/mock/http").with(request -> { request.setRemoteAddr("192.168.0.1"); return request; })); }