title: No headers when using Mock RestEasy framework
body: <p>I am trying to use the server-side resteasy mock framework to make a GET request however when trying to retrieve the header from the server code it simply doesn't exist.</p>
  
  <p>Below is the Test class</p>
  
  <pre><code>@RunWith(SpringJUnit4ClassRunner.class)
  @ContextConfiguration(locations = { "classpath:base-spring-context.xml" }, loader = DelegatingSmartContextLoader.class)
  @DirtiesContext(classMode = ClassMode.AFTER_CLASS)
  public class TestClass {
  
  // Sets up RESTEasy processors to test @Provider classes
  @Configuration
  static class ContextConfiguration {
  
      @Autowired
      private ApplicationContext context;
  
      @Bean
      public Dispatcher getDispatcher() {
          Dispatcher dispatcher = MockDispatcherFactory.createDispatcher();
          dispatcher.getRegistry().addResourceFactory(getSpringResourceFactory());
          return dispatcher;
      }
  
      @Bean
      public SpringBeanProcessor getRSPostProcessor() {
          SpringBeanProcessor processor = new SpringBeanProcessor(getDispatcher(), getDispatcher().getRegistry(),
                  getDispatcher().getProviderFactory());
          return processor;
      }
  
      @Bean
      public SpringResourceFactory getSpringResourceFactory() {
          SpringResourceFactory noDefaults = new SpringResourceFactory("restClass", context,
                  RestClass.class);
          return noDefaults;
      }
  }
  
  @Autowired
  Dispatcher dispatcher;
  
  @Autowired
  private ServletContext servletContext;
  
  @Before
  public void setUp() {
      ResteasyProviderFactory.getContextDataMap().put(HttpServletRequest.class, new MockHttpServletRequest(servletContext));
  }
  
  @Test
  public void testRest() throws URISyntaxException, ECUNotFoundException {
      MockHttpRequest request = MockHttpRequest.get("/")
              .header("someHeader", "VALUE")
              .accept("application/myValue+XML");
      logger.info("HEADERS: {}",request.getHttpHeaders().getRequestHeader("someHeader"));
      MockHttpResponse response = new MockHttpResponse();
      dispatcher.invoke(request, response);
      logger.info("Got response: \n\tStatus: '{}'\n\tResponse body: '{}'",response.getStatus(),new String(response.getOutput()));
  }
  }
  </code></pre>
  
  <p>Here is the method the Rest method gets triggered from RestClass</p>
  
  <pre><code>@GET
  @Path("/")
  @Produces("application/myValue+XML")
  @GZIP
  public Response getMethod(@Context HttpServletRequest request) {
      String header = request.getHeader("someHeader");
          logger.info("HEADER NAME: {}","someHeader");
          if (header == null || header.isEmpty()) {
              logger.warn("the header must be present in the request");
              return Response.status(Status.BAD_REQUEST).build();
          }
  </code></pre>
  
  <p>The issue here is that the Rest method does not receive the header. It is null however when the printout from the test method clearly shows that the header is set.</p>
  
  <p>Can anybody help understanding why this happens.</p>