public class Maps
extends java.lang.Object
Maps.| Modifier and Type | Method and Description |
|---|---|
void |
assertContains(AssertionInfo info,
java.util.Map<?,?> actual,
MapEntry[] entries)
Asserts that the given
Map contains the given entries, in any order. |
<K,V> void |
assertContainsKey(AssertionInfo info,
java.util.Map<K,V> actual,
K key)
Verifies that the actual map contain the given key.
|
<K,V> void |
assertContainsValue(AssertionInfo info,
java.util.Map<K,V> actual,
V value)
Verifies that the actual map contain the given value.
|
void |
assertDoesNotContain(AssertionInfo info,
java.util.Map<?,?> actual,
MapEntry[] entries)
Asserts that the given
Map does not contain the given entries. |
<K,V> void |
assertDoesNotContainKey(AssertionInfo info,
java.util.Map<K,V> actual,
K key)
Verifies that the actual map not contains the given key.
|
<K,V> void |
assertDoesNotContainValue(AssertionInfo info,
java.util.Map<K,V> actual,
V value)
Verifies that the actual map not contains the given value.
|
void |
assertEmpty(AssertionInfo info,
java.util.Map<?,?> actual)
Asserts that the given
Map is empty. |
void |
assertHasSameSizeAs(AssertionInfo info,
java.util.Map<?,?> map,
java.lang.Iterable<?> other)
Asserts that the number of entries in the given
Map has the same size as the other Iterable. |
void |
assertHasSameSizeAs(AssertionInfo info,
java.util.Map<?,?> map,
java.lang.Object[] other)
Asserts that the number of entries in the given
Map has the same size as the other array. |
void |
assertHasSize(AssertionInfo info,
java.util.Map<?,?> actual,
int expectedSize)
Asserts that the number of entries in the given
Map is equal to the expected one. |
void |
assertNotEmpty(AssertionInfo info,
java.util.Map<?,?> actual)
Asserts that the given
Map is not empty. |
void |
assertNullOrEmpty(AssertionInfo info,
java.util.Map<?,?> actual)
Asserts that the given
Map is null or empty. |
static Maps |
instance()
Returns the singleton instance of this class.
|
public static Maps instance()
public void assertNullOrEmpty(AssertionInfo info, java.util.Map<?,?> actual)
Map is null or empty.info - contains information about the assertion.actual - the given map.java.lang.AssertionError - if the given Map is not null *and* contains one or more entries.public void assertEmpty(AssertionInfo info, java.util.Map<?,?> actual)
Map is empty.info - contains information about the assertion.actual - the given Map.java.lang.AssertionError - if the given Map is null.java.lang.AssertionError - if the given Map is not empty.public void assertNotEmpty(AssertionInfo info, java.util.Map<?,?> actual)
Map is not empty.info - contains information about the assertion.actual - the given Map.java.lang.AssertionError - if the given Map is null.java.lang.AssertionError - if the given Map is empty.public void assertHasSize(AssertionInfo info, java.util.Map<?,?> actual, int expectedSize)
Map is equal to the expected one.info - contains information about the assertion.actual - the given Map.expectedSize - the expected size of actual.java.lang.AssertionError - if the given Map is null.java.lang.AssertionError - if the number of entries in the given Map is different than the expected one.public void assertHasSameSizeAs(AssertionInfo info, java.util.Map<?,?> map, java.lang.Iterable<?> other)
Map has the same size as the other Iterable.info - contains information about the assertion.map - the given Map.other - the group to comparejava.lang.AssertionError - if the given Map is null.java.lang.AssertionError - if the given Iterable is null.java.lang.AssertionError - if the number of entries in the given Map does not have the same size.public void assertHasSameSizeAs(AssertionInfo info, java.util.Map<?,?> map, java.lang.Object[] other)
Map has the same size as the other array.info - contains information about the assertion.map - the given Map.other - the group to comparejava.lang.AssertionError - if the given Map is null.java.lang.AssertionError - if the given array is null.java.lang.AssertionError - if the number of entries in the given Map does not have the same size.public void assertContains(AssertionInfo info, java.util.Map<?,?> actual, MapEntry[] entries)
Map contains the given entries, in any order.info - contains information about the assertion.actual - the given Map.entries - the entries that are expected to be in the given Map.java.lang.NullPointerException - if the array of entries is null.java.lang.IllegalArgumentException - if the array of entries is empty.java.lang.NullPointerException - if any of the entries in the given array is null.java.lang.AssertionError - if the given Map is null.java.lang.AssertionError - if the given Map does not contain the given entries.public void assertDoesNotContain(AssertionInfo info, java.util.Map<?,?> actual, MapEntry[] entries)
Map does not contain the given entries.info - contains information about the assertion.actual - the given Map.entries - the entries that are expected to be in the given Map.java.lang.NullPointerException - if the array of entries is null.java.lang.IllegalArgumentException - if the array of entries is empty.java.lang.NullPointerException - if any of the entries in the given array is null.java.lang.AssertionError - if the given Map is null.java.lang.AssertionError - if the given Map contains any of the given entries.public <K,V> void assertContainsKey(AssertionInfo info, java.util.Map<K,V> actual, K key)
info - contains information about the assertion.actual - the given Map.key - the given keyjava.lang.AssertionError - if the actual map is null.java.lang.AssertionError - if the actual map not contains the given key.public <K,V> void assertDoesNotContainKey(AssertionInfo info, java.util.Map<K,V> actual, K key)
info - contains information about the assertion.actual - the given Map.key - the given keyjava.lang.AssertionError - if the actual map is null.java.lang.AssertionError - if the actual map contains the given key.public <K,V> void assertContainsValue(AssertionInfo info, java.util.Map<K,V> actual, V value)
info - contains information about the assertion.actual - the given Map.value - the given valuejava.lang.AssertionError - if the actual map is null.java.lang.AssertionError - if the actual map not contains the given value.public <K,V> void assertDoesNotContainValue(AssertionInfo info, java.util.Map<K,V> actual, V value)
info - contains information about the assertion.actual - the given Map.value - the given valuejava.lang.AssertionError - if the actual map is null.java.lang.AssertionError - if the actual map contains the given value.Copyright © 2007–2018. All rights reserved.