@Bean("ComputationTempFolder")
  public TempFolder provide(ServerFileSystem fs) {
    File tempDir = new File(fs.getTempDir(), "ce");
    try {
      FileUtils.forceMkdir(tempDir);
    } catch (IOException e) {
      throw new IllegalStateException("Unable to create computation temp directory " + tempDir, e);
    }
    File computationDir = new DefaultTempFolder(tempDir).newDir();
    return new DefaultTempFolder(computationDir, true);
  }
@Test
  public void create_temp_dir_if_missing() throws Exception {
    ServerFileSystem fs = mock(ServerFileSystem.class);
    File tmpDir = temp.newFolder();
    when(fs.getTempDir()).thenReturn(tmpDir);
    FileUtils.forceDelete(tmpDir);

    TempFolder folder = underTest.provide(fs);
    assertThat(folder).isNotNull();
    File newDir = folder.newDir();
    assertThat(newDir).exists().isDirectory();
    assertThat(newDir.getParentFile().getCanonicalPath()).startsWith(tmpDir.getCanonicalPath());
  }