HttpServletRequest request = Mockito.mock(HttpServletRequest.class);Mockito.when(request.getParameter("name")).thenReturn("h2do"); String strName = request.getParameter("name");System.out.println(strName);
本文共 249 字,大约阅读时间需要 1 分钟。
HttpServletRequest request = Mockito.mock(HttpServletRequest.class);Mockito.when(request.getParameter("name")).thenReturn("h2do"); String strName = request.getParameter("name");System.out.println(strName);
转载于:https://my.oschina.net/h2do/blog/268053