use of org.craftercms.engine.service.context.SiteContext in project engine by craftercms.
the class ToCurrentTargetedVersionItemProcessorTest method setUpCurrentConfig.
private void setUpCurrentConfig() {
XMLConfiguration config = mock(XMLConfiguration.class);
when(config.getBoolean(TARGETING_ENABLED_CONFIG_KEY, false)).thenReturn(true);
SiteContext siteContext = mock(SiteContext.class);
when(siteContext.getSiteName()).thenReturn("test");
when(siteContext.getConfig()).thenReturn(config);
SiteContext.setCurrent(siteContext);
}
use of org.craftercms.engine.service.context.SiteContext in project engine by craftercms.
the class ConfigurationScriptJobResolverTest method setUpSiteContext.
private void setUpSiteContext(SiteContext siteContext, ContentStoreService storeService) throws Exception {
XMLConfiguration config = ConfigUtils.readXmlConfiguration(new ClassPathResource("config/site-config.xml"), ',');
config.setListDelimiterHandler(new DefaultListDelimiterHandler(','));
when(siteContext.getSiteName()).thenReturn("default");
when(siteContext.getContext()).thenReturn(mock(Context.class));
when(siteContext.getStoreService()).thenReturn(storeService);
when(siteContext.getConfig()).thenReturn(config);
}
use of org.craftercms.engine.service.context.SiteContext in project engine by craftercms.
the class CandidateTargetedUrlsResolverImplTest method setUpCurrentSiteContext.
private void setUpCurrentSiteContext() {
HierarchicalConfiguration config = mock(HierarchicalConfiguration.class);
when(config.getStringArray(ROOT_FOLDERS_CONFIG_KEY)).thenReturn(ROOT_FOLDERS);
SiteContext context = new SiteContext();
context.setSiteName(SITE_NAME);
context.setConfig(config);
SiteContext.setCurrent(context);
}
use of org.craftercms.engine.service.context.SiteContext in project engine by craftercms.
the class TargetedContentDescriptorMergeStrategyTest method setUpCurrentSiteContext.
private void setUpCurrentSiteContext() {
HierarchicalConfiguration config = mock(HierarchicalConfiguration.class);
when(config.getStringArray(ROOT_FOLDERS_CONFIG_KEY)).thenReturn(ROOT_FOLDERS);
when(config.getStringArray(AVAILABLE_TARGET_IDS_CONFIG_KEY)).thenReturn(AVAILABLE_TARGET_IDS);
when(config.getString(FALLBACK_ID_CONFIG_KEY)).thenReturn(FALLBACK_TARGET_ID);
SiteContext siteContext = new SiteContext();
siteContext.setSiteName(SITE_NAME);
siteContext.setConfig(config);
SiteContext.setCurrent(siteContext);
}
Aggregations