public class AttributesMatcher<E extends Attributes>
extends org.hamcrest.TypeSafeMatcher<E>
Modifier and Type | Method and Description |
---|---|
void |
describeTo(org.hamcrest.Description description) |
AttributesMatcher<E> |
doesNotHaveKey(String key)
Builds a new specialised matcher that matches entities that do not have a particular attribute key.
|
static <T extends Attributes> |
entityWithAttributes()
A matcher that matches any entity.
|
static <T extends Attributes> |
entityWithAttributes(Class<T> type)
A matcher that matches any entity with attributes; synonymous with
entityWithAttributes() but its argument is used to set the matcher type. |
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.
|
AttributesMatcher<E> |
hasEntry(String key,
String singleValue)
Builds a new specialised matcher that matches entities with at least an attribute that has the given key and
singleton value.
|
protected boolean |
matchesSafely(Attributes item) |
AttributesMatcher<E> |
withNoAttributes()
Builds a new specialised matcher that matches entities with no attributes.
|
describeMismatch, describeMismatchSafely, matches
public static <T extends Attributes> AttributesMatcher<T> entityWithAttributes()
T
- type of entity, to avoid castingpublic static <T extends Attributes> AttributesMatcher<T> entityWithAttributes(Class<T> type)
entityWithAttributes()
but its argument is used to set the matcher type.T
- type of entity, to avoid castingtype
- type of entity, to avoid casting (this type is not checked at runtime).public AttributesMatcher<E> withNoAttributes()
public AttributesMatcher<E> hasEntry(org.hamcrest.Matcher<? super String> keyMatcher, org.hamcrest.Matcher<? super Set<String>> valueMatcher)
public AttributesMatcher<E> hasEntry(String key, String singleValue)
public AttributesMatcher<E> doesNotHaveKey(String key)
protected boolean matchesSafely(Attributes item)
matchesSafely
in class org.hamcrest.TypeSafeMatcher<E extends Attributes>
public void describeTo(org.hamcrest.Description description)
Copyright © 2020 Atlassian. All rights reserved.