VelocityEngineFactory { public static VelocityEngine getEngine() { try { final Properties props = new Properties(); props.putAll(net.shibboleth.utilities.java.support.velocity.VelocityEngine.getDefaultProperties()); props.setProperty(RuntimeConstants.INPUT_ENCODING, "UTF-8"); props.setProperty(RuntimeConstants.RESOURCE_LOADER, "classpath"); final VelocityEngine velocityEngine = net.shibboleth.utilities.java.support.velocity.VelocityEngine .newVelocityEngine(props); return velocityEngine; } catch (final Exception e) { throw new TechnicalException("Error configuring velocity", e); } }  static VelocityEngine getEngine();  }
@Test public void defaultProperties() { final VelocityEngine engine = VelocityEngineFactory.getEngine(); assertNotNull(engine); assertEquals("org.apache.velocity.runtime.resource.loader.StringResourceLoader", engine.getProperty("resource.loader.string.class")); assertEquals("org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader", engine.getProperty("resource.loader.classpath.class")); assertEquals(vector("classpath"), engine.getProperty("resource.loaders")); assertEquals("UTF-8", engine.getProperty(RuntimeConstants.INPUT_ENCODING)); }