FolderLoaderUtils { @Nullable static File getPolicyRootDir(File rootDir) { final File policyRootDir = new File(rootDir, "policy"); if (!policyRootDir.exists()) { return null; } else if (!policyRootDir.isDirectory()) { throw new ConfigLoadException("Expected directory but was file: " + policyRootDir); } return policyRootDir; } private  FolderLoaderUtils(); static void createFolders(Bundle bundle, File rootDir, Map<String, E> folderableMap); static final String SOAP_RESOURCES_FOLDER; }
@Test @ExtendWith(TemporaryFolderExtension.class) void getPolicyRootNoPolicyDirTest(TemporaryFolder temporaryFolder) { assertNull(getPolicyRootDir(temporaryFolder.getRoot())); }
@Test @ExtendWith(TemporaryFolderExtension.class) void getPolicyRootDirPolicyFileErrorTest(TemporaryFolder temporaryFolder) throws IOException { temporaryFolder.createFile("policy"); assertThrows(ConfigLoadException.class, () -> getPolicyRootDir(temporaryFolder.getRoot())); }
@Test @ExtendWith(TemporaryFolderExtension.class) void getPolicyRootDirTest(TemporaryFolder temporaryFolder) { temporaryFolder.createDirectory("policy"); assertNotNull(getPolicyRootDir(temporaryFolder.getRoot())); }