Package org.assertj.guava.api
Class Assertions
java.lang.Object
org.assertj.guava.api.Assertions
- All Implemented Interfaces:
InstanceOfAssertFactories
The entry point for all Guava assertions.
-
Field Summary
Fields inherited from interface org.assertj.guava.api.InstanceOfAssertFactories
BYTE_SOURCE, MULTIMAP, MULTISET, OPTIONAL, TABLE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotected to avoid direct instantiation but allowing subclassing. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> OptionalAssert<T> assertThat(com.google.common.base.Optional<T> actual) static <K,V> MultimapAssert <K, V> assertThat(com.google.common.collect.Multimap<K, V> actual) static <T> MultisetAssert<T> assertThat(com.google.common.collect.Multiset<T> actual) static <T extends Comparable<T>>
RangeAssert<T> assertThat(com.google.common.collect.Range<T> actual) static <K extends Comparable<K>,V>
RangeMapAssert<K, V> assertThat(com.google.common.collect.RangeMap<K, V> actual) static <T extends Comparable<T>>
RangeSetAssert<T> assertThat(com.google.common.collect.RangeSet<T> actual) static <R,C, V> TableAssert <R, C, V> assertThat(com.google.common.collect.Table<R, C, V> actual) static ByteSourceAssertassertThat(com.google.common.io.ByteSource actual) static <K,V> MapEntry <K, V> entry(K key, V value) Only delegate toMapEntry.entry(Object, Object)so that Assertions offers a fully featured entry point to all AssertJ Guava features (but you can useMapEntryif you prefer).
-
Constructor Details
-
Assertions
protected Assertions()protected to avoid direct instantiation but allowing subclassing.
-
-
Method Details
-
assertThat
-
assertThat
-
assertThat
-
assertThat
public static <T extends Comparable<T>> RangeAssert<T> assertThat(com.google.common.collect.Range<T> actual) -
assertThat
public static <K extends Comparable<K>,V> RangeMapAssert<K,V> assertThat(com.google.common.collect.RangeMap<K, V> actual) -
assertThat
public static <T extends Comparable<T>> RangeSetAssert<T> assertThat(com.google.common.collect.RangeSet<T> actual) -
assertThat
public static <R,C, TableAssert<R,V> C, assertThatV> (com.google.common.collect.Table<R, C, V> actual) -
assertThat
-
entry
Only delegate toMapEntry.entry(Object, Object)so that Assertions offers a fully featured entry point to all AssertJ Guava features (but you can useMapEntryif you prefer).Typical usage is to call
entryin MultimapAssertcontainsassertion as shown below :Multimap<String, String> actual = ArrayListMultimap.create(); actual.putAll("Lakers", newArrayList("Kobe Bryant", "Magic Johnson", "Kareem Abdul Jabbar")); actual.putAll("Spurs", newArrayList("Tony Parker", "Tim Duncan", "Manu Ginobili")); assertThat(actual).contains(entry("Lakers", "Kobe Bryant"), entry("Spurs", "Tim Duncan"));- Type Parameters:
K- the type of the key of this entry.V- the type of the value of this entry.- Parameters:
key- the key of the entry to create.value- the value of the entry to create.- Returns:
- the built entry
-