template engine has to use UberClassLoader

This commit is contained in:
Sebastian Sdorra
2014-08-19 21:08:41 +02:00
parent 301cc19290
commit babd1be9fc
3 changed files with 30 additions and 18 deletions

View File

@@ -33,6 +33,12 @@
package sonia.scm.template;
//~--- non-JDK imports --------------------------------------------------------
import sonia.scm.plugin.PluginLoader;
import static org.mockito.Mockito.*;
//~--- JDK imports ------------------------------------------------------------
import java.io.InputStream;
@@ -57,7 +63,12 @@ public class MustacheTemplateEngineTest extends TemplateEngineTestBase
@Override
public TemplateEngine createEngine(ServletContext context)
{
return new MustacheTemplateEngine(context);
PluginLoader loader = mock(PluginLoader.class);
when(loader.getUberClassLoader()).thenReturn(
Thread.currentThread().getContextClassLoader());
return new MustacheTemplateEngine(context, loader);
}
//~--- get methods ----------------------------------------------------------