@Test
  public void testSessionGenerated() throws Exception {
    Callback c = (request, response) -> {
      PrintWriter out = response.getWriter();
      out.write(request.getSession().getId());
    };

    tester.setAttribute("callback_1", c);
    tester.start();

    request.setMethod("GET");
    request.setURI("/test/hello");
    request.setHeader("Host", "tester");
    request.setVersion("HTTP/1.0");

    response = HttpTester.parseResponse(tester.getResponses(request.generate()));

    assertTrue("Not a correctly generated session id", response.getContent().endsWith("-GF"));

    List<Cookie> cookies = getCookies(response);
    assertEquals("Session id != JSESSIONID from cookie", response.getContent(),
        getSessionCookie(cookies).getValue());

    Region r = getRegion();
    assertNotNull("Session not found in region", r.get(getSessionCookie(cookies).getValue()));
  }
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