public final class MultimapSubject.UsingCorrespondence<A,E> extends Object
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)
).
Modifier and Type | Method and Description |
---|---|
void |
containsEntry(Object expectedKey,
E expectedValue)
Fails if the multimap does not contain an entry with the given key and a value that
corresponds to the given value.
|
<K,V extends E> |
containsExactly()
Fails if the multimap is not empty.
|
<K,V extends E> |
containsExactly(Object k0,
Object v0,
Object... rest)
Fails if the multimap does not contain exactly the given set of key/value pairs.
|
<K,V extends E> |
containsExactlyEntriesIn(Multimap<K,V> expectedMultimap)
Fails if the map does not contain exactly the keys in the given multimap, mapping to values
that correspond to the values of the given multimap.
|
void |
doesNotContainEntry(Object excludedKey,
E excludedValue)
Fails if the multimap contains an entry with the given key and a value that corresponds to
the given value.
|
public void containsEntry(@NullableDecl Object expectedKey, @NullableDecl E expectedValue)
public void doesNotContainEntry(@NullableDecl Object excludedKey, @NullableDecl E excludedValue)
@CanIgnoreReturnValue public <K,V extends E> Ordered containsExactlyEntriesIn(Multimap<K,V> expectedMultimap)
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.
@CanIgnoreReturnValue public <K,V extends E> Ordered containsExactly(@NullableDecl Object k0, @NullableDecl Object v0, Object... rest)
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!
Copyright © 2018. All rights reserved.