Search in sources :

Example 1 with UPlainAttrValue

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());
}
Also used : UPlainAttrValue(org.apache.syncope.core.persistence.api.entity.user.UPlainAttrValue) User(org.apache.syncope.core.persistence.api.entity.user.User) Test(org.junit.jupiter.api.Test) AbstractTest(org.apache.syncope.core.persistence.jpa.AbstractTest)

Example 2 with UPlainAttrValue

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());
}
Also used : UPlainAttrValue(org.apache.syncope.core.persistence.api.entity.user.UPlainAttrValue) User(org.apache.syncope.core.persistence.api.entity.user.User) Test(org.junit.jupiter.api.Test) AbstractTest(org.apache.syncope.core.persistence.jpa.AbstractTest)

Example 3 with UPlainAttrValue

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);
}
Also used : UPlainAttrValue(org.apache.syncope.core.persistence.api.entity.user.UPlainAttrValue) UPlainAttr(org.apache.syncope.core.persistence.api.entity.user.UPlainAttr) Test(org.junit.jupiter.api.Test) AbstractTest(org.apache.syncope.core.persistence.jpa.AbstractTest)

Aggregations

UPlainAttrValue (org.apache.syncope.core.persistence.api.entity.user.UPlainAttrValue)3 AbstractTest (org.apache.syncope.core.persistence.jpa.AbstractTest)3 Test (org.junit.jupiter.api.Test)3 User (org.apache.syncope.core.persistence.api.entity.user.User)2 UPlainAttr (org.apache.syncope.core.persistence.api.entity.user.UPlainAttr)1