use of com.day.cq.wcm.api.components.Component in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class NavigationImplTest method getNavigationUnderTest.
protected Navigation getNavigationUnderTest(String resourcePath) {
Utils.enableDataLayer(context, true);
context.currentResource(resourcePath);
MockSlingHttpServletRequest request = context.request();
request.setContextPath("/core");
Component component = mock(Component.class);
when(component.getResourceType()).thenReturn(resourceType);
SlingBindings slingBindings = (SlingBindings) request.getAttribute(SlingBindings.class.getName());
slingBindings.put(WCMBindings.COMPONENT, component);
request.setAttribute(SlingBindings.class.getName(), slingBindings);
return request.adaptTo(Navigation.class);
}
Aggregations