Constructor and Description |
---|
ExpectMap(Map<K,V> actual)
Creates and instance for the given non-null map.
|
Modifier and Type | Method and Description |
---|---|
protected T |
check(boolean cond,
String msg,
Object... args) |
ExpectMap<K,V> |
contains(K key,
V value)
Checks, if the map contains an entry with the given
key and value . |
ExpectMap<K,V> |
containsKey(K key)
Checks, that the map contains an entry for the given key.
|
ExpectMap<K,V> |
containsNotKey(K key)
Checks, that the map does not contain an entry for the given key.
|
ExpectCollection<Map.Entry<K,V>> |
entrySet()
Returns an
ExpectCollection to futher check the map’s entry set. |
static <K,V> ExpectMap<K,V> |
expectMap(Map<K,V> actual)
Check for non-null
Map and provides further checks on the actual
map in a fluent API. |
ExpectMap<K,V> |
hasSize(int expected)
Checks, if the map has the expected size.
|
ExpectMap<K,V> |
isEmpty()
Checks, if the map is empty.
|
ExpectCollection<K> |
keys()
Returns an
ExpectCollection for the keys of this map for further
checks. |
ExpectCollection<V> |
values()
Returns an
ExpectCollection for the values of this map for
further checks. |
public static <K,V> ExpectMap<K,V> expectMap(Map<K,V> actual)
Check for non-null Map
and provides further checks on the actual
map in a fluent API.
public ExpectMap<K,V> hasSize(int expected)
Checks, if the map has the expected size.
expected
- The expected size of the map.public ExpectMap<K,V> contains(K key, V value)
Checks, if the map contains an entry with the given key
and value
.
key
- The key that must be contained in the map.value
- The values that must be belong to the key.public ExpectMap<K,V> containsKey(K key)
Checks, that the map contains an entry for the given key.
key
- The key that must be contained in the map.public ExpectMap<K,V> containsNotKey(K key)
Checks, that the map does not contain an entry for the given key.
key
- The key that must be not contained in the map.public ExpectCollection<V> values()
Returns an ExpectCollection
for the values of this map for
further checks.
public ExpectCollection<K> keys()
Returns an ExpectCollection
for the keys of this map for further
checks.
public ExpectCollection<Map.Entry<K,V>> entrySet()
Returns an ExpectCollection
to futher check the map’s entry set.
Copyright © 2019. All rights reserved.