@Test public void testPrepare() throws Exception { Template template = new VelocityTemplate( new MockTemplateResource(_TEMPLATE_FILE_NAME), null, null, _velocityEngine, _templateContextHelper, 60, false); template.put(_TEST_KEY, _TEST_VALUE); template.prepare(null); Object result = template.get(_TEST_VALUE); Assert.assertNotNull(result); Assert.assertTrue(result instanceof String); String stringResult = (String) result; Assert.assertEquals(_TEST_VALUE, stringResult); }
protected void prepareTemplate(ThemeDisplay themeDisplay, Template template) throws Exception { if (themeDisplay == null) { return; } template.prepare(themeDisplay.getRequest()); }