springboot使用是org.mockito,这里也使用这个
HttpServletRequest request = mock(HttpServletRequest.class);
when(request.getHeader("userInfo")).thenReturn("{}");
when(request.getHeaderNames()).thenReturn(new Hashtable().elements());
ServletRequestAttributes attributes = new ServletRequestAttributes(request);
RequestContextHolder.setRequestAttributes(attributes);
















