Mock Httpservletrequest and requestcontext
问题 I am trying to mock RequestContext and HttpServletRequest classes/interfaces but they not working. code: @Override public Object run() { String accessToken= ""; ctx = RequestContext.getCurrentContext(); HttpServletRequest request = ctx.getRequest(); String requestedServiceUri = request.getRequestURI(); //... Mock I have written //... HttpServletRequest request = Mockito.mock(HttpServletRequest.class); RequestContext requestContext = Mockito.mock(RequestContext.class); when(request.getHeader(