Class PermittedGroupMatcher<E extends PermittedGroup>

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

public class PermittedGroupMatcher<E extends PermittedGroup> extends org.hamcrest.TypeSafeMatcher<E>
  • Constructor Summary

    Constructors
    Constructor
    Description
    PermittedGroupMatcher(org.hamcrest.Matcher<String> nameMatcher, org.hamcrest.Matcher<Long> directoryIdMatcher, org.hamcrest.Matcher<String> directoryNameMatcher, org.hamcrest.Matcher<Integer> permissionIdMatcher)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    describeTo(org.hamcrest.Description description)
     
    A matcher that matches any directoryGroup.
    group(Class<T> type)
    A matcher that matches any directoryGroup; synonymous with group() but its argument is used to set the matcher type.
    protected boolean
     
    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.

    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • PermittedGroupMatcher

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

    • group

      public static <T extends PermittedGroup> PermittedGroupMatcher<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 PermittedGroup> PermittedGroupMatcher<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 PermittedGroupMatcher<E> matching(PermittedGroup 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
    • matchesSafely

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

      public void describeTo(org.hamcrest.Description description)