Tomcat85AgentValve extends ValveBase { @Override public void invoke(Request request, Response response) throws IOException, ServletException { getNext().invoke(request, response); if (request.getSession(false) != null) { String ip = IpInfo.getClientAddress(request.getRequest()); request.getSession(false).setAttribute(ApplicationSession.LAST_ACCESSED_BY_IP, ip); request.getSession(false).setAttribute(ApplicationSession.LAST_ACCESSED_LOCALE, request.getLocale()); } } Tomcat85AgentValve(); @Override void invoke(Request request, Response response);  }
@Test public void invoke() throws IOException, ServletException { Assertions.assertNotNull(new Expectations() { { valve.getNext(); result = valveBase; } }); valve.invoke(request, response); }