@VisibleForTesting
  StandardContext addStaticDir(Tomcat tomcat, String contextPath, File dir) {
    try {
      fs.createOrCleanupDir(dir);
    } catch (IOException e) {
      throw new IllegalStateException(format("Fail to create or clean-up directory %s", dir.getAbsolutePath()), e);
    }

    return addContext(tomcat, contextPath, dir);
  }
@Test
  public void create_dir_and_configure_static_directory() throws Exception {
    File dir = temp.newFolder();
    dir.delete();

    underTest.addStaticDir(tomcat, "/deploy", dir);

    assertThat(dir).isDirectory().exists();
    verify(tomcat).addWebapp("/deploy", dir.getAbsolutePath());
  }