use of com.adobe.acs.commons.util.datadefinitions.impl.TitleAndNodeNameDefinitionBuilderImpl in project acs-aem-commons by Adobe-Consulting-Services.
the class AssetFolderCreatorTest method setUp.
@Before
public void setUp() throws Exception {
context.create().resource("/content/dam", JcrConstants.JCR_PRIMARYTYPE, "sling:Folder");
context.resourceResolver().commit();
final Map<String, ResourceDefinitionBuilder> resourceDefinitionBuilders = new HashMap<>();
resourceDefinitionBuilders.put(AssetFolderCreator.AssetFolderBuilder.LOWERCASE_WITH_DASHES.name(), new LowercaseWithDashesDefinitionBuilderImpl());
resourceDefinitionBuilders.put(AssetFolderCreator.AssetFolderBuilder.TITLE_AND_NODE_NAME.name(), new TitleAndNodeNameDefinitionBuilderImpl());
resourceDefinitionBuilders.put(AssetFolderCreator.AssetFolderBuilder.TITLE_TO_NODE_NAME.name(), new JcrValidNameDefinitionBuilderImpl());
assetFolderCreator = new AssetFolderCreator(resourceDefinitionBuilders);
assetFolderCreator.excelFile = getClass().getResourceAsStream("/com/adobe/acs/commons/mcp/impl/processes/asset-folder-creator.xlsx");
doAnswer(new Answer() {
@Override
public Object answer(InvocationOnMock invocation) throws Throwable {
CheckedConsumer<ResourceResolver> method = (CheckedConsumer<ResourceResolver>) invocation.getArguments()[0];
method.accept(context.resourceResolver());
return null;
}
}).when(actionManager).withResolver(any(CheckedConsumer.class));
}
Aggregations