Class Verify
java.lang.Object
org.junit.Assert
org.eclipse.collections.impl.test.Verify
public final class Verify
extends org.junit.Assert
An extension of the
Assert class, which adds useful additional "assert" methods.
You can import this class instead of Assert, and use it thus, e.g.:
Verify.assertEquals("fred", name); // from original Assert class
Verify.assertContains("fred", nameList); // from new extensions
Verify.assertBefore("fred", "jim", orderedNamesList); // from new extensions
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Base64.Decoderprivate static final Base64.Encoderprivate static final byte[]private static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static StringaddFinalNewline(String string) static <T> voidassertAllSatisfy(Iterable<T> iterable, Predicate<? super T> predicate) static <T> voidassertAllSatisfy(String message, Iterable<T> iterable, Predicate<? super T> predicate) static <K,V> void assertAllSatisfy(Map<K, V> map, Predicate<? super V> predicate) static <T> voidassertAnySatisfy(Iterable<T> iterable, Predicate<? super T> predicate) static <T> voidassertAnySatisfy(String message, Iterable<T> iterable, Predicate<? super T> predicate) static <K,V> void assertAnySatisfy(Map<K, V> map, Predicate<? super V> predicate) static <K,V> void assertBagMultimapsEqual(String multimapName, BagMultimap<K, V> expectedBagMultimap, BagMultimap<K, V> actualBagMultimap) static <K,V> void assertBagMultimapsEqual(BagMultimap<K, V> expectedBagMultimap, BagMultimap<K, V> actualBagMultimap) static voidassertBagsEqual(String bagName, Bag<?> expectedBag, Bag<?> actualBag) static voidassertBagsEqual(Bag<?> expectedBag, Bag<?> actualBag) static voidassertBefore(Object formerItem, Object latterItem, List<?> actualList) Assert that the formerItem appears before the latterItem in the givenCollection.static voidassertBefore(String listName, Object formerItem, Object latterItem, List<?> actualList) Assert that the formerItem appears before the latterItem in the givenCollection.static <T> voidassertClassNonInstantiable(Class<T> aClass) static voidassertContains(Object expectedItem, Collection<?> actualCollection) Assert that the givenCollectioncontains the given item.static voidassertContains(Object expectedItem, ImmutableCollection<?> actualImmutableCollection) Assert that the givenImmutableCollectioncontains the given item.static voidassertContains(String collectionName, Object expectedItem, Collection<?> actualCollection) Assert that the givenCollectioncontains the given item.static voidassertContains(String immutableCollectionName, Object expectedItem, ImmutableCollection<?> actualImmutableCollection) Assert that the givenImmutableCollectioncontains the given item.static voidassertContains(String stringToFind, String stringToSearch) Assert that the givenstringToFindis contained within thestringToSearch.static voidassertContains(String stringName, String stringToFind, String stringToSearch) Assert that the givenstringToFindis contained within thestringToSearch.static voidassertContainsAll(Iterable<?> iterable, Object... items) static voidassertContainsAll(String collectionName, Iterable<?> iterable, Object... items) static voidassertContainsAllEntries(String multimapName, Multimap<?, ?> actualMultimap, Object... expectedKeyValues) Assert the givenMultimapcontains all the given keys and values.static voidassertContainsAllEntries(Multimap<?, ?> actualMultimap, Object... keyValues) Assert the givenMultimapcontains all the given keys and values.static voidassertContainsAllKeyValues(String mapName, Map<?, ?> actualMap, Object... expectedKeyValues) Assert that the givenMapcontains all the given keys and values.static voidassertContainsAllKeyValues(String immutableMapIterableName, ImmutableMapIterable<?, ?> immutableMapIterable, Object... expectedKeyValues) Assert that the givenImmutableMapIterablecontains all the given keys and values.static voidassertContainsAllKeyValues(String mapIterableName, MapIterable<?, ?> mapIterable, Object... expectedKeyValues) Assert that the givenMapIterablecontains all the given keys and values.static voidassertContainsAllKeyValues(String mutableMapIterableName, MutableMapIterable<?, ?> mutableMapIterable, Object... expectedKeyValues) Assert that the givenMutableMapIterablecontains all the given keys and values.static voidassertContainsAllKeyValues(Map<?, ?> actualMap, Object... keyValues) Assert that the givenMapcontains all the given keys and values.static voidassertContainsAllKeyValues(ImmutableMapIterable<?, ?> immutableMapIterable, Object... keyValues) Assert that the givenImmutableMapIterablecontains all the given keys and values.static voidassertContainsAllKeyValues(MapIterable<?, ?> mapIterable, Object... keyValues) Assert that the givenMapIterablecontains all the given keys and values.static voidassertContainsAllKeyValues(MutableMapIterable<?, ?> mutableMapIterable, Object... keyValues) Assert that the givenMutableMapIterablecontains all the given keys and values.static <K,V> void assertContainsEntry(String multimapName, K expectedKey, V expectedValue, Multimap<K, V> actualMultimap) Assert that the givenMultimapcontains an entry with the given key and value.static <K,V> void assertContainsEntry(K expectedKey, V expectedValue, Multimap<K, V> actualMultimap) Assert that the givenMultimapcontains an entry with the given key and value.static voidassertContainsKey(Object expectedKey, Map<?, ?> actualMap) Assert that the givenMapcontains an entry with the given key.static voidassertContainsKey(Object expectedKey, ImmutableMapIterable<?, ?> immutableMapIterable) Assert that the givenImmutableMapIterablecontains an entry with the given key.static voidassertContainsKey(Object expectedKey, MapIterable<?, ?> mapIterable) Assert that the givenMapIterablecontains an entry with the given key.static voidassertContainsKey(Object expectedKey, MutableMapIterable<?, ?> mutableMapIterable) Assert that the givenMutableMapIterablecontains an entry with the given key.static voidassertContainsKey(String mapName, Object expectedKey, Map<?, ?> actualMap) Assert that the givenMapcontains an entry with the given key.static voidassertContainsKey(String immutableMapIterableName, Object expectedKey, ImmutableMapIterable<?, ?> immutableMapIterable) Assert that the givenImmutableMapIterablecontains an entry with the given key.static voidassertContainsKey(String mapIterableName, Object expectedKey, MapIterable<?, ?> mapIterable) Assert that the givenMapIterablecontains an entry with the given key.static voidassertContainsKey(String mutableMapIterableName, Object expectedKey, MutableMapIterable<?, ?> mutableMapIterable) Assert that the givenMutableMapIterablecontains an entry with the given key.static voidassertContainsKeyValue(Object expectedKey, Object expectedValue, Map<?, ?> actualMap) Assert that the givenMapcontains an entry with the given key and value.static voidassertContainsKeyValue(Object expectedKey, Object expectedValue, ImmutableMapIterable<?, ?> mapIterable) Assert that the givenImmutableMapIterablecontains an entry with the given key and value.static voidassertContainsKeyValue(Object expectedKey, Object expectedValue, MapIterable<?, ?> mapIterable) Assert that the givenMapIterablecontains an entry with the given key and value.static voidassertContainsKeyValue(Object expectedKey, Object expectedValue, MutableMapIterable<?, ?> mapIterable) Assert that the givenMutableMapIterablecontains an entry with the given key and value.static voidassertContainsKeyValue(String mapName, Object expectedKey, Object expectedValue, Map<?, ?> actualMap) Assert that the givenMapcontains an entry with the given key and value.static voidassertContainsKeyValue(String mapIterableName, Object expectedKey, Object expectedValue, ImmutableMapIterable<?, ?> immutableMapIterable) Assert that the givenImmutableMapIterablecontains an entry with the given key and value.static voidassertContainsKeyValue(String mapIterableName, Object expectedKey, Object expectedValue, MapIterable<?, ?> mapIterable) Assert that the givenMapIterablecontains an entry with the given key and value.static voidassertContainsKeyValue(String mapIterableName, Object expectedKey, Object expectedValue, MutableMapIterable<?, ?> mutableMapIterable) Assert that the givenMutableMapIterablecontains an entry with the given key and value.static voidassertContainsNone(Collection<?> actualCollection, Object... items) static <T> voidassertCount(int expectedCount, Iterable<T> iterable, Predicate<? super T> predicate) static voidassertDeserializedForm(String expectedBase64Form, Object actualObject) static voidassertEmpty(Iterable<?> actualIterable) Assert that the givenIterableis empty.static voidassertEmpty(String iterableName, Iterable<?> actualIterable) Assert that the givenCollectionis empty.static voidassertEmpty(String mapName, Map<?, ?> actualMap) Assert that the givenMapis empty.static voidassertEmpty(String mutableMapIterableName, MutableMapIterable<?, ?> actualMutableMapIterable) Assert that the givenCollectionis empty.static voidassertEmpty(String multimapName, Multimap<?, ?> actualMultimap) Assert that the givenMultimapis empty.static voidassertEmpty(String iterableName, PrimitiveIterable primitiveIterable) Assert that the givenPrimitiveIterableis empty.static voidassertEmpty(Map<?, ?> actualMap) Assert that the givenMapis empty.static voidassertEmpty(MutableMapIterable<?, ?> actualMutableMapIterable) Assert that the givenMutableMapIterableis empty.static voidassertEmpty(Multimap<?, ?> actualMultimap) Assert that the givenMultimapis empty.static voidassertEmpty(PrimitiveIterable primitiveIterable) Assert that the givenPrimitiveIterableis empty.static <T> voidassertEndsWith(List<T> list, T... items) static <T> voidassertEndsWith(T[] array, T... items) static voidassertEqualsAndHashCode(Object objectA, Object objectB) Assert thatobjectAandobjectBare equal via theObject.equals(Object)method, and that they both return the sameObject.hashCode().static voidassertEqualsAndHashCode(String itemNames, Object objectA, Object objectB) Assert thatobjectAandobjectBare equal (via theObject.equals(Object)method, and that they both return the sameObject.hashCode().static voidassertError(Class<? extends Error> expectedErrorClass, Runnable code) static voidassertInstanceOf(Class<?> expectedClassType, Object actualObject) Assert that the given object is an instanceof expectedClassType.static voidassertInstanceOf(String objectName, Class<?> expectedClassType, Object actualObject) Assert that the given object is an instanceof expectedClassType.static voidassertItemAtIndex(Object expectedItem, int index, Object[] array) Assert that the givenitemis at theindexin the givenarray.static voidassertItemAtIndex(Object expectedItem, int index, List<?> list) static voidassertItemAtIndex(String arrayName, Object expectedItem, int index, Object[] array) static voidassertItemAtIndex(String listName, Object expectedItem, int index, List<?> list) static voidassertIterableEmpty(Iterable<?> iterable) Assert that the givenIterableis empty.static voidassertIterableEmpty(String iterableName, Iterable<?> iterable) Assert that the givenIterableis empty.static voidassertIterableNotEmpty(Iterable<?> iterable) Assert that the givenIterableis not empty.static voidassertIterableNotEmpty(String iterableName, Iterable<?> iterable) Assert that the givenIterableis not empty.static voidassertIterablesEqual(Iterable<?> expectedIterable, Iterable<?> actualIterable) static voidassertIterablesEqual(String iterableName, Iterable<?> expectedIterable, Iterable<?> actualIterable) static voidassertIterableSize(int expectedSize, Iterable<?> actualIterable) Assert the size of the givenIterable.static voidassertIterableSize(String iterableName, int expectedSize, Iterable<?> actualIterable) Assert the size of the givenIterable.static <K,V> void assertListMultimapsEqual(String multimapName, ListMultimap<K, V> expectedListMultimap, ListMultimap<K, V> actualListMultimap) static <K,V> void assertListMultimapsEqual(ListMultimap<K, V> expectedListMultimap, ListMultimap<K, V> actualListMultimap) static voidassertListsEqual(String listName, List<?> expectedList, List<?> actualList) static voidassertListsEqual(List<?> expectedList, List<?> actualList) private static voidassertMapContainsKeys(String mapName, Map<?, ?> actualMap, Object... expectedKeyValues) private static voidassertMapContainsKeys(String immutableMapIterableName, ImmutableMapIterable<?, ?> immutableMapIterable, Object... expectedKeyValues) private static voidassertMapContainsKeys(String mapIterableName, MapIterable<?, ?> mapIterable, Object... expectedKeyValues) private static voidassertMapContainsKeys(String mutableMapIterableName, MutableMapIterable<?, ?> mutableMapIterable, Object... expectedKeyValues) private static voidassertMapContainsValues(String mapName, Map<?, ?> actualMap, Object... expectedKeyValues) private static voidassertMapContainsValues(String immutableMapIterableName, ImmutableMapIterable<?, ?> immutableMapIterable, Object... expectedKeyValues) private static voidassertMapContainsValues(String mapIterableName, MapIterable<?, ?> mapIterable, Object... expectedKeyValues) private static voidassertMapContainsValues(String mutableMapIterableName, MutableMapIterable<?, ?> mutableMapIterable, Object... expectedKeyValues) static voidassertMapsEqual(String mapName, Map<?, ?> expectedMap, Map<?, ?> actualMap) static voidassertMapsEqual(Map<?, ?> expectedMap, Map<?, ?> actualMap) static voidassertNegative(int value) Asserts that a value is negative.static <T> voidassertNoneSatisfy(Iterable<T> iterable, Predicate<? super T> predicate) static <T> voidassertNoneSatisfy(String message, Iterable<T> iterable, Predicate<? super T> predicate) static <K,V> void assertNoneSatisfy(Map<K, V> map, Predicate<? super V> predicate) static voidassertNotContains(Object unexpectedItem, Iterable<?> iterable) Assert that the givenIterabledoes not contain the given item.static voidassertNotContains(Object unexpectedItem, Collection<?> actualCollection) Assert that the givenCollectiondoes not contain the given item.static voidassertNotContains(String collectionName, Object unexpectedItem, Iterable<?> iterable) Assert that the givenIterabledoes not contain the given item.static voidassertNotContains(String collectionName, Object unexpectedItem, Collection<?> actualCollection) Assert that the givenCollectiondoes not contain the given item.static voidassertNotContains(String unexpectedString, String stringToSearch) Assert that the givenunexpectedStringis not contained within thestringToSearch.static voidassertNotContains(String stringName, String unexpectedString, String stringToSearch) Assert that the givenunexpectedStringis not contained within thestringToSearch.static voidassertNotContainsKey(Object unexpectedKey, Map<?, ?> actualMap) Assert that the givenCollectiondoes not contain the given item.static voidassertNotContainsKey(String mapName, Object unexpectedKey, Map<?, ?> actualMap) Assert that the givenCollectiondoes not contain the given item.static voidassertNotEmpty(Iterable<?> actualIterable) Assert that the givenIterableis not empty.static voidassertNotEmpty(String iterableName, Iterable<?> actualIterable) Assert that the givenIterableis not empty.static voidassertNotEmpty(String mapName, Map<?, ?> actualMap) Assert that the givenMapis not empty.static voidassertNotEmpty(String mutableMapIterableName, MutableMapIterable<?, ?> actualMutableMapIterable) Assert that the givenMutableMapIterableis not empty.static voidassertNotEmpty(String multimapName, Multimap<?, ?> actualMultimap) Assert that the givenMultimapis not empty.static voidassertNotEmpty(String iterableName, PrimitiveIterable primitiveIterable) Assert that the givenPrimitiveIterableis not empty.static <T> voidassertNotEmpty(String itemsName, T[] items) static voidassertNotEmpty(Map<?, ?> actualMap) Assert that the givenMapis not empty.static voidassertNotEmpty(MutableMapIterable<?, ?> actualMutableMapIterable) Assert that the givenMutableMapIterableis not empty.static voidassertNotEmpty(Multimap<?, ?> actualMultimap) Assert that the givenMultimapis not empty.static voidassertNotEmpty(PrimitiveIterable primitiveIterable) Assert that the givenPrimitiveIterableis not empty.static <T> voidassertNotEmpty(T[] items) static voidassertNotInstanceOf(Class<?> expectedClassType, Object actualObject) Assert that the given object is not an instanceof expectedClassType.static voidassertNotInstanceOf(String objectName, Class<?> expectedClassType, Object actualObject) Assert that the given object is not an instanceof expectedClassType.static voidassertNotSerializable(Object actualObject) static voidassertObjectNotNull(String objectName, Object actualObject) static voidassertPositive(int value) Asserts that a value is positive.static voidstatic voidstatic voidassertPostSerializedIdentity(Object object) static voidassertSerializedForm(long expectedSerialVersionUID, String expectedBase64Form, Object actualObject) static voidassertSerializedForm(String expectedBase64Form, Object actualObject) static <K,V> void assertSetMultimapsEqual(String multimapName, SetMultimap<K, V> expectedSetMultimap, SetMultimap<K, V> actualSetMultimap) static <K,V> void assertSetMultimapsEqual(SetMultimap<K, V> expectedSetMultimap, SetMultimap<K, V> actualSetMultimap) static voidassertSetsEqual(String setName, Set<?> expectedSet, Set<?> actualSet) static voidassertSetsEqual(Set<?> expectedSet, Set<?> actualSet) static voidassertShallowClone(Cloneable object) Deprecated.since 8.2.0 as will not work with Java 9static voidassertShallowClone(String itemName, Cloneable object) Deprecated.since 8.2.0 as will not work with Java 9static voidassertSize(int expectedSize, Iterable<?> actualIterable) Assert the size of the givenIterable.static voidassertSize(int expectedSize, Object[] actualArray) Assert the size of the given array.static voidassertSize(int expectedSize, Map<?, ?> actualMap) Assert the size of the givenMap.static voidassertSize(int expectedSize, MutableMapIterable<?, ?> mutableMapIterable) Assert the size of the givenMutableMapIterable.static voidassertSize(int expectedSize, Multimap<?, ?> actualMultimap) Assert the size of the givenMultimap.static voidassertSize(int expectedSize, PrimitiveIterable primitiveIterable) Assert the size of the givenPrimitiveIterable.static voidassertSize(int expectedSize, ImmutableSet<?> actualImmutableSet) Assert the size of the givenImmutableSet.static voidassertSize(String iterableName, int expectedSize, Iterable<?> actualIterable) Assert the size of the givenIterable.static voidassertSize(String arrayName, int expectedSize, Object[] actualArray) Assert the size of the given array.static voidassertSize(String mapName, int expectedSize, Map<?, ?> actualMap) Assert the size of the givenMap.static voidassertSize(String mapName, int expectedSize, MutableMapIterable<?, ?> mutableMapIterable) Assert the size of the givenMutableMapIterable.static voidassertSize(String multimapName, int expectedSize, Multimap<?, ?> actualMultimap) Assert the size of the givenMultimap.static voidassertSize(String primitiveIterableName, int expectedSize, PrimitiveIterable actualPrimitiveIterable) Assert the size of the givenPrimitiveIterable.static voidassertSize(String immutableSetName, int expectedSize, ImmutableSet<?> actualImmutableSet) Assert the size of the givenImmutableSet.static <K,V> void assertSortedBagMultimapsEqual(String multimapName, SortedBagMultimap<K, V> expectedSortedBagMultimap, SortedBagMultimap<K, V> actualSortedBagMultimap) static <K,V> void assertSortedBagMultimapsEqual(SortedBagMultimap<K, V> expectedSortedBagMultimap, SortedBagMultimap<K, V> actualSortedBagMultimap) static voidassertSortedBagsEqual(String bagName, SortedBag<?> expectedBag, SortedBag<?> actualBag) static voidassertSortedBagsEqual(SortedBag<?> expectedBag, SortedBag<?> actualBag) static voidassertSortedMapsEqual(String mapName, SortedMapIterable<?, ?> expectedMap, SortedMapIterable<?, ?> actualMap) static voidassertSortedMapsEqual(SortedMapIterable<?, ?> expectedMap, SortedMapIterable<?, ?> actualMap) static <K,V> void assertSortedSetMultimapsEqual(String multimapName, SortedSetMultimap<K, V> expectedSortedSetMultimap, SortedSetMultimap<K, V> actualSortedSetMultimap) static <K,V> void assertSortedSetMultimapsEqual(SortedSetMultimap<K, V> expectedSortedSetMultimap, SortedSetMultimap<K, V> actualSortedSetMultimap) static voidassertSortedSetsEqual(String setName, SortedSet<?> expectedSet, SortedSet<?> actualSet) static voidassertSortedSetsEqual(SortedSet<?> expectedSet, SortedSet<?> actualSet) static <T> voidassertStartsWith(String listName, List<T> list, T... items) static <T> voidassertStartsWith(List<T> list, T... items) static <T> voidassertStartsWith(T[] array, T... items) static voidassertThrows(Class<? extends Exception> expectedExceptionClass, Callable<?> code) static voidassertThrowsWithCause(Class<? extends Exception> expectedExceptionClass, Class<? extends Throwable> expectedCauseClass, Runnable code) Runs theRunnablecodeand asserts that it throws anExceptionof the typeexpectedExceptionClass, which contains a cause of type expectedCauseClass.static voidassertThrowsWithCause(Class<? extends Exception> expectedExceptionClass, Class<? extends Throwable> expectedCauseClass, Callable<?> code) Runs theCallablecodeand asserts that it throws anExceptionof the typeexpectedExceptionClass, which contains a cause of type expectedCauseClass.static voidassertZero(int value) Asserts that a value is positive.private static <T> booleancanInstantiateThroughReflection(Class<T> aClass) private static ObjectdecodeObject(String expectedBase64Form) static voiddenyContainsAny(String collectionName, Collection<?> actualCollection, Object... items) static voiddenyContainsAny(Collection<?> actualCollection, Object... items) static voiddenyContainsKey(Object unexpectedKey, Map<?, ?> actualMap) Deny that the givenMapcontains an entry with the given key.static voiddenyContainsKey(String mapName, Object unexpectedKey, Map<?, ?> actualMap) Deny that the givenMapcontains an entry with the given key.private static StringencodeObject(Object actualObject) static voidMethods inherited from class org.junit.Assert
assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotEquals, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertThat, assertThat, assertThrows, assertThrows, assertTrue, assertTrue, fail, fail
-
Field Details
-
MAX_DIFFERENCES
private static final int MAX_DIFFERENCES- See Also:
-
LINE_SEPARATOR
private static final byte[] LINE_SEPARATOR -
ENCODER
-
DECODER
-
-
Constructor Details
-
Verify
private Verify()
-
-
Method Details
-
fail
-
assertEmpty
-
assertEmpty
Assert that the givenCollectionis empty. -
assertEmpty
Assert that the givenMutableMapIterableis empty. -
assertEmpty
public static void assertEmpty(String mutableMapIterableName, MutableMapIterable<?, ?> actualMutableMapIterable) Assert that the givenCollectionis empty. -
assertEmpty
Assert that the givenPrimitiveIterableis empty. -
assertEmpty
Assert that the givenPrimitiveIterableis empty. -
assertIterableEmpty
-
assertIterableEmpty
-
assertInstanceOf
-
assertInstanceOf
-
assertNotInstanceOf
-
assertNotInstanceOf
-
assertEmpty
-
assertEmpty
-
assertEmpty
-
assertEmpty
-
assertNotEmpty
-
assertNotEmpty
-
assertNotEmpty
Assert that the givenMutableMapIterableis not empty. -
assertNotEmpty
public static void assertNotEmpty(String mutableMapIterableName, MutableMapIterable<?, ?> actualMutableMapIterable) Assert that the givenMutableMapIterableis not empty. -
assertNotEmpty
Assert that the givenPrimitiveIterableis not empty. -
assertNotEmpty
Assert that the givenPrimitiveIterableis not empty. -
assertIterableNotEmpty
-
assertIterableNotEmpty
-
assertNotEmpty
-
assertNotEmpty
-
assertNotEmpty
-
assertNotEmpty
-
assertNotEmpty
-
assertNotEmpty
public static <T> void assertNotEmpty(T[] items) -
assertSize
Assert the size of the given array. -
assertSize
-
assertSize
-
assertSize
-
assertSize
Assert the size of the givenPrimitiveIterable. -
assertSize
public static void assertSize(String primitiveIterableName, int expectedSize, PrimitiveIterable actualPrimitiveIterable) Assert the size of the givenPrimitiveIterable. -
assertIterableSize
-
assertIterableSize
-
assertSize
-
assertSize
-
assertSize
-
assertSize
-
assertSize
Assert the size of the givenMutableMapIterable. -
assertSize
public static void assertSize(String mapName, int expectedSize, MutableMapIterable<?, ?> mutableMapIterable) Assert the size of the givenMutableMapIterable. -
assertSize
Assert the size of the givenImmutableSet. -
assertSize
public static void assertSize(String immutableSetName, int expectedSize, ImmutableSet<?> actualImmutableSet) Assert the size of the givenImmutableSet. -
assertContains
-
assertNotContains
-
assertContains
-
assertNotContains
-
assertCount
-
assertAllSatisfy
-
assertAllSatisfy
-
assertAllSatisfy
-
assertAnySatisfy
-
assertAnySatisfy
-
assertAnySatisfy
-
assertNoneSatisfy
-
assertNoneSatisfy
-
assertNoneSatisfy
-
assertContainsAllKeyValues
-
assertContainsAllKeyValues
-
assertContainsAllKeyValues
Assert that the givenMapIterablecontains all the given keys and values. -
assertContainsAllKeyValues
public static void assertContainsAllKeyValues(String mapIterableName, MapIterable<?, ?> mapIterable, Object... expectedKeyValues) Assert that the givenMapIterablecontains all the given keys and values. -
assertContainsAllKeyValues
public static void assertContainsAllKeyValues(MutableMapIterable<?, ?> mutableMapIterable, Object... keyValues) Assert that the givenMutableMapIterablecontains all the given keys and values. -
assertContainsAllKeyValues
public static void assertContainsAllKeyValues(String mutableMapIterableName, MutableMapIterable<?, ?> mutableMapIterable, Object... expectedKeyValues) Assert that the givenMutableMapIterablecontains all the given keys and values. -
assertContainsAllKeyValues
public static void assertContainsAllKeyValues(ImmutableMapIterable<?, ?> immutableMapIterable, Object... keyValues) Assert that the givenImmutableMapIterablecontains all the given keys and values. -
assertContainsAllKeyValues
public static void assertContainsAllKeyValues(String immutableMapIterableName, ImmutableMapIterable<?, ?> immutableMapIterable, Object... expectedKeyValues) Assert that the givenImmutableMapIterablecontains all the given keys and values. -
denyContainsAny
-
assertContainsNone
-
assertContains
Assert that the givenCollectioncontains the given item. -
assertContains
public static void assertContains(String collectionName, Object expectedItem, Collection<?> actualCollection) Assert that the givenCollectioncontains the given item. -
assertContains
public static void assertContains(Object expectedItem, ImmutableCollection<?> actualImmutableCollection) Assert that the givenImmutableCollectioncontains the given item. -
assertContains
public static void assertContains(String immutableCollectionName, Object expectedItem, ImmutableCollection<?> actualImmutableCollection) Assert that the givenImmutableCollectioncontains the given item. -
assertContainsAll
-
assertContainsAll
-
assertListsEqual
-
assertListsEqual
-
assertSetsEqual
-
assertSetsEqual
-
assertSortedSetsEqual
-
assertSortedSetsEqual
-
assertSortedBagsEqual
-
assertSortedBagsEqual
-
assertSortedMapsEqual
public static void assertSortedMapsEqual(SortedMapIterable<?, ?> expectedMap, SortedMapIterable<?, ?> actualMap) -
assertSortedMapsEqual
public static void assertSortedMapsEqual(String mapName, SortedMapIterable<?, ?> expectedMap, SortedMapIterable<?, ?> actualMap) -
assertIterablesEqual
-
assertIterablesEqual
-
assertMapsEqual
-
assertMapsEqual
-
assertBagsEqual
-
assertBagsEqual
-
assertListMultimapsEqual
public static <K,V> void assertListMultimapsEqual(ListMultimap<K, V> expectedListMultimap, ListMultimap<K, V> actualListMultimap) -
assertListMultimapsEqual
public static <K,V> void assertListMultimapsEqual(String multimapName, ListMultimap<K, V> expectedListMultimap, ListMultimap<K, V> actualListMultimap) -
assertSetMultimapsEqual
public static <K,V> void assertSetMultimapsEqual(SetMultimap<K, V> expectedSetMultimap, SetMultimap<K, V> actualSetMultimap) -
assertSetMultimapsEqual
public static <K,V> void assertSetMultimapsEqual(String multimapName, SetMultimap<K, V> expectedSetMultimap, SetMultimap<K, V> actualSetMultimap) -
assertBagMultimapsEqual
public static <K,V> void assertBagMultimapsEqual(BagMultimap<K, V> expectedBagMultimap, BagMultimap<K, V> actualBagMultimap) -
assertBagMultimapsEqual
public static <K,V> void assertBagMultimapsEqual(String multimapName, BagMultimap<K, V> expectedBagMultimap, BagMultimap<K, V> actualBagMultimap) -
assertSortedSetMultimapsEqual
public static <K,V> void assertSortedSetMultimapsEqual(SortedSetMultimap<K, V> expectedSortedSetMultimap, SortedSetMultimap<K, V> actualSortedSetMultimap) -
assertSortedSetMultimapsEqual
public static <K,V> void assertSortedSetMultimapsEqual(String multimapName, SortedSetMultimap<K, V> expectedSortedSetMultimap, SortedSetMultimap<K, V> actualSortedSetMultimap) -
assertSortedBagMultimapsEqual
public static <K,V> void assertSortedBagMultimapsEqual(SortedBagMultimap<K, V> expectedSortedBagMultimap, SortedBagMultimap<K, V> actualSortedBagMultimap) -
assertSortedBagMultimapsEqual
public static <K,V> void assertSortedBagMultimapsEqual(String multimapName, SortedBagMultimap<K, V> expectedSortedBagMultimap, SortedBagMultimap<K, V> actualSortedBagMultimap) -
assertMapContainsKeys
-
assertMapContainsValues
-
assertMapContainsKeys
private static void assertMapContainsKeys(String mapIterableName, MapIterable<?, ?> mapIterable, Object... expectedKeyValues) -
assertMapContainsValues
private static void assertMapContainsValues(String mapIterableName, MapIterable<?, ?> mapIterable, Object... expectedKeyValues) -
assertMapContainsKeys
private static void assertMapContainsKeys(String mutableMapIterableName, MutableMapIterable<?, ?> mutableMapIterable, Object... expectedKeyValues) -
assertMapContainsValues
private static void assertMapContainsValues(String mutableMapIterableName, MutableMapIterable<?, ?> mutableMapIterable, Object... expectedKeyValues) -
assertMapContainsKeys
private static void assertMapContainsKeys(String immutableMapIterableName, ImmutableMapIterable<?, ?> immutableMapIterable, Object... expectedKeyValues) -
assertMapContainsValues
private static void assertMapContainsValues(String immutableMapIterableName, ImmutableMapIterable<?, ?> immutableMapIterable, Object... expectedKeyValues) -
assertContainsEntry
-
assertContainsEntry
-
assertContainsAllEntries
-
assertContainsAllEntries
-
denyContainsAny
public static void denyContainsAny(String collectionName, Collection<?> actualCollection, Object... items) -
assertContainsKey
-
assertContainsKey
-
assertContainsKey
Assert that the givenMapIterablecontains an entry with the given key. -
assertContainsKey
public static void assertContainsKey(String mapIterableName, Object expectedKey, MapIterable<?, ?> mapIterable) Assert that the givenMapIterablecontains an entry with the given key. -
assertContainsKey
public static void assertContainsKey(Object expectedKey, MutableMapIterable<?, ?> mutableMapIterable) Assert that the givenMutableMapIterablecontains an entry with the given key. -
assertContainsKey
public static void assertContainsKey(String mutableMapIterableName, Object expectedKey, MutableMapIterable<?, ?> mutableMapIterable) Assert that the givenMutableMapIterablecontains an entry with the given key. -
assertContainsKey
public static void assertContainsKey(Object expectedKey, ImmutableMapIterable<?, ?> immutableMapIterable) Assert that the givenImmutableMapIterablecontains an entry with the given key. -
assertContainsKey
public static void assertContainsKey(String immutableMapIterableName, Object expectedKey, ImmutableMapIterable<?, ?> immutableMapIterable) Assert that the givenImmutableMapIterablecontains an entry with the given key. -
denyContainsKey
-
denyContainsKey
-
assertContainsKeyValue
-
assertContainsKeyValue
-
assertContainsKeyValue
public static void assertContainsKeyValue(Object expectedKey, Object expectedValue, MapIterable<?, ?> mapIterable) Assert that the givenMapIterablecontains an entry with the given key and value. -
assertContainsKeyValue
public static void assertContainsKeyValue(String mapIterableName, Object expectedKey, Object expectedValue, MapIterable<?, ?> mapIterable) Assert that the givenMapIterablecontains an entry with the given key and value. -
assertContainsKeyValue
public static void assertContainsKeyValue(Object expectedKey, Object expectedValue, MutableMapIterable<?, ?> mapIterable) Assert that the givenMutableMapIterablecontains an entry with the given key and value. -
assertContainsKeyValue
public static void assertContainsKeyValue(String mapIterableName, Object expectedKey, Object expectedValue, MutableMapIterable<?, ?> mutableMapIterable) Assert that the givenMutableMapIterablecontains an entry with the given key and value. -
assertContainsKeyValue
public static void assertContainsKeyValue(Object expectedKey, Object expectedValue, ImmutableMapIterable<?, ?> mapIterable) Assert that the givenImmutableMapIterablecontains an entry with the given key and value. -
assertContainsKeyValue
public static void assertContainsKeyValue(String mapIterableName, Object expectedKey, Object expectedValue, ImmutableMapIterable<?, ?> immutableMapIterable) Assert that the givenImmutableMapIterablecontains an entry with the given key and value. -
assertNotContains
Assert that the givenCollectiondoes not contain the given item. -
assertNotContains
public static void assertNotContains(String collectionName, Object unexpectedItem, Collection<?> actualCollection) Assert that the givenCollectiondoes not contain the given item. -
assertNotContains
-
assertNotContains
-
assertNotContainsKey
Assert that the givenCollectiondoes not contain the given item. -
assertNotContainsKey
Assert that the givenCollectiondoes not contain the given item. -
assertBefore
Assert that the formerItem appears before the latterItem in the givenCollection. Both the formerItem and the latterItem must appear in the collection, or this assert will fail. -
assertBefore
public static void assertBefore(String listName, Object formerItem, Object latterItem, List<?> actualList) Assert that the formerItem appears before the latterItem in the givenCollection.assertContains(String, Object, Collection)will be called for both the formerItem and the latterItem, prior to the "before" assertion. -
assertObjectNotNull
-
assertItemAtIndex
-
assertItemAtIndex
-
assertStartsWith
public static <T> void assertStartsWith(T[] array, T... items) -
assertStartsWith
-
assertStartsWith
-
assertEndsWith
-
assertEndsWith
public static <T> void assertEndsWith(T[] array, T... items) -
assertItemAtIndex
-
assertItemAtIndex
-
assertPostSerializedEqualsAndHashCode
-
assertPostSerializedEqualsHashCodeAndToString
-
assertPostSerializedIdentity
-
assertSerializedForm
-
assertSerializedForm
-
assertDeserializedForm
-
decodeObject
-
encodeObject
-
addFinalNewline
-
assertNotSerializable
-
assertEqualsAndHashCode
Assert thatobjectAandobjectBare equal via theObject.equals(Object)method, and that they both return the sameObject.hashCode(). -
assertNegative
public static void assertNegative(int value) Asserts that a value is negative. -
assertPositive
public static void assertPositive(int value) Asserts that a value is positive. -
assertZero
public static void assertZero(int value) Asserts that a value is positive. -
assertEqualsAndHashCode
Assert thatobjectAandobjectBare equal (via theObject.equals(Object)method, and that they both return the sameObject.hashCode(). -
assertShallowClone
Deprecated.since 8.2.0 as will not work with Java 9 -
assertShallowClone
Deprecated.since 8.2.0 as will not work with Java 9 -
assertClassNonInstantiable
-
canInstantiateThroughReflection
-
assertError
-
assertThrows
public static void assertThrows(Class<? extends Exception> expectedExceptionClass, Callable<?> code) Runs theCallablecodeand asserts that it throws anExceptionof the typeexpectedExceptionClass.Callableis most appropriate when a checked exception will be thrown. If a subclass ofRuntimeExceptionwill be thrown, the formAssert.assertThrows(Class, org.junit.function.ThrowingRunnable)may be more convenient.e.g.
Verify.assertThrows(StringIndexOutOfBoundsException.class, new Callable<String>() { public String call() throws Exception { return "Craig".substring(42, 3); } });- See Also:
-
assertThrowsWithCause
public static void assertThrowsWithCause(Class<? extends Exception> expectedExceptionClass, Class<? extends Throwable> expectedCauseClass, Callable<?> code) Runs theCallablecodeand asserts that it throws anExceptionof the typeexpectedExceptionClass, which contains a cause of type expectedCauseClass.Callableis most appropriate when a checked exception will be thrown. If a subclass ofRuntimeExceptionwill be thrown, the formassertThrowsWithCause(Class, Class, Runnable)may be more convenient.e.g.
Verify.assertThrowsWithCause(RuntimeException.class, IOException.class, new Callable<Void>() { public Void call() throws Exception { try { new File("").createNewFile(); } catch (final IOException e) { throw new RuntimeException("Uh oh!", e); } return null; } });- See Also:
-
assertThrowsWithCause
public static void assertThrowsWithCause(Class<? extends Exception> expectedExceptionClass, Class<? extends Throwable> expectedCauseClass, Runnable code) Runs theRunnablecodeand asserts that it throws anExceptionof the typeexpectedExceptionClass, which contains a cause of type expectedCauseClass.Runnableis most appropriate when a subclass ofRuntimeExceptionwill be thrown. If a checked exception will be thrown, the formassertThrowsWithCause(Class, Class, Callable)may be more convenient.e.g.
Verify.assertThrowsWithCause(RuntimeException.class, StringIndexOutOfBoundsException.class, new Runnable() { public void run() { try { LOGGER.info("Craig".substring(42, 3)); } catch (final StringIndexOutOfBoundsException e) { throw new RuntimeException("Uh oh!", e); } } });- See Also:
-