Tomcat8DeltaSessionManager extends DeltaSessionManager<Tomcat8CommitSessionValve> { @Override public void stopInternal() throws LifecycleException { stopInternalBase(); if (getLogger().isDebugEnabled()) { getLogger().debug(this + ": Stopping"); } try { unload(); } catch (IOException e) { getLogger().error("Unable to unload sessions", e); } this.started.set(false); fireLifecycleEvent(STOP_EVENT, null); destroyInternalBase(); getSessionsToTouch().clear(); cancelTimer(); unregisterJvmRouteBinderValve(); if (isCommitValveEnabled()) { unregisterCommitSessionValve(); } setLifecycleState(LifecycleState.STOPPING); }  @Override void startInternal(); @Override void stopInternal(); @Override int getMaxInactiveInterval(); @Override Context getTheContext(); @Override void setMaxInactiveInterval(final int interval);  }
@Test public void stopInternal() throws LifecycleException, IOException { doNothing().when((Tomcat8DeltaSessionManager) manager).startInternalBase(); doNothing().when((Tomcat8DeltaSessionManager) manager).destroyInternalBase(); doReturn(true).when(manager).isCommitValveEnabled(); doNothing().when(manager).unload(); doNothing().when((Tomcat8DeltaSessionManager) manager) .setLifecycleState(LifecycleState.STOPPING); ((Tomcat8DeltaSessionManager) manager).stopInternal(); assertThat(manager.started).isFalse(); verify((Tomcat8DeltaSessionManager) manager).setLifecycleState(LifecycleState.STOPPING); }