mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 00:45:44 +01:00
throw io exception if template is not parse able
This commit is contained in:
@@ -58,6 +58,18 @@ public class FreemarkerTemplateEngineTest extends TemplateEngineTestBase
|
||||
|
||||
//~--- get methods ----------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String getDefectTemplateResource()
|
||||
{
|
||||
return "sonia/scm/template/006.ftl";
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
|
||||
@@ -58,6 +58,18 @@ public class MustacheTemplateEngineTest extends TemplateEngineTestBase
|
||||
|
||||
//~--- get methods ----------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String getDefectTemplateResource()
|
||||
{
|
||||
return "sonia/scm/template/005.mustache";
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
|
||||
@@ -69,6 +69,14 @@ public abstract class TemplateEngineTestBase
|
||||
|
||||
//~--- get methods ----------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public abstract String getDefectTemplateResource();
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
@@ -79,6 +87,21 @@ public abstract class TemplateEngineTestBase
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@Test(expected = IOException.class)
|
||||
public void testGetDefectTemplate() throws IOException
|
||||
{
|
||||
ServletContext context = mock(ServletContext.class);
|
||||
TemplateEngine engine = createEngine(context);
|
||||
|
||||
engine.getTemplate(getDefectTemplateResource());
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user