### Question:
AssetFolderCreator extends ProcessDefinition implements Serializable { public void createAssetFolders(ActionManager manager) { assetFolderDefinitions.values().stream().forEach(assetFolderDefinition -> { try { manager.withResolver(rr -> { createAssetFolder(assetFolderDefinition, rr); }); } catch (Exception e) { log.error("Unable to import asset folders via ACS Commons MCP - Asset Folder Creator", e); } }); } AssetFolderCreator(Map<String, ResourceDefinitionBuilder> resourceDefinitionBuilders); @Override void init(); @Override void buildProcess(ProcessInstance instance, ResourceResolver rr); void parseAssetFolderDefinitions(ActionManager manager); void createAssetFolders(ActionManager manager); @Override void storeReport(ProcessInstance instance, ResourceResolver rr); static final String NAME; @FormField(
            name = "Excel File",
            description = "Provide the .xlsx file that defines the Asset Folder taxonomy",
            component = FileUploadComponent.class,
            options = {"mimeTypes=application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "required"}
    )
    transient InputStream excelFile; @FormField(
            name = "Folder Type",
            description = "",
            component = SelectComponent.EnumerationSelector.class,
            options = {"default=UNORDERED_FOLDER", "required"}
    )
    public FolderType assetFolderType; @FormField(
            name = "Primary Creator",
            description = "This will be used first and the Fallback will only be used if this fails to generate a valid Asset Folder definition.",
            component = SelectComponent.EnumerationSelector.class,
            options = {"default=TITLE_AND_NODE_NAME", "required"}
    )
    public AssetFolderBuilder primary; @FormField(
            name = "Fallback Creator",
            description = "This is only invoked when the Primary cannot generate a valid Asset Folder definition. If this can also not generate a valid Asset Folder definition then the row will be skipped.",
            component = SelectComponent.EnumerationSelector.class,
            options = {"default=LOWERCASE_WITH_DASHES", "required"}
    )
    public AssetFolderBuilder fallback; }### Answer:
@Test public void createAssetFolders() throws Exception { assetFolderCreator.primary = AssetFolderCreator.AssetFolderBuilder.TITLE_AND_NODE_NAME; assetFolderCreator.fallback = AssetFolderCreator.AssetFolderBuilder.LOWERCASE_WITH_DASHES; assetFolderCreator.parseAssetFolderDefinitions(actionManager); assetFolderCreator.createAssetFolders(actionManager); assertTrue(context.resourceResolver().hasChanges()); assertEquals("Michigan", context.resourceResolver().getResource("/content/dam/mi/jcr:content").getValueMap().get("jcr:title", String.class)); assertEquals("Charlestown", context.resourceResolver().getResource("/content/dam/ma/boston/charlestown/jcr:content").getValueMap().get("jcr:title", String.class)); assertEquals("West Michigan", context.resourceResolver().getResource("/content/dam/mi/west-mi/jcr:content").getValueMap().get("jcr:title", String.class)); assertEquals("16", context.resourceResolver().getResource("/content/dam/2019/9/16/jcr:content").getValueMap().get("jcr:title", String.class)); }