← Back to plugin index

Dummy Extended User Persister

Description
Dummy user persister and iterator that can be used for testing. Its behavior is purely determined by the input in the following way:

Getting a User (getPersistentUserByName):

  • If the username contains the string "notfound" a NotFoundException is thrown.
  • If the username contains the string "ambig" a NotUniqueException is thrown.
  • If the username contains the string "except" a PersisterException is thrown.
  • If the username contains the string "nobody" a user with no roles is returned.
  • If the username contains the string "locked" a locked user is returned. Locked date and reason are set.
  • If the username contains the string "pwch" the password change enforced flag is set for the returned user.
  • If the username contains the string "pworder" the password order flag is set for the returned user.
  • If the username contains the string "manyfailed" the user is not locked but has 10 failed logins.
  • For all other user names, a user bean with the specified username and fixed other data is returned. The roles of the user are configurable.

Updating a User (makeUserPersistent):

  • If the username contains the string "notfound" a NotFoundException is thrown.
  • If the username contains the string "ambig" a NotUniqueException is thrown.
  • If the username contains the string "except" a PersisterException is thrown.
  • For all other usernames, the call returns normally.

Inserting a User (insertUser):

  • If the username of the inserted user contains the string "ambig" a NotUniqueException is thrown.
  • If the username of the inserted user contains the string "except" a PersisterException is thrown.
  • For all other usernames, the call returns normally.

Deleting a User (deleteUser):

  • If the username contains the string "notfound" a NotFoundException is thrown.
  • If the username contains the string "ambig" a NotUniqueException is thrown.
  • If the username contains the string "except" a PersisterException is thrown.
  • For all other usernames, the call returns normally.

Getting all User-IDs (getAllUserIds):

  • Returns a list with 100 random user ids.

Getting matching User-IDs (getMatchingUserIds):

  • If the value to match contains the string "empty" an empty list is returned.
  • If the value to match contains the string "big" a list with 10'000 random user ids is returned.
  • If the value to match contains the string "except" a PersisterException is thrown.
  • For all values to match, a list with 100 random user ids is returned.

The method changeUsername(String oldUsername, String newUsername) is not implemented and will throw a NotImplementedException.

Type name
DummyExtendedUserPersister
Class
com.airlock.iam.core.misc.impl.persistency.DummyExtendedUserPersister
May be used by
Properties
User Roles (userRoles)
Description
Defines the set of roles assigned to the users returned by this persister.
The roles must be specified as comma-separated list.
Attributes
String-List
Optional
Default value
[role1, role2]
YAML Template (with default values)

type: DummyExtendedUserPersister
id: DummyExtendedUserPersister-xxxxxx
displayName: 
comment: 
properties:
  userRoles: [role1, role2]