InternalSessionTest.java revision fa03f17e603602dd9503a88cec3c310072c93cca
/*
* The contents of this file are subject to the terms of the Common Development and
* Distribution License (the License). You may not use this file except in compliance with the
* License.
*
* You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2016 ForgeRock AS.
*/
public class InternalSessionTest {
public void setUp() {
MockitoAnnotations.initMocks(this);
}
public void tearDown() {
}
@Test
public void shouldSetDefaultTimeoutsWhenConstructed() {
// Given
// When
// Then
}
@Test
public void shouldAllowTimeoutsToBeConfigured() {
// Given
// When
// Then
}
@Test
public void shouldAdjustTimeRemainingBasedOnCurrentTime() {
// Given
// When
// Then
}
@Test
public void shouldAdjustTimeRemainingWhenLatestAccessTimeIsUpdated() {
// Given
// When
// Then
}
@Test
public void expirationTimeShouldNotExceedMaxSessionTime() {
// Given
// When
// Then
long expectedExpirationTimeInSeconds = MILLISECONDS.toSeconds(FrozenTimeService.INSTANCE.plus(4, MINUTES));
}
@Test
public void calculatesMaxSessionExpirationTime() {
// Given a session created at "10 minutes" with a max session time of 30 minutes...
// Then max session expiration time should occur at "40 minutes"
}
@Test
public void calculatesMaxIdleExpirationTime() {
// Given a session created at "10 minutes" with a max idle time of 5 minutes...
// When current time is "16 minutes", and the session has not been idle for any time...
// Then idle expiration time should occur at "21 minutes"
}
private InternalSession createSession() {
return new InternalSession(
}
}