### Question:
S3AssetIngestor extends AssetIngestor { void importAssets(ActionManager manager) { manager.deferredWithResolver(rr -> { JcrUtil.createPath(jcrBasePath, DEFAULT_FOLDER_TYPE, DEFAULT_FOLDER_TYPE, rr.adaptTo(Session.class), true); manager.setCurrentItem(baseItemName); ObjectListing listing = s3Client.listObjects(bucket, s3BasePath); importAssets(manager, listing); }); } S3AssetIngestor(MimeTypeService mimeTypeService); @Override void init(); @Override void buildProcess(ProcessInstance instance, ResourceResolver rr);  }### Answer:
@Test public void testImportAssets() throws Exception { ingestor.init(); s3Client.putObject(TEST_BUCKET, "image.png", getClass().getResourceAsStream("/img/test.png"), new ObjectMetadata()); s3Client.putObject(TEST_BUCKET, "folder1/", new ByteArrayInputStream(new byte[0]), new ObjectMetadata()); s3Client.putObject(TEST_BUCKET, "folder1/image.png", getClass().getResourceAsStream("/img/test.png"), new ObjectMetadata()); s3Client.putObject(TEST_BUCKET, "folder2/", new ByteArrayInputStream(new byte[0]), new ObjectMetadata()); s3Client.putObject(TEST_BUCKET, "folder2/folder3/", new ByteArrayInputStream(new byte[0]), new ObjectMetadata()); s3Client.putObject(TEST_BUCKET, "folder2/folder3/image.png", getClass().getResourceAsStream("/img/test.png"), new ObjectMetadata()); 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(ReportColumns.bytes)); verify(assetManager, times(3)).createAsset(assetPathCaptor.capture(), any(), any(), eq(false)); assertEquals(Arrays.asList("/content/dam/folder1/image.png", "/content/dam/folder2/folder3/image.png", "/content/dam/image.png"), assetPathCaptor.getAllValues()); verify(actionManager, times(4)).setCurrentItem(currentItemCaptor.capture()); assertEquals(Arrays.asList("testbucket", "testbucket:folder1/image.png", "testbucket:folder2/folder3/image.png", "testbucket:image.png"), currentItemCaptor.getAllValues()); }