use of org.apache.syncope.core.persistence.api.entity.MailTemplate in project syncope by apache.
the class JPAMailTemplateDAO method delete.
@Override
public void delete(final String key) {
MailTemplate template = find(key);
if (template == null) {
return;
}
entityManager().remove(template);
}
use of org.apache.syncope.core.persistence.api.entity.MailTemplate in project syncope by apache.
the class MailTemplateTest method save.
@Test
public void save() {
MailTemplate template = entityFactory.newEntity(MailTemplate.class);
template.setKey("new");
template.setTextTemplate("Text template");
MailTemplate actual = mailTemplateDAO.save(template);
assertNotNull(actual);
assertNotNull(actual.getKey());
assertNotNull(actual.getTextTemplate());
assertNull(actual.getHTMLTemplate());
actual.setHTMLTemplate("<html><body><p>HTML template</p></body></html>");
actual = mailTemplateDAO.save(actual);
assertNotNull(actual.getTextTemplate());
assertNotNull(actual.getHTMLTemplate());
}
use of org.apache.syncope.core.persistence.api.entity.MailTemplate in project syncope by apache.
the class MailTemplateTest method find.
@Test
public void find() {
MailTemplate optin = mailTemplateDAO.find("optin");
assertNotNull(optin);
assertNotNull(optin.getTextTemplate());
assertNotNull(optin.getHTMLTemplate());
}
Aggregations