use of org.apache.syncope.core.persistence.api.entity.user.UPlainAttrValue in project syncope by apache.
the class UserTest method findByAttributeBooleanValue.
@Test
public void findByAttributeBooleanValue() {
final UPlainAttrValue coolValue = entityFactory.newEntity(UPlainAttrValue.class);
coolValue.setBooleanValue(true);
final List<User> list = userDAO.findByPlainAttrValue("cool", coolValue);
assertEquals(1, list.size());
}
use of org.apache.syncope.core.persistence.api.entity.user.UPlainAttrValue in project syncope by apache.
the class UserTest method findByAttributeValue.
@Test
public void findByAttributeValue() {
final UPlainAttrValue fullnameValue = entityFactory.newEntity(UPlainAttrValue.class);
fullnameValue.setStringValue("Gioacchino Rossini");
final List<User> list = userDAO.findByPlainAttrValue("fullname", fullnameValue);
assertEquals(1, list.size());
}
use of org.apache.syncope.core.persistence.api.entity.user.UPlainAttrValue in project syncope by apache.
the class PlainAttrTest method deleteAttributeValue.
@Test
public void deleteAttributeValue() {
UPlainAttrValue value = plainAttrValueDAO.find("7034de3b-3687-4db5-8454-363468f1a9de", UPlainAttrValue.class);
int attributeValueNumber = value.getAttr().getValues().size();
plainAttrValueDAO.delete(value.getKey(), UPlainAttrValue.class);
plainAttrValueDAO.flush();
assertNull(plainAttrValueDAO.find(value.getKey(), UPlainAttrValue.class));
UPlainAttr attribute = plainAttrDAO.find("9d0d9e40-1b18-488e-9482-37dab82163c9", UPlainAttr.class);
assertEquals(attribute.getValues().size(), attributeValueNumber - 1);
}
Aggregations