public class GroupMatcher<E extends Group>
extends org.hamcrest.TypeSafeMatcher<E>
Constructor and Description |
---|
GroupMatcher(org.hamcrest.Matcher<String> nameMatcher,
org.hamcrest.Matcher<Boolean> activeMatcher,
org.hamcrest.Matcher<Long> directoryIdMatcher) |
Modifier and Type | Method and Description |
---|---|
void |
describeTo(org.hamcrest.Description description) |
static <T extends Group> |
group()
A matcher that matches any group.
|
static <T extends Group> |
group(Class<T> type)
A matcher that matches any group; synonymous with
group() but its argument is used to set the matcher type. |
static <T extends Group> |
groupNamed(String name)
A matcher that matches a group with the given name.
|
protected boolean |
matchesSafely(E item) |
GroupMatcher<E> |
withActive(boolean active) |
GroupMatcher<E> |
withDirectoryId(long directoryId) |
GroupMatcher<E> |
withNameMatching(org.hamcrest.Matcher<String> nameMatcher) |
GroupMatcher<E> |
withNameOf(String name) |
describeMismatch, describeMismatchSafely, matches
public static <T extends Group> GroupMatcher<T> group()
T
- type of group, to avoid castingpublic static <T extends Group> GroupMatcher<T> group(Class<T> type)
group()
but its argument is used to set the matcher type.T
- type of group, to avoid castingtype
- type of group, to avoid casting (this type is not checked at runtime).public static <T extends Group> GroupMatcher<T> groupNamed(String name)
T
- type of group, to avoid castingpublic GroupMatcher<E> withNameMatching(org.hamcrest.Matcher<String> nameMatcher)
nameMatcher
- matcher which must matcher the group's name in order for the new matcher to matchpublic GroupMatcher<E> withNameOf(String name)
name
- string which must equal the group's name in order for the new matcher to matchpublic GroupMatcher<E> withActive(boolean active)
active
- the status must equal the group's status (as per
Group.isActive()
) in order for the new matcher to matchpublic GroupMatcher<E> withDirectoryId(long directoryId)
directoryId
- the directory id must equal the group's directory id in order for the new matcher to matchprotected boolean matchesSafely(E item)
public void describeTo(org.hamcrest.Description description)
Copyright © 2020 Atlassian. All rights reserved.