@Test
@ExtendWith(TemporaryFolderExtension.class)
void testLoad(TemporaryFolder temporaryFolder) throws IOException {

    PolicyAndFolderLoader policyAndFolderLoader = new PolicyAndFolderLoader(policyConverterRegistry, fileUtils,
            new IdGenerator(), JsonFileUtils.INSTANCE);
    Mockito.when(fileUtils.getFileAsString(Mockito.any(File.class))).thenReturn("policy-content");
    File policyFolder = temporaryFolder.createDirectory("policy");
    File a = new File(policyFolder, "a");
    Assert.assertTrue(a.mkdir());
    File b = new File(a, "b");
    Assert.assertTrue(b.mkdir());
    File c = new File(b, "c");
    Assert.assertTrue(c.mkdir());
    File policy = new File(c, "policy.xml");
    Files.touch(policy);
    File configFolder = temporaryFolder.createDirectory("config");
    File policyDep = new File(configFolder, "policies.yml");
    Map<String, PolicyMetadata> policyMetadataMap = new HashMap<>();
    PolicyMetadata policyMetadata = new PolicyMetadata();
    policyMetadata.setPath("a/b/c");
    policyMetadata.setName("policy");
    policyMetadata.setTag("tag");
    policyMetadata.setType("include");
    Set<Dependency> dependencySet = new HashSet<>();
    dependencySet.add(new Dependency("jdbc", EntityTypes.JDBC_CONNECTION));
    policyMetadata.setUsedEntities(dependencySet);
    policyMetadataMap.put(policyMetadata.getFullPath(), policyMetadata);
    JsonFileUtils.INSTANCE.createFile(policyMetadataMap, policyDep.toPath());
    Bundle bundle = new Bundle();
    policyAndFolderLoader.load(bundle, temporaryFolder.getRoot());
    Assert.assertNotNull(bundle.getFolders().get(""));
    Assert.assertNotNull(bundle.getFolders().get("a/"));
    Assert.assertNotNull(bundle.getFolders().get("a/b/"));
    Folder parentFolder = bundle.getFolders().get("a/b/c/");
    Assert.assertNotNull(parentFolder);
    Policy loadedPolicy = bundle.getPolicies().get("a/b/c/policy");
    Assert.assertNotNull(loadedPolicy);
    Assert.assertEquals(parentFolder, loadedPolicy.getParentFolder());
    Map<Dependency, List<Dependency>> dependencyListMap = bundle.getDependencyMap();
    Assert.assertNotNull(dependencyListMap);
    List<Dependency> dependencyList = dependencyListMap.get(new Dependency("policy", EntityTypes.POLICY_TYPE));
    Assert.assertNotNull(dependencyList);
    Assert.assertEquals(dependencyList.size(), 1);
}