@Test
void load() throws UnsupportedEncodingException {

    Document doc = DocumentTools.INSTANCE.getDocumentBuilder().newDocument();
    Bundle bundle = new Bundle();
    loader.load(bundle, createFolderXml(doc, Folder.ROOT_FOLDER_NAME, Folder.ROOT_FOLDER_ID, null));
    loader.load(bundle, createFolderXml(doc, TEST_FOLDER_1, TEST_FOLDER_1, Folder.ROOT_FOLDER_ID));
    loader.load(bundle, createFolderXml(doc, TEST_FOLDER_2, TEST_FOLDER_2, TEST_FOLDER_1));
    assertFalse(bundle.getFolders().isEmpty());
    assertEquals(3, bundle.getFolders().size());
    final String encodedRoot = URLEncoder.encode(Folder.ROOT_FOLDER_NAME, "UTF-8");
    Folder root = bundle.getFolders().get(encodedRoot);
    assertNotNull(root);
    Assertions.assertEquals(Folder.ROOT_FOLDER_ID, root.getId());
    Assertions.assertEquals(encodedRoot, root.getName());
    assertNull(root.getParentFolder());
    Assertions.assertEquals(encodedRoot, root.getPath());
    Folder folder1 = bundle.getFolders().get(TEST_FOLDER_1);
    assertNotNull(folder1);
    assertEquals(TEST_FOLDER_1, folder1.getId());
    assertEquals(TEST_FOLDER_1, folder1.getName());
    assertEquals(root, folder1.getParentFolder());
    assertEquals(TEST_FOLDER_1, folder1.getPath());
    String f2Path = Paths.get(TEST_FOLDER_1, TEST_FOLDER_2).toString();
    Folder folder2 = bundle.getFolders().get(f2Path);
    assertNotNull(folder2);
    assertEquals(TEST_FOLDER_2, folder2.getId());
    assertEquals(TEST_FOLDER_2, folder2.getName());
    assertEquals(folder1, folder2.getParentFolder());
    assertEquals(f2Path, folder2.getPath());
}