use of eu.bcvsolutions.idm.core.eav.api.domain.PersistentType in project CzechIdMng by bcvsolutions.
the class DefaultIdmAutomaticRoleAttributeServiceIntegrationTest method testNotContainsIdentityEav.
@Test
public void testNotContainsIdentityEav() {
String value = "666";
PersistentType persistentType = PersistentType.LONG;
IdmFormAttributeDto attribute = createFormAttribute(AutomaticRoleAttributeRuleType.IDENTITY_EAV, persistentType, false);
IdmAutomaticRoleAttributeDto automaticRole = createAutomaticRuleForEav(AutomaticRoleAttributeRuleComparison.NOT_CONTAINS, AutomaticRoleAttributeRuleType.IDENTITY_EAV, attribute, value);
IdmIdentityDto identity = getHelper().createIdentity((GuardedString) null);
recalculateSync(automaticRole.getId());
checkIdentityRoles(identity, 1);
recalculateSync(automaticRole.getId());
checkIdentityRoles(identity, 1);
saveEavValue(identity, attribute, persistentType, Lists.newArrayList(666));
recalculateSync(automaticRole.getId());
checkIdentityRoles(identity, 0);
recalculateSync(automaticRole.getId());
checkIdentityRoles(identity, 0);
saveEavValue(identity, attribute, persistentType, Lists.newArrayList());
recalculateSync(automaticRole.getId());
checkIdentityRoles(identity, 1);
recalculateSync(automaticRole.getId());
checkIdentityRoles(identity, 1);
saveEavValue(identity, attribute, persistentType, Lists.newArrayList(123666123));
recalculateSync(automaticRole.getId());
checkIdentityRoles(identity, 0);
recalculateSync(automaticRole.getId());
checkIdentityRoles(identity, 0);
saveEavValue(identity, attribute, persistentType, Lists.newArrayList(1666));
recalculateSync(automaticRole.getId());
checkIdentityRoles(identity, 0);
recalculateSync(automaticRole.getId());
checkIdentityRoles(identity, 0);
saveEavValue(identity, attribute, persistentType, Lists.newArrayList(123));
recalculateSync(automaticRole.getId());
checkIdentityRoles(identity, 1);
recalculateSync(automaticRole.getId());
checkIdentityRoles(identity, 1);
saveEavValue(identity, attribute, persistentType, Lists.newArrayList(6662));
recalculateSync(automaticRole.getId());
checkIdentityRoles(identity, 0);
recalculateSync(automaticRole.getId());
checkIdentityRoles(identity, 0);
}
use of eu.bcvsolutions.idm.core.eav.api.domain.PersistentType in project CzechIdMng by bcvsolutions.
the class DefaultIdmAutomaticRoleAttributeServiceIntegrationTest method testIncompatibleNotEqualsMultivaluedContractEav.
@Test(expected = ResultCodeException.class)
public void testIncompatibleNotEqualsMultivaluedContractEav() {
String value = getHelper().createName();
PersistentType persistentType = PersistentType.SHORTTEXT;
IdmFormAttributeDto attribute = createFormAttribute(AutomaticRoleAttributeRuleType.IDENTITY_EAV, persistentType, true);
createAutomaticRuleForEav(AutomaticRoleAttributeRuleComparison.NOT_EQUALS, AutomaticRoleAttributeRuleType.IDENTITY_EAV, attribute, value);
}
use of eu.bcvsolutions.idm.core.eav.api.domain.PersistentType in project CzechIdMng by bcvsolutions.
the class DefaultIdmAutomaticRoleAttributeServiceIntegrationTest method testIncompatibleGreaterThanMultivaluedContractEav.
@Test(expected = ResultCodeException.class)
public void testIncompatibleGreaterThanMultivaluedContractEav() {
String value = getHelper().createName();
PersistentType persistentType = PersistentType.SHORTTEXT;
IdmFormAttributeDto attribute = createFormAttribute(AutomaticRoleAttributeRuleType.CONTRACT_EAV, persistentType, true);
createAutomaticRuleForEav(AutomaticRoleAttributeRuleComparison.GREATER_THAN_OR_EQUAL, AutomaticRoleAttributeRuleType.CONTRACT_EAV, attribute, value);
}
use of eu.bcvsolutions.idm.core.eav.api.domain.PersistentType in project CzechIdMng by bcvsolutions.
the class DefaultIdmAutomaticRoleAttributeServiceIntegrationTest method testIsEmptyIdentityMultivaluedEav.
@Test
public void testIsEmptyIdentityMultivaluedEav() {
PersistentType persistentType = PersistentType.SHORTTEXT;
IdmFormAttributeDto attribute = createFormAttribute(AutomaticRoleAttributeRuleType.IDENTITY_EAV, persistentType, true);
IdmAutomaticRoleAttributeDto automaticRole = createAutomaticRuleForEav(AutomaticRoleAttributeRuleComparison.IS_EMPTY, AutomaticRoleAttributeRuleType.IDENTITY_EAV, attribute, null);
IdmIdentityDto identity = getHelper().createIdentity((GuardedString) null);
recalculateSync(automaticRole.getId());
checkIdentityRoles(identity, 1);
recalculateSync(automaticRole.getId());
checkIdentityRoles(identity, 1);
saveEavValue(identity, attribute, persistentType, Lists.newArrayList(getHelper().createName()));
recalculateSync(automaticRole.getId());
checkIdentityRoles(identity, 0);
recalculateSync(automaticRole.getId());
checkIdentityRoles(identity, 0);
saveEavValue(identity, attribute, persistentType, Lists.newArrayList());
recalculateSync(automaticRole.getId());
checkIdentityRoles(identity, 1);
recalculateSync(automaticRole.getId());
checkIdentityRoles(identity, 1);
saveEavValue(identity, attribute, persistentType, Lists.newArrayList(getHelper().createName(), getHelper().createName(), getHelper().createName()));
recalculateSync(automaticRole.getId());
checkIdentityRoles(identity, 0);
recalculateSync(automaticRole.getId());
checkIdentityRoles(identity, 0);
saveEavValue(identity, attribute, persistentType, Lists.newArrayList());
recalculateSync(automaticRole.getId());
checkIdentityRoles(identity, 1);
recalculateSync(automaticRole.getId());
checkIdentityRoles(identity, 1);
}
use of eu.bcvsolutions.idm.core.eav.api.domain.PersistentType in project CzechIdMng by bcvsolutions.
the class DefaultIdmAutomaticRoleAttributeServiceIntegrationTest method testIncompatibleNotStartWithMultivaluedContractEav.
@Test(expected = ResultCodeException.class)
public void testIncompatibleNotStartWithMultivaluedContractEav() {
String value = getHelper().createName();
PersistentType persistentType = PersistentType.SHORTTEXT;
IdmFormAttributeDto attribute = createFormAttribute(AutomaticRoleAttributeRuleType.IDENTITY_EAV, persistentType, true);
createAutomaticRuleForEav(AutomaticRoleAttributeRuleComparison.NOT_START_WITH, AutomaticRoleAttributeRuleType.IDENTITY_EAV, attribute, value);
}
Aggregations