source: class WebHookSecurityInterceptor extends HandlerInterceptorAdapter {
  
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
      return webHookAdapter.isValidRequest(request);
    }
  
  }
  
  class TestWebHookSecurityInterceptor {
  
    @Test
    public void testPreHandle() throws Exception {
  
target:     MyTestWebHookAdapter adapter = new MyTestWebHookAdapter();
      WebHookSecurityInterceptor interceptor = new WebHookSecurityInterceptor();
      // set the adapter like spring would do.
      Field field = WebHookSecurityInterceptor.class.getDeclaredField("webHookAdapter");
      field.setAccessible(true);
      field.set(interceptor, adapter);
      field.setAccessible(false);
      // call the interceptor.
      interceptor.preHandle(new MockHttpServletRequest(), new MockHttpServletResponse(), null);
      // all we have to check is if the adapter was called.
      assertTrue(adapter.wasCalled("isValidRequest"));
    }
  
  }