### Question:
S3AssetIngestor extends AssetIngestor { void createFolders(ActionManager manager) { manager.deferredWithResolver(r -> { JcrUtil.createPath(jcrBasePath, DEFAULT_FOLDER_TYPE, DEFAULT_FOLDER_TYPE, r.adaptTo(Session.class), true); manager.setCurrentItem(baseItemName); ObjectListing listing = s3Client.listObjects(bucket, s3BasePath); createFolders(manager, listing); }); } S3AssetIngestor(MimeTypeService mimeTypeService); @Override void init(); @Override void buildProcess(ProcessInstance instance, ResourceResolver rr);  }### Answer:
@Test public void testCreateFolders() 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()); 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, times(4)).setCurrentItem(currentItemCaptor.capture()); assertEquals(Arrays.asList("testbucket", "testbucket:folder1/", "testbucket:folder2/", "testbucket:folder2/folder3/"), currentItemCaptor.getAllValues()); }