FileSystemUtil { public static boolean mkdirs(final Path superDir, final Path dir) { return doMkdirs(superDir, dir, FileUtil.MKDIR_RETRY_COUNT); } private  FileSystemUtil(); static boolean mkdirs(final Path superDir, final Path dir); static void mkdirs(final Path dir);  }
@Test void testCreateBadDirs() { assertThat(FileSystemUtil.mkdirs(null, Paths.get(NO_WRITE_DIR1))).isFalse(); assertThat(FileSystemUtil.mkdirs(null, Paths.get(NO_WRITE_DIR2))).isFalse(); }
@Test void testMkDirs() { final Path rootDir = tempDir; assertThat(FileSystemUtil.mkdirs(rootDir, rootDir.resolve(FileSystemTestUtil.getUniqueTestString()))) .withFailMessage("Should be OK to create a dir off the root") .isTrue(); final Path nonExistingRoot = rootDir.resolve(FileSystemTestUtil.getUniqueTestString()); assertThat(FileSystemUtil .mkdirs(nonExistingRoot, nonExistingRoot.resolve(FileSystemTestUtil.getUniqueTestString() + "/a/b"))) .withFailMessage("Should be NOT be OK to create a dir off a non existant root") .isFalse(); }