@Nonnull protected RequestTrackingHostValve createSessionTrackerValve() { return new RequestTrackingHostValve( ".*\\.(png|gif|jpg|css|js|ico)$", "somesessionid", _service, Statistics.create(), new AtomicBoolean(true), new CurrentRequest()) { @Override protected String[] getSetCookieHeaders(final Response response) { return RequestTrackingHostValveTest.this.getSetCookieHeaders(response); } }; }
@Test public final void testGetSessionCookieName() throws IOException, ServletException { final RequestTrackingHostValve cut = new RequestTrackingHostValve( null, "foo", _service, Statistics.create(), new AtomicBoolean(true), new CurrentRequest()) { @Override protected String[] getSetCookieHeaders(final Response response) { final Collection<String> result = response.getHeaders("Set-Cookie"); return result.toArray(new String[result.size()]); } }; assertEquals(cut.getSessionCookieName(), "foo"); }