use of com.adobe.cq.export.json.SlingModelFilter in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class ContainerImplTest method setUp.
@BeforeEach
public void setUp() {
context.load().json(TEST_BASE + CoreComponentTestContext.TEST_CONTENT_JSON, CONTAINING_PAGE);
context.registerService(FormStructureHelperFactory.class, resource -> formStructureHelper);
context.registerService(SlingModelFilter.class, new SlingModelFilter() {
private final Set<String> IGNORED_NODE_NAMES = new HashSet<String>() {
{
add(NameConstants.NN_RESPONSIVE_CONFIG);
add(MSMNameConstants.NT_LIVE_SYNC_CONFIG);
add("cq:annotations");
}
};
@Override
public Map<String, Object> filterProperties(Map<String, Object> map) {
return map;
}
@Override
public Iterable<Resource> filterChildResources(Iterable<Resource> childResources) {
return StreamSupport.stream(childResources.spliterator(), false).filter(r -> !IGNORED_NODE_NAMES.contains(r.getName())).collect(Collectors.toList());
}
});
context.registerAdapter(MockSlingHttpServletRequest.class, LinkHandler.class, new LinkHandler());
FormsHelperStubber.createStub();
}
Aggregations