Search in sources :

Example 1 with MockComponentManager

use of org.hippoecm.hst.mock.core.container.MockComponentManager in project hippo by NHS-digital-website.

the class ApiSpecificationRendererDirectiveTest method givenDependenciesRegisteredInHstServicesComponentManager.

private void givenDependenciesRegisteredInHstServicesComponentManager() {
    final MockComponentManager mockComponentManager = new MockComponentManager();
    mockComponentManager.addComponent("apiSpecificationRenderer", converter);
    mockComponentManager.addComponent("heavyContentCache", cache);
    HstServices.setComponentManager(mockComponentManager);
}
Also used : MockComponentManager(org.hippoecm.hst.mock.core.container.MockComponentManager)

Example 2 with MockComponentManager

use of org.hippoecm.hst.mock.core.container.MockComponentManager in project hippo by NHS-digital-website.

the class SearchPageComponentTest method setUp.

@Before
public void setUp() {
    HstServices.setComponentManager(new MockComponentManager());
    mockHstRequestContext = new MockHstRequestContext();
    mockHstRequestContext.setParameterInfoProxyFactory(new HstParameterInfoProxyFactoryImpl());
    ModifiableRequestContextProvider.set(mockHstRequestContext);
    underTest = new SearchPageComponent(graphProvider, bloomreachSearchProvider, "applicationId", "redirectUri", "baseUri");
    underTest.init(new MockServletContext(), new MockComponentConfiguration());
}
Also used : MockHstRequestContext(org.hippoecm.hst.mock.core.request.MockHstRequestContext) MockComponentManager(org.hippoecm.hst.mock.core.container.MockComponentManager) MockComponentConfiguration(org.hippoecm.hst.mock.core.request.MockComponentConfiguration) MockServletContext(org.springframework.mock.web.MockServletContext) HstParameterInfoProxyFactoryImpl(org.hippoecm.hst.core.component.HstParameterInfoProxyFactoryImpl) Before(org.junit.Before)

Aggregations

MockComponentManager (org.hippoecm.hst.mock.core.container.MockComponentManager)2 HstParameterInfoProxyFactoryImpl (org.hippoecm.hst.core.component.HstParameterInfoProxyFactoryImpl)1 MockComponentConfiguration (org.hippoecm.hst.mock.core.request.MockComponentConfiguration)1 MockHstRequestContext (org.hippoecm.hst.mock.core.request.MockHstRequestContext)1 Before (org.junit.Before)1 MockServletContext (org.springframework.mock.web.MockServletContext)1