### Question:
FileSessionProvider extends SessionProvider { @Override protected void configure(SessionProfile profile) throws IOException { LOG.debug("Configuring file sessions: {}", profile.getProviderClass().getName()); directory = prepareDirectory(profile); LOG.debug("Configured file sessions: {}", directory); }  @Override List<String> getCreatedIds(); @Override SessionMirror create(String id); @Override SessionMirror open(String id); @Override void delete(String id); static final String KEY_DIRECTORY; }### Answer:
@Test(expected = IOException.class) public void config_empty() throws Exception { provider = new FileSessionProvider(); provider.configure(new SessionProfile( FileSessionProvider.class, ProfileContext.system(FileSessionProvider.class.getClassLoader()), Collections.emptyMap())); }
@Test(expected = IOException.class) public void config_unknown_variable() throws Exception { Assume.assumeThat(System.getenv("__UNKNOWN_VARIABLE"), is(nullValue())); provider = new FileSessionProvider(); provider.configure(new SessionProfile( FileSessionProvider.class, ProfileContext.system(FileSessionProvider.class.getClassLoader()), Collections.singletonMap( FileSessionProvider.KEY_DIRECTORY, "${__UNKNOWN_VARIABLE}/hoge"))); }
@Test(expected = IOException.class) public void config_conflict_directory() throws Exception { File file = folder.newFile("conflict"); provider = new FileSessionProvider(); provider.configure(new SessionProfile( FileSessionProvider.class, ProfileContext.system(FileSessionProvider.class.getClassLoader()), Collections.singletonMap( FileSessionProvider.KEY_DIRECTORY, file.getAbsolutePath()))); }