Class DirectoryGroupMatcher<E extends DirectoryGroup>

java.lang.Object
org.hamcrest.BaseMatcher<T>
org.hamcrest.TypeSafeMatcher<E>
com.atlassian.crowd.test.matchers.DirectoryGroupMatcher<E>
All Implemented Interfaces:
org.hamcrest.Matcher<E>, org.hamcrest.SelfDescribing

public class DirectoryGroupMatcher<E extends DirectoryGroup> extends org.hamcrest.TypeSafeMatcher<E>
  • Constructor Details

    • DirectoryGroupMatcher

      public DirectoryGroupMatcher(@Nullable org.hamcrest.Matcher<String> nameMatcher, @Nullable org.hamcrest.Matcher<Long> directoryIdMatcher, @Nullable org.hamcrest.Matcher<String> directoryNameMatcher)
  • Method Details

    • group

      public static <T extends DirectoryGroup> DirectoryGroupMatcher<T> group()
      A matcher that matches any directoryGroup.
      Type Parameters:
      T - type of directoryGroup, to avoid casting
      Returns:
      a matcher which matches any directoryGroup
    • group

      public static <T extends DirectoryGroup> DirectoryGroupMatcher<T> group(Class<T> type)
      A matcher that matches any directoryGroup; synonymous with group() but its argument is used to set the matcher type.
      Type Parameters:
      T - type of directoryGroup, to avoid casting
      Parameters:
      type - type of directoryGroup, to avoid casting (this type is not checked at runtime).
      Returns:
      a matcher which matches any directoryGroup
    • matching

      public DirectoryGroupMatcher<E> matching(Group group)
      Builds a new specialised matcher to match the attributes in the given group exactly; the returned matcher will only match if all this matcher's non-group-attribute constraints are matched AND all of the matcher's group-attributes are matched. Any existing group attribute constraints will be discarded.
      Parameters:
      group - group which must equivalent to the directory group on all matchers
      Returns:
      a matcher will only match if all this matcher's non-group-attribute constraints are matched AND all of the matcher's group-attributes are matched
    • withDirectoryName

      public DirectoryGroupMatcher<E> withDirectoryName(String directoryName)
    • matchesSafely

      protected boolean matchesSafely(E item)
      Specified by:
      matchesSafely in class org.hamcrest.TypeSafeMatcher<E extends DirectoryGroup>
    • describeTo

      public void describeTo(org.hamcrest.Description description)