Search in sources :

Example 1 with MockHtmlLibraryManager

use of com.adobe.cq.wcm.core.components.testing.MockHtmlLibraryManager in project aem-core-wcm-components by Adobe-Marketing-Cloud.

the class PageImplTest method internalSetup.

@Override
protected void internalSetup() {
    super.internalSetup();
    ClientLibrary mockClientLibrary = Mockito.mock(ClientLibrary.class);
    lenient().when(mockClientLibrary.getPath()).thenReturn("/apps/wcm/core/page/clientlibs/favicon");
    lenient().when(mockClientLibrary.allowProxy()).thenReturn(true);
    context.registerInjectActivateService(new MockHtmlLibraryManager(mockClientLibrary));
    context.registerInjectActivateService(mockProductInfoProvider);
    context.registerInjectActivateService(new MockPersistenceStrategy(), ImmutableMap.of(Constants.SERVICE_RANKING, Integer.MAX_VALUE));
}
Also used : ClientLibrary(com.adobe.granite.ui.clientlibs.ClientLibrary) MockHtmlLibraryManager(com.adobe.cq.wcm.core.components.testing.MockHtmlLibraryManager) MockPersistenceStrategy(com.adobe.cq.wcm.core.components.testing.MockPersistenceStrategy)

Example 2 with MockHtmlLibraryManager

use of com.adobe.cq.wcm.core.components.testing.MockHtmlLibraryManager in project aem-core-wcm-components by Adobe-Marketing-Cloud.

the class AmpPageImplTest method setUp.

@BeforeEach
void setUp() {
    context.load().json(TEST_BASE + AmpTestContext.TEST_CONTENT_JSON, TEST_ROOT_PAGE);
    context.load().json(TEST_BASE + AmpTestContext.TEST_APPS_JSON, TEST_APPS_ROOT);
    context.registerInjectActivateService(new MockHtmlLibraryManager(mock(com.adobe.granite.ui.clientlibs.ClientLibrary.class)));
}
Also used : MockHtmlLibraryManager(com.adobe.cq.wcm.core.components.testing.MockHtmlLibraryManager) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

MockHtmlLibraryManager (com.adobe.cq.wcm.core.components.testing.MockHtmlLibraryManager)2 MockPersistenceStrategy (com.adobe.cq.wcm.core.components.testing.MockPersistenceStrategy)1 ClientLibrary (com.adobe.granite.ui.clientlibs.ClientLibrary)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1