use of org.apache.syncope.core.persistence.api.entity.user.SecurityQuestion in project syncope by apache.
the class SecurityQuestionTest method save.
@Test
public void save() {
SecurityQuestion securityQuestion = entityFactory.newEntity(SecurityQuestion.class);
securityQuestion.setContent("What is your favorite pet's name?");
SecurityQuestion actual = securityQuestionDAO.save(securityQuestion);
assertNotNull(actual);
assertNotNull(actual.getKey());
}
use of org.apache.syncope.core.persistence.api.entity.user.SecurityQuestion in project syncope by apache.
the class SecurityQuestionLogic method delete.
@PreAuthorize("hasRole('" + StandardEntitlement.SECURITY_QUESTION_DELETE + "')")
public SecurityQuestionTO delete(final String key) {
SecurityQuestion securityQuestion = securityQuestionDAO.find(key);
if (securityQuestion == null) {
LOG.error("Could not find security question '" + key + "'");
throw new NotFoundException(String.valueOf(key));
}
SecurityQuestionTO deleted = binder.getSecurityQuestionTO(securityQuestion);
securityQuestionDAO.delete(key);
return deleted;
}
use of org.apache.syncope.core.persistence.api.entity.user.SecurityQuestion in project syncope by apache.
the class SecurityQuestionTest method find.
@Test
public void find() {
SecurityQuestion securityQuestion = securityQuestionDAO.find("887028ea-66fc-41e7-b397-620d7ea6dfbb");
assertNotNull(securityQuestion);
assertNotNull(securityQuestion.getContent());
}
Aggregations