### Question:
FileAssetIngestor extends AssetIngestor { void createFolders(ActionManager manager) throws IOException { manager.deferredWithResolver(r -> { JcrUtil.createPath(jcrBasePath, DEFAULT_FOLDER_TYPE, DEFAULT_FOLDER_TYPE, r.adaptTo(Session.class), true); manager.setCurrentItem(fileBasePath); baseFolder.visitAllFolders(folder -> { if (canImportFolder(folder)) { manager.deferredWithResolver(Actions.retry(retries, retryPause, rr -> { manager.setCurrentItem(folder.getSourcePath()); createFolderNode(folder, rr); })); } }); }); } FileAssetIngestor(MimeTypeService mimeTypeService); @Override void buildProcess(ProcessInstance instance, ResourceResolver rr);  }### Answer:
@Test public void testCreateFolders() throws Exception { ingestor.baseFolder = ingestor.getBaseFolder(ingestor.fileBasePath); addFile(tempDirectory, "image.png", "/img/test.png"); File folder1 = mkdir(tempDirectory, "folder1"); addFile(folder1, "image.png", "/img/test.png"); File folder2 = mkdir(tempDirectory, "folder2"); File folder3 = mkdir(folder2, "folder3"); addFile(folder3, "image.png", "/img/test.png"); assertNotNull(context.resourceResolver().getResource("/content/dam")); ingestor.createFolders(actionManager); assertFalse(context.resourceResolver().hasChanges()); assertEquals(3, ingestor.getCount(ingestor.createdFolders)); assertNotNull(context.resourceResolver().getResource("/content/dam/folder1")); assertNotNull(context.resourceResolver().getResource("/content/dam/folder2")); assertNotNull(context.resourceResolver().getResource("/content/dam/folder2/folder3")); verify(actionManager, atLeast(4)).setCurrentItem(currentItemCaptor.capture()); assertThat(currentItemCaptor.getAllValues(), containsInAnyOrder(tempDirectory.getAbsolutePath(), tempDirectory.getAbsolutePath(), folder1.getAbsolutePath(), folder2.getAbsolutePath(), folder3.getAbsolutePath())); }