### Question:
FileAssetIngestor extends AssetIngestor { void importAssets(ActionManager manager) throws IOException { manager.deferredWithResolver(rr -> { JcrUtil.createPath(jcrBasePath, DEFAULT_FOLDER_TYPE, DEFAULT_FOLDER_TYPE, rr.adaptTo(Session.class), true); manager.setCurrentItem(fileBasePath); baseFolder.visitAllFiles(file -> { if (canImportContainingFolder(file)) { Source fileSource = file.getSource(); if (canImportFile(fileSource)) { addFileImportTask(fileSource, manager); } } }); }); } FileAssetIngestor(MimeTypeService mimeTypeService); @Override void buildProcess(ProcessInstance instance, ResourceResolver rr);  }### Answer:
@Test public void testImportAssets() throws Exception { ingestor.baseFolder = ingestor.getBaseFolder(ingestor.fileBasePath); final File rootImage = addFile(tempDirectory, "image.png", "/img/test.png"); final File folder1 = mkdir(tempDirectory, "folder1"); final File folder1Image = addFile(folder1, "image.png", "/img/test.png"); final File folder2 = mkdir(tempDirectory, "folder2"); final File folder3 = mkdir(folder2, "folder3"); final File folder3Image = addFile(folder3, "image.png", "/img/test.png"); when(assetManager.createAsset(anyString(), any(), anyString(), any(Boolean.class))).thenReturn(createdAsset); ingestor.importAssets(actionManager); assertFalse(context.resourceResolver().hasChanges()); assertEquals(3, ingestor.getCount(ingestor.importedAssets)); assertEquals(3, ingestor.getCount(ingestor.createdFolders)); assertEquals(FILE_SIZE * 3, (long) ingestor.importedData.get(AssetIngestor.ReportColumns.bytes)); verify(assetManager, times(3)).createAsset(assetPathCaptor.capture(), any(), any(), eq(false)); assertThat(assetPathCaptor.getAllValues(), containsInAnyOrder("/content/dam/folder1/image.png", "/content/dam/folder2/folder3/image.png", "/content/dam/image.png")); verify(actionManager, times(4)).setCurrentItem(currentItemCaptor.capture()); assertThat(currentItemCaptor.getAllValues(), containsInAnyOrder(tempDirectory.getAbsolutePath(), folder1Image.getAbsolutePath(), folder3Image.getAbsolutePath(), rootImage.getAbsolutePath())); }