java.lang.Object | |
↳ | com.atlassian.jira.user.MockUser |
A convenient mock for User that supplies reasonable behaviour for unit tests.
Note that creating a MockUser
does not automatically ensure that it can be
resolved by the UserManager
or UserKeyService
, so unit tests may need
to provide mocks for one or both of those services as well.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Convenience constructor that is equivalent to
MockUser(username, "", null, null) . | |||||||||||
Convenience constructor that is equivalent to
MockUser(username, fullName, email, null) . | |||||||||||
Creates a new mock user with the specified information.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
A
MockUser is always active by default. | |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
com.atlassian.crowd.embedded.api.Attributes
| |||||||||||
From interface
com.atlassian.crowd.embedded.api.User
| |||||||||||
From interface
java.lang.Comparable
| |||||||||||
From interface
java.security.Principal
|
Convenience constructor that is equivalent to
MockUser(username, "", null, null)
.
Convenience constructor that is equivalent to
MockUser(username, fullName, email, null)
.
Creates a new mock user with the specified information.
username | the value to be returned for getName() |
---|---|
fullName | the value to be returned for getDisplayName() |
the value to be returned for getEmailAddress() |
|
values | a map to provide user attributes, such as are returned
by getKeys() and getValues(String) . May be
null , in which case an empty map is used.
|
A MockUser
is always active by default.