|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.hamcrest.BaseMatcher<T>
org.hamcrest.TypeSafeMatcher<E>
com.atlassian.crowd.test.matchers.UserMatcher<E>
public class UserMatcher<E extends User>
| Constructor Summary | |
|---|---|
UserMatcher(org.hamcrest.Matcher<String> nameMatcher,
org.hamcrest.Matcher<Boolean> activeMatcher,
org.hamcrest.Matcher<String> externalIdMatcher)
|
|
| Method Summary | ||
|---|---|---|
void |
describeTo(org.hamcrest.Description description)
|
|
protected boolean |
matchesSafely(E item)
|
|
static
|
user()
A matcher that matches any user. |
|
static
|
user(Class<T> type)
A matcher that matches any user; synonymous with user() but its argument is used to set the matcher type. |
|
static
|
userNamed(String name)
A matcher that matches a user with the given name. |
|
UserMatcher<E> |
withActive(boolean active)
Builds a new specialised matcher to match the given active status; the returned matcher will only match if all this matcher's non-username constraints are matched AND the given status is equal to the user's active status. |
|
UserMatcher<E> |
withExternalIdMatching(org.hamcrest.Matcher<String> externalIdMatcher)
Builds a new specialised matcher to match on the externalId. |
|
UserMatcher<E> |
withExternalIdOf(String externalId)
Builds a new specialised matcher to match the given externalId. |
|
UserMatcher<E> |
withNameMatching(org.hamcrest.Matcher<String> nameMatcher)
Builds a new specialised matcher to match on username; the returned matcher will only match if all this matcher's non-username constraints are matched AND the given matcher matches the user's username. |
|
UserMatcher<E> |
withNameOf(String name)
Builds a new specialised matcher to match the given username exactly; the returned matcher will only match if all this matcher's non-username constraints are matched AND the given string is equal to the user's username. |
|
| Methods inherited from class org.hamcrest.TypeSafeMatcher |
|---|
describeMismatch, describeMismatchSafely, matches |
| Methods inherited from class org.hamcrest.BaseMatcher |
|---|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public UserMatcher(@Nullable
org.hamcrest.Matcher<String> nameMatcher,
@Nullable
org.hamcrest.Matcher<Boolean> activeMatcher,
@Nullable
org.hamcrest.Matcher<String> externalIdMatcher)
| Method Detail |
|---|
public static <T extends User> UserMatcher<T> user()
T - type of user, to avoid casting
public static <T extends User> UserMatcher<T> user(Class<T> type)
user() but its argument is used to set the matcher type.
T - type of user, to avoid castingtype - type of user, to avoid casting (this type is not checked at runtime).
public static <T extends User> UserMatcher<T> userNamed(String name)
T - type of user, to avoid casting
public UserMatcher<E> withNameMatching(org.hamcrest.Matcher<String> nameMatcher)
nameMatcher - matcher which must match the user's username in order for this matcher to match
public UserMatcher<E> withNameOf(String name)
name - string which must equal the user's username in order for this matcher to match
public UserMatcher<E> withActive(boolean active)
active - the status must equal the user's status (as per
User.isActive()) in order for this matcher to match
public UserMatcher<E> withExternalIdMatching(org.hamcrest.Matcher<String> externalIdMatcher)
externalIdMatcher - matcher which must match the user's externalId (as per
User.getExternalId() ()}) in order for this matcher to match
public UserMatcher<E> withExternalIdOf(String externalId)
externalId - the provided externalId must equal the user's externalId (as per
User.getExternalId() ()}) in order for this matcher to match
protected boolean matchesSafely(E item)
matchesSafely in class org.hamcrest.TypeSafeMatcher<E extends User>public void describeTo(org.hamcrest.Description description)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||