RequestWithHeadersServletAdapter implements RequestWithHeaders { @Override public String getHeader(String headerName) { return httpServletRequest.getHeader(headerName); } RequestWithHeadersServletAdapter(HttpServletRequest httpServletRequest); @Override String getHeader(String headerName); @Override Object getAttribute(String name);  }
@Test public void getHeader_delegates_to_servlet_request() { String headerName = "someHeader"; String headerValue = UUID.randomUUID().toString(); doReturn(headerValue).when(requestMock).getHeader(headerName); String actual = adapter.getHeader(headerName); assertThat(actual).isEqualTo(headerValue); verify(requestMock).getHeader(headerName); }