Class AttributesMatcher<E extends Attributes>
java.lang.Object
org.hamcrest.BaseMatcher<T>
org.hamcrest.TypeSafeMatcher<E>
com.atlassian.crowd.test.matchers.AttributesMatcher<E>
- All Implemented Interfaces:
org.hamcrest.Matcher<E>
,org.hamcrest.SelfDescribing
Matcher for any Crowd entity with attributes.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
describeTo
(org.hamcrest.Description description) doesNotHaveKey
(String key) Builds a new specialised matcher that matches entities that do not have a particular attribute key.static <T extends Attributes>
AttributesMatcher<T>A matcher that matches any entity.static <T extends Attributes>
AttributesMatcher<T>entityWithAttributes
(Class<T> type) A matcher that matches any entity with attributes; synonymous withentityWithAttributes()
but its argument is used to set the matcher type.Builds a new specialised matcher that matches entities with at least an attribute that has the given key and singleton value.hasEntry
(org.hamcrest.Matcher<? super String> keyMatcher, org.hamcrest.Matcher<? super Set<String>> valueMatcher) Builds a new specialised matcher that matches entities with at least an attribute that matches simultaneously the key and value matchers.protected boolean
matchesSafely
(Attributes item) Builds a new specialised matcher that matches entities with no attributes.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
-
Method Details
-
entityWithAttributes
A matcher that matches any entity.- Type Parameters:
T
- type of entity, to avoid casting- Returns:
- a matcher which matches any entity
-
entityWithAttributes
A matcher that matches any entity with attributes; synonymous withentityWithAttributes()
but its argument is used to set the matcher type.- Type Parameters:
T
- type of entity, to avoid casting- Parameters:
type
- type of entity, to avoid casting (this type is not checked at runtime).- Returns:
- a matcher which matches any entity
-
withNoAttributes
Builds a new specialised matcher that matches entities with no attributes. Any existing constraint is discarded. -
hasEntry
public AttributesMatcher<E> hasEntry(org.hamcrest.Matcher<? super String> keyMatcher, org.hamcrest.Matcher<? super Set<String>> valueMatcher) Builds a new specialised matcher that matches entities with at least an attribute that matches simultaneously the key and value matchers. Any existing constraint is discarded. -
hasEntry
Builds a new specialised matcher that matches entities with at least an attribute that has the given key and singleton value. Any existing constraint is discarded. -
doesNotHaveKey
Builds a new specialised matcher that matches entities that do not have a particular attribute key. Any existing constraint is discarded. -
matchesSafely
- Specified by:
matchesSafely
in classorg.hamcrest.TypeSafeMatcher<E extends Attributes>
-
describeTo
public void describeTo(org.hamcrest.Description description)
-