Package com.atlassian.jira.matchers
Class MapMatchers
java.lang.Object
com.atlassian.jira.matchers.MapMatchers
Matchers for
Map
s.- Since:
- v5.2
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Matcher that checks that the elements of a Map are in a particular order. -
Method Summary
Modifier and TypeMethodDescriptionstatic <K,
V> org.hamcrest.Matcher<Map<K, V>> hasEntries
(Map<K, V> expectedMap) static <K> org.hamcrest.Matcher<Map<? extends K,
?>> hasKeyThat
(org.hamcrest.Matcher<K> keyMatcher) static <K,
V> org.hamcrest.Matcher<Map<K, V>> static <K,
V> org.hamcrest.Matcher<Map<K, V>> isMapOf
(K key1, V value1, K key2, V value2) Guava factory style map matcher for a map containing exactly 2 entries matching the arguments.static <K,
V> org.hamcrest.Matcher<Map<K, V>> isMapWithSize
(int size) static <K,
V> org.hamcrest.Matcher<Map<K, V>> isSingletonMap
(K expectedKey, V expectedValue) static <K,
V> MapMatchers.OrderedMapMatcher<K, V> orderedMap
(SortedMap<K, V> map) Matcher that checks that the elements of a Map are in a particular order.static <K,
V> MapMatchers.OrderedMapMatcher<K, V> orderedMap
(K key1, V value1) Matcher that checks that the elements of a Map are in a particular order.static <K,
V> MapMatchers.OrderedMapMatcher<K, V> orderedMap
(K key1, V value1, K key2, V value2) Matcher that checks that the elements of a Map are in a particular order.static <K,
V> MapMatchers.OrderedMapMatcher<K, V> orderedMap
(K key1, V value1, K key2, V value2, K key3, V value3) Matcher that checks that the elements of a Map are in a particular order.
-
Method Details
-
isSingletonMap
-
hasKeyThat
public static <K> org.hamcrest.Matcher<Map<? extends K,?>> hasKeyThat(org.hamcrest.Matcher<K> keyMatcher) -
orderedMap
Matcher that checks that the elements of a Map are in a particular order.- Type Parameters:
K
- the type of the keys.V
- the type of the values.- Parameters:
map
- the map the match against.- Returns:
- a matcher that checks that the elements of a Map are in a particular order.
-
orderedMap
Matcher that checks that the elements of a Map are in a particular order.- Type Parameters:
K
- the type of the keys.V
- the type of the values.- Parameters:
key1
- the value of the first key.value1
- the value of the second key.- Returns:
- a matcher that checks that the elements of a Map are in a particular order.
-
orderedMap
public static <K,V> MapMatchers.OrderedMapMatcher<K,V> orderedMap(K key1, V value1, K key2, V value2) Matcher that checks that the elements of a Map are in a particular order.- Type Parameters:
K
- the type of the keys.V
- the type of the values.- Parameters:
key1
- the value of the first key.value1
- the value of the first value.key2
- the value of the second key.value2
- the value of the second value.- Returns:
- a matcher that checks that the elements of a Map are in a particular order.
-
orderedMap
public static <K,V> MapMatchers.OrderedMapMatcher<K,V> orderedMap(K key1, V value1, K key2, V value2, K key3, V value3) Matcher that checks that the elements of a Map are in a particular order.- Type Parameters:
K
- the type of the keys.V
- the type of the values.- Parameters:
key1
- the value of the first key.value1
- the value of the first value.key2
- the value of the second key.value2
- the value of the second value.key3
- the value of the third key.value3
- the value of the third value.- Returns:
- a matcher that checks that the elements of a Map are in a particular order.
-
isMapOf
Guava factory style map matcher for a map containing exactly 2 entries matching the arguments.- Type Parameters:
K
- key typeV
- value type- Parameters:
key1
- key of the first entryvalue1
- value of the first entrykey2
- key of the second entryvalue2
- key of the second entry- Returns:
- matcher for the map equal to a map of provided keys and values
-
hasEntries
-
isEmptyMap
-
isMapWithSize
-