@SuppressWarnings("checkstyle:MagicNumber")
    @Test
    void testTimeout() {
        Serializable origId = session.getId();
        assertEquals(AbstractSessionManager.DEFAULT_GLOBAL_SESSION_TIMEOUT, session.getTimeout());
        session.touch();
        session.setTimeout(100);
        assertEquals(100, session.getTimeout());
        sleep(150);
        try {
            session.getTimeout();
            fail("Session should have expired.");
        } catch (ExpiredSessionException expected) {
        }
    }
Unit test for the {@link DelegatingSession} class.
core/src/test/java/org/apache/shiro/session/mgt/DelegatingSessionTest.java