VelocityWrapper { VelocityEngine getVelocityEngine() { return velocityEngine; } VelocityWrapper();  VelocityWrapper(Properties properties); String merge(Map<String, Object> contextMap, String templateFileName);  }
@Test public void canInitWithDefault() throws Exception { VelocityWrapper wrapper = new VelocityWrapper(); VelocityEngine velocityEngine = wrapper.getVelocityEngine(); assertThat(velocityEngine.getProperty("classpath.resource.loader.class"), equalTo("org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader")); assertThat(velocityEngine.getProperty("runtime.log.logsystem.class"), equalTo("org.apache.velocity.runtime.log.SimpleLog4JLogSystem")); assertThat(velocityEngine.getProperty("runtime.log.logsystem.log4j.category"), equalTo("velocity")); assertThat(velocityEngine.getProperty("runtime.log.logsystem.log4j.logger"), equalTo("velocity")); }
@Test public void canInitWithProperty() throws Exception { Properties properties = new Properties(); properties.put("property1", "value1"); properties.put("property2", "value2"); VelocityWrapper wrapper = new VelocityWrapper(properties); VelocityEngine velocityEngine = wrapper.getVelocityEngine(); assertThat(velocityEngine.getProperty("property1"), equalTo("value1")); assertThat(velocityEngine.getProperty("property2"), equalTo("value2")); }