public final class

MapMatchers

extends Object
java.lang.Object
   ↳ com.atlassian.jira.matchers.MapMatchers

Class Overview

Matchers for java.util.Maps.

Summary

Nested Classes
class MapMatchers.OrderedMapMatcher<K, V> Matcher that checks that the elements of a Map are in a particular order. 
Public Methods
static <K, V> Matcher<Map<K, V>> hasEntries(Map<K, V> expectedMap)
static <K> Matcher<Map<? extends K, ?>> hasKeyThat(Matcher<K> keyMatcher)
static <K, V> 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> Matcher<Map<K, V>> isSingletonMap(K expectedKey, V expectedValue)
static <K, V> 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> 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> 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.
static <K, V> 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.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static Matcher<Map<K, V>> hasEntries (Map<K, V> expectedMap)

public static Matcher<Map<? extends K, ?>> hasKeyThat (Matcher<K> keyMatcher)

public static 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.

Parameters
key1 key of the first entry
value1 value of the first entry
key2 key of the second entry
value2 key of the second entry
Returns
  • matcher for the map equal to a map of provided keys and values

public static Matcher<Map<K, V>> isSingletonMap (K expectedKey, V expectedValue)

public static OrderedMapMatcher<K, V> orderedMap (SortedMap<K, V> map)

Matcher that checks that the elements of a Map are in a particular order.

Parameters
map the map the match against.
Returns
  • a matcher that checks that the elements of a Map are in a particular order.

public static OrderedMapMatcher<K, V> orderedMap (K key1, V value1)

Matcher that checks that the elements of a Map are in a particular order.

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.

public static 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.

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.

public static 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.

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.