DebugInterceptor implements HttpRequestInterceptor, HttpResponseInterceptor { @Override public void process(HttpRequest request, HttpContext context) throws HttpException, IOException { LOGGER.info("Request: {}\nContext: {} ", request.getAllHeaders(), context); }  @Override void process(HttpRequest request, HttpContext context); @Override void process(HttpResponse response, HttpContext context);  }
@Test public void test() throws HttpException, IOException { HttpRequest request = Mockito.mock(HttpRequest.class); HttpResponse response = Mockito.mock(HttpResponse.class); DebugInterceptor dbg = new DebugInterceptor(); dbg.process(request, null); dbg.process(response, null); Mockito.verify(request, Mockito.only()).getAllHeaders(); }