- Enclosing class:
MultimapSubject
Multimap
under test) are compared to expected values using a Correspondence
. The expected values
are of type E
. Call methods on this object to actually execute the check.
Note that keys will always be compared with regular object equality (Object.equals(java.lang.Object)
).
- Author:
- Daniel Ploch, Kurt Alfred Kluever
-
Method Summary
Modifier and TypeMethodDescriptionChecks that the actual multimap contains at least the given key/value pairs.containsAtLeastEntriesIn
(@Nullable Multimap<?, ? extends E> expected) Checks that the actual multimap contains at least the keys in the given multimap, mapping to values that correspond to the values of the given multimap.void
containsEntry
(@Nullable Object key, E value) Checks that the actual multimap contains an entry with the given key and a value that corresponds to the given value.Checks that the actual multimap is empty.Checks that the actual multimap contains exactly the given set of key/value pairs.containsExactlyEntriesIn
(@Nullable Multimap<?, ? extends E> expected) Checks that the actual multimap contains exactly the keys in the given multimap, mapping to values that correspond to the values of the given multimap.void
doesNotContainEntry
(@Nullable Object key, E value) Checks that the actual multimap does not contain an entry with the given key and a value that corresponds to the given value.
-
Method Details
-
containsEntry
-
doesNotContainEntry
-
containsExactlyEntriesIn
@CanIgnoreReturnValue public Ordered containsExactlyEntriesIn(@Nullable Multimap<?, ? extends E> expected) Checks that the actual multimap contains exactly the keys in the given multimap, mapping to values that correspond to the values of the given multimap.A subsequent call to
Ordered.inOrder()
may be made if the caller wishes to verify that the two Multimaps iterate fully in the same order. That is, their key sets iterate in the same order, and the corresponding value collections for each key iterate in the same order. -
containsAtLeastEntriesIn
@CanIgnoreReturnValue public Ordered containsAtLeastEntriesIn(@Nullable Multimap<?, ? extends E> expected) Checks that the actual multimap contains at least the keys in the given multimap, mapping to values that correspond to the values of the given multimap.A subsequent call to
Ordered.inOrder()
may be made if the caller wishes to verify that the two Multimaps iterate fully in the same order. That is, their key sets iterate in the same order, and the corresponding value collections for each key iterate in the same order. -
containsExactly
@CanIgnoreReturnValue public Ordered containsExactly(@Nullable Object k0, @Nullable E v0, @Nullable Object... rest) Checks that the actual multimap contains exactly the given set of key/value pairs.Warning: the use of varargs means that we cannot guarantee an equal number of key/value pairs at compile time. Please make sure you provide varargs in key/value pairs!
-
containsExactly
Checks that the actual multimap is empty. -
containsAtLeast
@CanIgnoreReturnValue public Ordered containsAtLeast(@Nullable Object k0, @Nullable E v0, @Nullable Object... rest) Checks that the actual multimap contains at least the given key/value pairs.Warning: the use of varargs means that we cannot guarantee an equal number of key/value pairs at compile time. Please make sure you provide varargs in key/value pairs!
-