Fix session timeout default value

Update DEFAULT_SESSION_TIMEOUT to use TimeUnit.MINUTES.toSeconds(30)
rather than TimeUnit.SECONDS.toMinutes(30) which would always return
0.

See gh-2084
(cherry picked from commit b33bbd56)
pull/2707/head
Phillip Webb 10 years ago
parent c23a764a1c
commit 1c031abdd2

@ -37,8 +37,8 @@ import org.springframework.util.Assert;
public abstract class AbstractConfigurableEmbeddedServletContainer implements public abstract class AbstractConfigurableEmbeddedServletContainer implements
ConfigurableEmbeddedServletContainer { ConfigurableEmbeddedServletContainer {
private static final int DEFAULT_SESSION_TIMEOUT = (int) TimeUnit.SECONDS private static final int DEFAULT_SESSION_TIMEOUT = (int) TimeUnit.MINUTES
.toMinutes(30); .toSeconds(30);
private String contextPath = ""; private String contextPath = "";

@ -530,6 +530,11 @@ public abstract class AbstractEmbeddedServletContainerFactoryTests {
equalTo("test")); equalTo("test"));
} }
@Test
public void defaultSessionTimeout() throws Exception {
assertThat(getFactory().getSessionTimeout(), equalTo(30 * 60));
}
protected String getLocalUrl(String resourcePath) { protected String getLocalUrl(String resourcePath) {
return getLocalUrl("http", resourcePath); return getLocalUrl("http", resourcePath);
} }

Loading…
Cancel
Save