Commit b33bbd56 authored by Phillip Webb's avatar Phillip Webb

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
parent 4fc8a183
...@@ -37,8 +37,8 @@ import org.springframework.util.Assert; ...@@ -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 = "";
......
...@@ -534,6 +534,11 @@ public abstract class AbstractEmbeddedServletContainerFactoryTests { ...@@ -534,6 +534,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);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment