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
This commit is contained in:
parent
4fc8a183f2
commit
b33bbd56e7
|
@ -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 {
|
||||||
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…
Reference in New Issue