WordTemplateRepository implements TemplateRepository { @Override public Template<Object> getTemplate(String documentName, String language) { try { PersistentTemplate persistentTemplate = getPersistentTemplate( documentName, language); return new WordTemplate<Object>(persistentTemplate, contextFactory); } catch (NoResultException e) { return null; } } WordTemplateRepository();  WordTemplateRepository(EntityManager em, TemplateContextFactory contextFactory); void setFileStore(FileStore fileStore); @Override TemplateQuery queryTemplates(); @Override Template<Object> getTemplate(String documentName, String language); @Override Template<E> getTemplate(String documentName, String language,
			Class<? extends E> inputType); @Override Template<E> lockForEdit(Template<E> aTemplate, User user); @Override Template<E> unlock(Template<E> template); @Override Template<E> persist(Template<E> toPersist); @Override void delete(Template<?> template); @Transactional List<Template<Object>> execute(WordTemplateQuery query);  }
@Test @Transactional public void getTemplate() { Template<?> template = repository.getTemplate("test1", "en"); assertNotNull(template); }
@Test @Transactional public void getNonExistingTemplate() { Template<?> template = repository.getTemplate("XXXX", "XX"); assertNull(template); }
@Test(expected = IllegalArgumentException.class) @Transactional public void getTemplateWithWrongInputType() { repository.getTemplate("test1", "en", Date.class); fail("Exception expected"); }