Add Default Expiration Option to MapSessionRepository
Fixes gh-73
This commit is contained in:
@@ -42,4 +42,21 @@ public class MapSessionRepositoryTests {
|
||||
assertThat(repository.getSession(session.getId())).isNull();
|
||||
}
|
||||
|
||||
}
|
||||
@Test
|
||||
public void createSessionDefaultExpiration() {
|
||||
ExpiringSession session = repository.createSession();
|
||||
|
||||
assertThat(session).isInstanceOf(MapSession.class);
|
||||
assertThat(session.getMaxInactiveInterval()).isEqualTo(new MapSession().getMaxInactiveInterval());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void createSessionCustomDefaultExpiration() {
|
||||
final int expectedMaxInterval = new MapSession().getMaxInactiveInterval() + 10;
|
||||
repository.setDefaultMaxInactiveInterval(expectedMaxInterval);
|
||||
|
||||
ExpiringSession session = repository.createSession();
|
||||
|
||||
assertThat(session.getMaxInactiveInterval()).isEqualTo(expectedMaxInterval);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user