use of org.kie.internal.task.api.UserInfo in project jbpm by kiegroup.
the class LDAPUserInfoImplTest method testGroupsInvalidScope.
@Test
public void testGroupsInvalidScope() {
Properties properties = createUserInfoProperties();
properties.setProperty(LDAPUserInfoImpl.SEARCH_SCOPE, "xyz");
UserInfo ldapUserInfo = createLdapUserInfoCn(properties);
assertGroups(ldapUserInfo, true, true, false, false);
}
use of org.kie.internal.task.api.UserInfo in project jbpm by kiegroup.
the class LDAPUserInfoImplTest method testGroupsObjectScopeBaseDnContext.
@Test
public void testGroupsObjectScopeBaseDnContext() {
UserInfo ldapUserInfo = createLdapUserInfoWithGroupCtx(OBJECT_SCOPE, "dc=jbpm,dc=org");
assertGroups(ldapUserInfo, false, false, false, false);
}
use of org.kie.internal.task.api.UserInfo in project jbpm by kiegroup.
the class LDAPUserInfoImplTest method testUsersSubtreeScopeEngContext.
@Test
public void testUsersSubtreeScopeEngContext() {
UserInfo ldapUserInfo = createLdapUserInfoWithUserCtx(SUBTREE_SCOPE, "ou=ENG,ou=People,dc=jbpm,dc=org");
assertUsers(ldapUserInfo, false, false, true, true);
}
use of org.kie.internal.task.api.UserInfo in project jbpm by kiegroup.
the class LDAPUserInfoImplTest method testGetDisplayName.
private void testGetDisplayName(OrganizationalEntity entity, String expectedName, boolean customAttribute) {
Properties properties = createUserInfoProperties();
if (customAttribute) {
properties.setProperty(LDAPUserInfoImpl.NAME_ATTR_ID, "name");
}
if (entity.getId().startsWith("uid=") || entity.getId().startsWith("cn=")) {
properties.setProperty(LDAPUserInfoImpl.IS_ENTITY_ID_DN, "true");
}
UserInfo ldapUserInfo = new LDAPUserInfoImpl(properties);
String name = ldapUserInfo.getDisplayName(entity);
Assertions.assertThat(name).isNotNull();
Assertions.assertThat(name).isEqualTo(expectedName);
}
use of org.kie.internal.task.api.UserInfo in project jbpm by kiegroup.
the class LDAPUserInfoImplTest method testGroupsOneLevelScopeRolesContext.
@Test
public void testGroupsOneLevelScopeRolesContext() {
UserInfo ldapUserInfo = createLdapUserInfoWithGroupCtx(ONELEVEL_SCOPE, "ou=Roles,dc=jbpm,dc=org");
assertGroups(ldapUserInfo, true, true, false, false);
}
Aggregations