List of usage examples for org.springframework.boot.web.servlet.server AbstractServletWebServerFactory getValidSessionStoreDir
protected final File getValidSessionStoreDir(boolean mkdirs)
From source file:org.springframework.boot.web.servlet.server.AbstractServletWebServerFactoryTests.java
@Test public void getValidSessionStoreWhenSessionStoreNotSet() throws Exception { AbstractServletWebServerFactory factory = getFactory(); File dir = factory.getValidSessionStoreDir(false); assertThat(dir.getName()).isEqualTo("servlet-sessions"); assertThat(dir.getParentFile()).isEqualTo(new ApplicationTemp().getDir()); }
From source file:org.springframework.boot.web.servlet.server.AbstractServletWebServerFactoryTests.java
@Test public void getValidSessionStoreWhenSessionStoreIsRelative() throws Exception { AbstractServletWebServerFactory factory = getFactory(); factory.setSessionStoreDir(new File("sessions")); File dir = factory.getValidSessionStoreDir(false); assertThat(dir.getName()).isEqualTo("sessions"); assertThat(dir.getParentFile()).isEqualTo(new ApplicationHome().getDir()); }
From source file:org.springframework.boot.web.servlet.server.AbstractServletWebServerFactoryTests.java
@Test public void getValidSessionStoreWhenSessionStoreReferencesFile() throws Exception { AbstractServletWebServerFactory factory = getFactory(); factory.setSessionStoreDir(this.temporaryFolder.newFile()); this.thrown.expect(IllegalStateException.class); this.thrown.expectMessage("points to a file"); factory.getValidSessionStoreDir(false); }