Class GroupMatcher<E extends Group>
java.lang.Object
org.hamcrest.BaseMatcher<T>
org.hamcrest.TypeSafeMatcher<E>
com.atlassian.crowd.test.matchers.GroupMatcher<E>
- All Implemented Interfaces:
org.hamcrest.Matcher<E>
,org.hamcrest.SelfDescribing
-
Constructor Summary
ConstructorsConstructorDescriptionGroupMatcher
(org.hamcrest.Matcher<String> nameMatcher, org.hamcrest.Matcher<Boolean> activeMatcher, org.hamcrest.Matcher<Long> directoryIdMatcher) -
Method Summary
Modifier and TypeMethodDescriptionvoid
describeTo
(org.hamcrest.Description description) static <T extends Group>
GroupMatcher<T>group()
A matcher that matches any group.static <T extends Group>
GroupMatcher<T>A matcher that matches any group; synonymous withgroup()
but its argument is used to set the matcher type.static <T extends Group>
GroupMatcher<T>groupNamed
(String name) A matcher that matches a group with the given name.protected boolean
matchesSafely
(E item) withActive
(boolean active) withDirectoryId
(long directoryId) withNameMatching
(org.hamcrest.Matcher<String> nameMatcher) withNameOf
(String name) Methods inherited from class org.hamcrest.TypeSafeMatcher
describeMismatch, describeMismatchSafely, matches
Methods inherited from class org.hamcrest.BaseMatcher
_dont_implement_Matcher___instead_extend_BaseMatcher_, isNotNull, toString
-
Constructor Details
-
GroupMatcher
-
-
Method Details
-
group
A matcher that matches any group.- Type Parameters:
T
- type of group, to avoid casting- Returns:
- a matcher which matches any group
-
group
A matcher that matches any group; synonymous withgroup()
but its argument is used to set the matcher type.- Type Parameters:
T
- type of group, to avoid casting- Parameters:
type
- type of group, to avoid casting (this type is not checked at runtime).- Returns:
- a matcher which matches any group
-
groupNamed
A matcher that matches a group with the given name.- Type Parameters:
T
- type of group, to avoid casting- Returns:
- a matcher which matches any group
-
withNameMatching
- Parameters:
nameMatcher
- matcher which must matcher the group's name in order for the new matcher to match- Returns:
- a new matcher which will only match if all this matcher's non-name constraints are matched AND the given name matches
-
withNameOf
- Parameters:
name
- string which must equal the group's name in order for the new matcher to match- Returns:
- a new matcher which will only match if all this matcher's non-name constraints are matched AND the given name matches
-
withActive
- Parameters:
active
- the status must equal the group's status (as perGroup.isActive()
) in order for the new matcher to match- Returns:
- a new matcher which will only match if all this matcher's non-active constraints are matched AND the given active matches
-
withDirectoryId
- Parameters:
directoryId
- the directory id must equal the group's directory id in order for the new matcher to match- Returns:
- a new matcher which will only match if all this matcher's non-directoryId constraints are matched AND the given directoryId matches
-
matchesSafely
-
describeTo
public void describeTo(org.hamcrest.Description description)
-