public class

MockApplicationUser

extends Object
implements ApplicationUser
java.lang.Object
   ↳ com.atlassian.jira.user.MockApplicationUser

Class Overview

A convenient mock for ApplicationUser.

Summary

Constants
long FAKE_USER_DIRECTORY_ID
Fields
public static final AtomicLong SEQUENCE
[Expand]
Inherited Fields
From interface com.atlassian.jira.entity.WithId
Public Constructors
MockApplicationUser(String username)
Uses the lowercase form of the supplied username as the key.
MockApplicationUser(String username, long directoryId)
MockApplicationUser(String username, String displayName, String email)
Uses the lowercase form of the supplied username as the key.
MockApplicationUser(String userKey, String username)
Uses the given key as-is.
MockApplicationUser(String userKey, String username, String displayName, String email)
Uses the given key as-is.
MockApplicationUser(String userKey, User user)
Public Methods
boolean equals(Object obj)
long getDirectoryId()
User getDirectoryUser()
String getDisplayName()
Returns the display name of the user.
String getEmailAddress()
Long getId()
String getKey()
Returns the key which distinguishes the ApplicationUser as unique.
String getName()
Synonym for getUsername() and implementation of getName().
String getUsername()
int hashCode()
boolean isActive()
A MockUser is always active by default.
MockApplicationUser setActive(boolean active)
String toString()
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.entity.WithId
From interface com.atlassian.jira.entity.WithKey
From interface com.atlassian.jira.user.ApplicationUser
From interface java.security.Principal

Constants

public static final long FAKE_USER_DIRECTORY_ID

Constant Value: -1 (0xffffffffffffffff)

Fields

public static final AtomicLong SEQUENCE

Public Constructors

public MockApplicationUser (String username)

Uses the lowercase form of the supplied username as the key.

Parameters
username as for MockUser(String)

public MockApplicationUser (String username, long directoryId)

public MockApplicationUser (String username, String displayName, String email)

Uses the lowercase form of the supplied username as the key.

public MockApplicationUser (String userKey, String username)

Uses the given key as-is.

Parameters
userKey desired user's Key, the value to be returned for getKey()
username as for MockUser(String)

public MockApplicationUser (String userKey, String username, String displayName, String email)

Uses the given key as-is.

Parameters
userKey desired user's Key, the value to be returned for getKey()
username as for MockUser(String, String, String)
displayName as for MockUser(String, String, String)
email as for MockUser(String, String, String)

public MockApplicationUser (String userKey, User user)

Public Methods

public boolean equals (Object obj)

public long getDirectoryId ()

public User getDirectoryUser ()

public String getDisplayName ()

Returns the display name of the user. This is sometimes referred to as "full name".

Returns
  • display name of the user, must never be null.

public String getEmailAddress ()

public Long getId ()

public String getKey ()

Returns the key which distinguishes the ApplicationUser as unique. The same key is shared by all Users with the same username (ignoring case) across all user directories.

Returns
  • the key which distinguishes the ApplicationUser as unique

public String getName ()

Synonym for getUsername() and implementation of getName().

Returns
  • the username (login) of the user; must never be null.

public String getUsername ()

public int hashCode ()

public boolean isActive ()

A MockUser is always active by default.

public MockApplicationUser setActive (boolean active)

public String toString ()