SessionManagerImpl implements SessionManager { @Override public void extendSessionTime( Session userSession ) { Date currentDate = new Date( System.currentTimeMillis() ); userSession.setEndDate( DateUtils.addMinutes( currentDate, SESSION_TIMEOUT ) ); } SessionManagerImpl( IdentityDataService identityDataService ); @Override void startSessionController(); @Override void stopSessionController(); @Override Session startSession( String sessionId, Session userSession, User user ); @Override Session getValidSession( String sessionId ); @Override void extendSessionTime( Session userSession ); @Override void extendSessionTime( String sessionId ); @Override void endSession( String sessionId ); @PermitAll @Override void invalidateSessions( Date currentDate ); @Override int getSessionTimeout(); static void setSessionTimeout( final int sessionTimeout ); @Override Map getSessionContext();  }
@Test public void testExtendSessionTime() { Date sessionDateBefore = session.getStartDate(); sessionManager.extendSessionTime (session); long mSeconds = session.getEndDate().getTime() - sessionDateBefore.getTime(); mSeconds = (mSeconds/1000)/60; assertTrue(mSeconds >= sessionManager.getSessionTimeout()); }