Package org.assertj.vavr.api
Class MultimapAssert<KEY,VALUE>
- java.lang.Object
-
- org.assertj.core.api.AbstractAssert<SELF,ACTUAL>
-
- org.assertj.core.api.AbstractObjectAssert<SELF,ACTUAL>
-
- org.assertj.vavr.api.MultimapAssert<KEY,VALUE>
-
- Type Parameters:
KEY- key type of theMultimap.VALUE- value type of theMultimap.
- All Implemented Interfaces:
org.assertj.core.api.Assert<MultimapAssert<KEY,VALUE>,io.vavr.collection.Multimap<KEY,VALUE>>,org.assertj.core.api.Descriptable<MultimapAssert<KEY,VALUE>>,org.assertj.core.api.EnumerableAssert<MultimapAssert<KEY,VALUE>,io.vavr.Tuple2<? extends KEY,? extends VALUE>>,org.assertj.core.api.ExtensionPoints<MultimapAssert<KEY,VALUE>,io.vavr.collection.Multimap<KEY,VALUE>>
public class MultimapAssert<KEY,VALUE> extends org.assertj.core.api.AbstractObjectAssert<SELF,ACTUAL>Assertions forMultimap.- Author:
- MichaĆ Chmielarz
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ACTUALactual()SELFallSatisfy(BiConsumer<? super KEY,? super VALUE> entryRequirements)Verifies that all the actual multimap entries satisfy the givenentryRequirements.SELFcontains(io.vavr.Tuple2<KEY,VALUE>... entries)Verifies that the actual multimap contains the given entries, in any order.SELFcontainsAllEntriesOf(Iterable<io.vavr.Tuple2<KEY,VALUE>> other)Verifies that the actual multimap contains all entries of the given iterable, in any order.SELFcontainsAnyOf(io.vavr.Tuple2<KEY,VALUE>... entries)Verifies that the actual multimap contains at least one of the given entries.SELFcontainsEntry(KEY key, VALUE value)Verifies that the actual multimap contains the given entry.SELFcontainsExactly(io.vavr.Tuple2<? extends KEY,? extends VALUE>... entries)Verifies that the actual multimap contains only the given entries and nothing else, in order.
This assertion should only be used with maps that have a consistent iteration order (i.e.SELFcontainsKey(KEY key)Verifies that the actual multimap contains the given key.SELFcontainsKeys(KEY... keys)Verifies that the actual multimap contains the given keys.SELFcontainsOnly(Iterable<io.vavr.Tuple2<KEY,VALUE>> entries)SELFcontainsOnlyKeys(KEY... keys)Verifies that the actual multimap contains only the given keys and nothing else, in any order.SELFcontainsValue(VALUE value)Verifies that the actual multimap contains the given value.SELFcontainsValues(VALUE... values)Verifies that the actual multimap contains the given values.SELFdoesNotContain(io.vavr.Tuple2<KEY,VALUE>... entries)Verifies that the actual multimap does not contain the given entries.SELFdoesNotContainEntry(KEY key, VALUE value)Verifies that the actual multimap does not contain the given entry.SELFdoesNotContainKey(KEY key)Verifies that the actual multimap does not contain the given key.SELFdoesNotContainKeys(KEY... keys)Verifies that the actual multimap does not contain the given keys.SELFdoesNotContainValue(VALUE value)Verifies that the actual multimap does not contain the given value.SELFdoesNotContainValues(VALUE... values)Verifies that the actual multimap does not contain the given values.SELFhasEntrySatisfying(KEY key, org.assertj.core.api.Condition<? super VALUE> valueCondition)Verifies that the actual multimap contains a value for the givenkeythat satisfies the givenvalueCondition.SELFhasSameSizeAs(Iterable<?> other)SELFhasSameSizeAs(Object array)SELFhasSize(int expectedSize)SELFhasSizeBetween(int lowerBoundary, int higherBoundary)SELFhasSizeGreaterThan(int boundary)SELFhasSizeGreaterThanOrEqualTo(int boundary)SELFhasSizeLessThan(int boundary)SELFhasSizeLessThanOrEqualTo(int boundary)org.assertj.core.api.WritableAssertionInfoinfo()voidisEmpty()SELFisNotEmpty()voidisNullOrEmpty()org.assertj.core.internal.Objectsobjects()SELFusingDefaultElementComparator()SELFusingElementComparator(Comparator<? super io.vavr.Tuple2<? extends KEY,? extends VALUE>> customComparator)SELFwithAssertionState(org.assertj.vavr.api.AbstractVavrAssert assertInstance)-
Methods inherited from class org.assertj.core.api.AbstractObjectAssert
as, as, extracting, extracting, extracting, extracting, extracting, extracting, getComparatorsByType, hasAllNullFieldsOrProperties, hasAllNullFieldsOrPropertiesExcept, hasFieldOrProperty, hasFieldOrPropertyWithValue, hasNoNullFieldsOrProperties, hasNoNullFieldsOrPropertiesExcept, hasOnlyFields, isEqualToComparingFieldByField, isEqualToComparingFieldByFieldRecursively, isEqualToComparingOnlyGivenFields, isEqualToIgnoringGivenFields, isEqualToIgnoringNullFields, newObjectAssert, returns, usingComparatorForFields, usingComparatorForType, usingRecursiveComparison, usingRecursiveComparison
-
Methods inherited from class org.assertj.core.api.AbstractAssert
asInstanceOf, asList, assertionError, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, hasToString, inBinary, inHexadecimal, is, isElementOfCustomAssert, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isInstanceOfSatisfying, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, matches, matches, newListAssertInstance, overridingErrorMessage, overridingErrorMessage, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOf, satisfiesAnyOf, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, withFailMessage, withFailMessage, withRepresentation, withThreadDumpOnError
-
-
-
-
Method Detail
-
contains
public SELF contains(io.vavr.Tuple2<KEY,VALUE>... entries)
Verifies that the actual multimap contains the given entries, in any order.This assertion succeeds if both actual multimap and given entries are empty.
- Parameters:
entries- the given entries.- Returns:
thisassertion object.- Throws:
NullPointerException- if the given argument isnull.NullPointerException- if any of the entries in the given array isnull.AssertionError- if the actual multimap is not empty and the given argument is an empty array.AssertionError- if the actual multimap isnull.AssertionError- if the actual multimap does not contain the given entries.
-
containsAnyOf
public SELF containsAnyOf(io.vavr.Tuple2<KEY,VALUE>... entries)
Verifies that the actual multimap contains at least one of the given entries.- Parameters:
entries- the given entries.- Returns:
thisassertion object.- Throws:
NullPointerException- if the given argument isnull.NullPointerException- if any of the entries in the given array isnull.AssertionError- if the actual multimap is not empty and the given argument is an empty array.AssertionError- if the actual multimap isnull.AssertionError- if the actual multimap does not contain any of the given entries.
-
containsAllEntriesOf
public SELF containsAllEntriesOf(Iterable<io.vavr.Tuple2<KEY,VALUE>> other)
Verifies that the actual multimap contains all entries of the given iterable, in any order.- Parameters:
other- the iterable with the given entries.- Returns:
thisassertion object.- Throws:
NullPointerException- if the given argument isnull.NullPointerException- if any of the entries in the given iterable isnull.AssertionError- if the actual multimap is not empty and the given argument is an empty iterable.AssertionError- if the actual multimap isnull.AssertionError- if the actual multimap does not contain the given entries.
-
containsOnly
public SELF containsOnly(Iterable<io.vavr.Tuple2<KEY,VALUE>> entries)
-
containsExactly
public SELF containsExactly(io.vavr.Tuple2<? extends KEY,? extends VALUE>... entries)
Verifies that the actual multimap contains only the given entries and nothing else, in order.
This assertion should only be used with maps that have a consistent iteration order (i.e. don't use it withHashMultimap, prefercontainsOnly(java.lang.Iterable<io.vavr.Tuple2<KEY, VALUE>>)methods in that case).- Parameters:
entries- the given entries.- Returns:
thisassertions object.- Throws:
NullPointerException- if the given entries array isnull.AssertionError- if the actual multimap isnull.IllegalArgumentException- if the given entries array is empty.AssertionError- if the actual multimap does not contain the given entries with same order, i.e. the actual multimap contains some or none of the given entries, or the actual multimap contains more entries than the given ones or entries are the same but the order is not.
-
allSatisfy
public SELF allSatisfy(BiConsumer<? super KEY,? super VALUE> entryRequirements)
Verifies that all the actual multimap entries satisfy the givenentryRequirements. If the actual multimap is empty, this assertion succeeds as there is nothing to check.- Parameters:
entryRequirements- the given requirements that each entry must satisfy.- Returns:
thisassertion object.- Throws:
NullPointerException- if the given entryRequirementsBiConsumerisnull.AssertionError- if the actual multimap isnull.AssertionError- if one or more entries don't satisfy the given requirements.
-
hasEntrySatisfying
public SELF hasEntrySatisfying(KEY key, org.assertj.core.api.Condition<? super VALUE> valueCondition)Verifies that the actual multimap contains a value for the givenkeythat satisfies the givenvalueCondition.- Parameters:
key- the given key to check.valueCondition- the given condition for check value.- Returns:
thisassertion object.- Throws:
NullPointerException- if the given values isnull.AssertionError- if the actual multimap isnull.AssertionError- if the actual multimap does not contain the givenkey.AssertionError- if the actual multimap contains the given key, but value does not match the givenvalueCondition.
-
containsEntry
public SELF containsEntry(KEY key, VALUE value)Verifies that the actual multimap contains the given entry.- Parameters:
key- the given key to check.value- the given value to check.- Returns:
thisassertion object.- Throws:
AssertionError- if the actual multimap isnull.AssertionError- if the actual multimap does not contain the given entries.
-
doesNotContain
public SELF doesNotContain(io.vavr.Tuple2<KEY,VALUE>... entries)
Verifies that the actual multimap does not contain the given entries.- Parameters:
entries- the given entries.- Returns:
thisassertion object.- Throws:
NullPointerException- if the given argument isnull.IllegalArgumentException- if the given argument is an empty array.AssertionError- if the actual multimap isnull.AssertionError- if the actual multimap contains any of the given entries.
-
doesNotContainEntry
public SELF doesNotContainEntry(KEY key, VALUE value)Verifies that the actual multimap does not contain the given entry.- Parameters:
key- key of the entry.value- value of the entry.- Returns:
thisassertion object.- Throws:
NullPointerException- if the given argument isnull.IllegalArgumentException- if the given argument is an empty array.AssertionError- if the actual multimap isnull.AssertionError- if the actual multimap contains any of the given entries.
-
containsKey
public SELF containsKey(KEY key)
Verifies that the actual multimap contains the given key.- Parameters:
key- the given key.- Returns:
thisassertions object.- Throws:
AssertionError- if the actual multimap isnull.AssertionError- if the actual multimap does not contain the given key.
-
containsKeys
public SELF containsKeys(KEY... keys)
Verifies that the actual multimap contains the given keys.- Parameters:
keys- the given keys.- Returns:
thisassertions object.- Throws:
AssertionError- if the actual multimap isnull.AssertionError- if the actual multimap does not contain the given key.IllegalArgumentException- if the given argument is an empty array.NullPointerException- if the array of keys isnull.
-
containsOnlyKeys
public SELF containsOnlyKeys(KEY... keys)
Verifies that the actual multimap contains only the given keys and nothing else, in any order.- Parameters:
keys- the given keys that should be in the actual multimap.- Returns:
thisassertions object.- Throws:
AssertionError- if the actual multimap isnull.AssertionError- if the actual multimap does not contain the given keys, i.e. the actual multimap contains some or none of the given keys, or the actual multimap contains more entries than the given ones.NullPointerException- if the array of keys isnull.IllegalArgumentException- if the given argument is an empty array.
-
doesNotContainKey
public SELF doesNotContainKey(KEY key)
Verifies that the actual multimap does not contain the given key.- Parameters:
key- the given key.- Returns:
thisassertions object.- Throws:
AssertionError- if the actual multimap isnull.AssertionError- if the actual multimap contains the given key.
-
doesNotContainKeys
public SELF doesNotContainKeys(KEY... keys)
Verifies that the actual multimap does not contain the given keys.- Parameters:
keys- the given keys.- Returns:
thisassertions object.- Throws:
AssertionError- if the actual multimap isnull.AssertionError- if the actual multimap contains the given key.IllegalArgumentException- if the given argument is an empty array.NullPointerException- if the array of keys isnull.
-
containsValue
public SELF containsValue(VALUE value)
Verifies that the actual multimap contains the given value.- Parameters:
value- the value to look for.- Returns:
thisassertions object.- Throws:
AssertionError- if the actual multimap isnull.AssertionError- if the actual multimap does not contain the given value.
-
containsValues
public SELF containsValues(VALUE... values)
Verifies that the actual multimap contains the given values.- Parameters:
values- the values to look for in the actual map.- Returns:
thisassertions object.- Throws:
AssertionError- if the actual multimap isnull.AssertionError- if the actual multimap does not contain the given values.
-
doesNotContainValue
public SELF doesNotContainValue(VALUE value)
Verifies that the actual multimap does not contain the given value.- Parameters:
value- the value to look for.- Returns:
thisassertions object.- Throws:
AssertionError- if the actual multimap isnull.AssertionError- if the actual multimap contains the given value.
-
doesNotContainValues
public SELF doesNotContainValues(VALUE... values)
Verifies that the actual multimap does not contain the given values.- Parameters:
values- the values to look for in the actual map.- Returns:
thisassertions object.- Throws:
AssertionError- if the actual multimap isnull.AssertionError- if the actual multimap contains the given values.
-
isNullOrEmpty
public void isNullOrEmpty()
- Specified by:
isNullOrEmptyin interfaceorg.assertj.core.api.EnumerableAssert<SELF extends org.assertj.vavr.api.AbstractMultimapAssert<SELF,ACTUAL,KEY,VALUE>,ACTUAL extends io.vavr.collection.Multimap<KEY,VALUE>>
-
isEmpty
public void isEmpty()
- Specified by:
isEmptyin interfaceorg.assertj.core.api.EnumerableAssert<SELF extends org.assertj.vavr.api.AbstractMultimapAssert<SELF,ACTUAL,KEY,VALUE>,ACTUAL extends io.vavr.collection.Multimap<KEY,VALUE>>
-
isNotEmpty
public SELF isNotEmpty()
- Specified by:
isNotEmptyin interfaceorg.assertj.core.api.EnumerableAssert<SELF extends org.assertj.vavr.api.AbstractMultimapAssert<SELF,ACTUAL,KEY,VALUE>,ACTUAL extends io.vavr.collection.Multimap<KEY,VALUE>>
-
hasSize
public SELF hasSize(int expectedSize)
- Specified by:
hasSizein interfaceorg.assertj.core.api.EnumerableAssert<SELF extends org.assertj.vavr.api.AbstractMultimapAssert<SELF,ACTUAL,KEY,VALUE>,ACTUAL extends io.vavr.collection.Multimap<KEY,VALUE>>
-
hasSizeGreaterThan
public SELF hasSizeGreaterThan(int boundary)
- Specified by:
hasSizeGreaterThanin interfaceorg.assertj.core.api.EnumerableAssert<SELF extends org.assertj.vavr.api.AbstractMultimapAssert<SELF,ACTUAL,KEY,VALUE>,ACTUAL extends io.vavr.collection.Multimap<KEY,VALUE>>
-
hasSizeGreaterThanOrEqualTo
public SELF hasSizeGreaterThanOrEqualTo(int boundary)
- Specified by:
hasSizeGreaterThanOrEqualToin interfaceorg.assertj.core.api.EnumerableAssert<SELF extends org.assertj.vavr.api.AbstractMultimapAssert<SELF,ACTUAL,KEY,VALUE>,ACTUAL extends io.vavr.collection.Multimap<KEY,VALUE>>
-
hasSizeLessThan
public SELF hasSizeLessThan(int boundary)
- Specified by:
hasSizeLessThanin interfaceorg.assertj.core.api.EnumerableAssert<SELF extends org.assertj.vavr.api.AbstractMultimapAssert<SELF,ACTUAL,KEY,VALUE>,ACTUAL extends io.vavr.collection.Multimap<KEY,VALUE>>
-
hasSizeLessThanOrEqualTo
public SELF hasSizeLessThanOrEqualTo(int boundary)
- Specified by:
hasSizeLessThanOrEqualToin interfaceorg.assertj.core.api.EnumerableAssert<SELF extends org.assertj.vavr.api.AbstractMultimapAssert<SELF,ACTUAL,KEY,VALUE>,ACTUAL extends io.vavr.collection.Multimap<KEY,VALUE>>
-
hasSizeBetween
public SELF hasSizeBetween(int lowerBoundary, int higherBoundary)- Specified by:
hasSizeBetweenin interfaceorg.assertj.core.api.EnumerableAssert<SELF extends org.assertj.vavr.api.AbstractMultimapAssert<SELF,ACTUAL,KEY,VALUE>,ACTUAL extends io.vavr.collection.Multimap<KEY,VALUE>>
-
hasSameSizeAs
public SELF hasSameSizeAs(Iterable<?> other)
- Specified by:
hasSameSizeAsin interfaceorg.assertj.core.api.EnumerableAssert<SELF extends org.assertj.vavr.api.AbstractMultimapAssert<SELF,ACTUAL,KEY,VALUE>,ACTUAL extends io.vavr.collection.Multimap<KEY,VALUE>>
-
hasSameSizeAs
public SELF hasSameSizeAs(Object array)
- Specified by:
hasSameSizeAsin interfaceorg.assertj.core.api.EnumerableAssert<SELF extends org.assertj.vavr.api.AbstractMultimapAssert<SELF,ACTUAL,KEY,VALUE>,ACTUAL extends io.vavr.collection.Multimap<KEY,VALUE>>
-
usingElementComparator
public SELF usingElementComparator(Comparator<? super io.vavr.Tuple2<? extends KEY,? extends VALUE>> customComparator)
- Specified by:
usingElementComparatorin interfaceorg.assertj.core.api.EnumerableAssert<SELF extends org.assertj.vavr.api.AbstractMultimapAssert<SELF,ACTUAL,KEY,VALUE>,ACTUAL extends io.vavr.collection.Multimap<KEY,VALUE>>
-
usingDefaultElementComparator
public SELF usingDefaultElementComparator()
- Specified by:
usingDefaultElementComparatorin interfaceorg.assertj.core.api.EnumerableAssert<SELF extends org.assertj.vavr.api.AbstractMultimapAssert<SELF,ACTUAL,KEY,VALUE>,ACTUAL extends io.vavr.collection.Multimap<KEY,VALUE>>
-
actual
public ACTUAL actual()
-
withAssertionState
public SELF withAssertionState(org.assertj.vavr.api.AbstractVavrAssert assertInstance)
-
objects
public org.assertj.core.internal.Objects objects()
-
info
public org.assertj.core.api.WritableAssertionInfo info()
-
-