@Before
  public void setUp() throws Exception {

    File gemfireLogFile = new File(tmpdir.newFolder(), "gemfire_modules.log");

    request = HttpTester.newRequest();

    tester = new MyServletTester();
    tester.setContextPath("/test");

    Assume.assumeFalse(System.getProperty("os.name").toLowerCase().contains("win"));

    filterHolder =
        tester.addFilter(SessionCachingFilter.class, "/*", EnumSet.of(DispatcherType.REQUEST));
    filterHolder.setInitParameter(GeodeGlossary.GEMFIRE_PREFIX + "property.mcast-port", "0");
    filterHolder.setInitParameter(GeodeGlossary.GEMFIRE_PREFIX + "property.log-file",
        gemfireLogFile.getAbsolutePath());
    filterHolder.setInitParameter("cache-type", "peer-to-peer");

    servletHolder = tester.addServlet(BasicServlet.class, "/hello");
    servletHolder.setInitParameter("test.callback", "callback_1");

    /*
     * This starts the servlet. Our wrapped servlets *must* start immediately otherwise the
     * ServletContext is not captured correctly.
     */
    servletHolder.setInitOrder(0);
  }
In-container testing using Jetty. This allows us to test context listener events as well as
dispatching actions.
extensions/geode-modules-session/src/integrationTest/java/org/apache/geode/modules/session/internal/filter/SessionReplicationIntegrationJUnitTest.java