use of org.craftercms.engine.util.groovy.ContentStoreResourceConnector in project engine by craftercms.
the class RestScriptsControllerTest method createSiteContext.
private SiteContext createSiteContext(ContentStoreService storeService) {
SiteContext siteContext = spy(new SiteContext());
CacheTemplate cacheTemplate = CacheTemplateMockUtils.createCacheTemplate();
ContentStoreResourceConnector resourceConnector = new ContentStoreResourceConnector(siteContext);
ScriptFactory scriptFactory = new GroovyScriptFactory(siteContext, resourceConnector, Collections.emptyMap(), false);
when(siteContext.getSiteName()).thenReturn("test");
when(siteContext.getContext()).thenReturn(mock(Context.class));
when(siteContext.getRestScriptsPath()).thenReturn("/scripts");
when(siteContext.getStoreService()).thenReturn(storeService);
when(siteContext.getScriptFactory()).thenReturn(scriptFactory);
when(siteContext.getCacheTemplate()).thenReturn(cacheTemplate);
return siteContext;
}
Aggregations