- check() - Method in class com.google.common.truth.Subject
-
A convenience for implementers of
Subject
subclasses to use other truth
Subject
wrappers within their own propositional logic.
- ClassSubject - Class in com.google.common.truth
-
Propositions for
Class
subjects.
- com.google.common.truth - package com.google.common.truth
-
Truth is an open source, fluent testing framework for Java that is designed to make your test
assertions and failure messages more readable.
- ComparableSubject<S extends ComparableSubject<S,T>,T extends Comparable> - Class in com.google.common.truth
-
- ComparableSubject(FailureStrategy, T) - Constructor for class com.google.common.truth.ComparableSubject
-
- compare(A, E) - Method in class com.google.common.truth.Correspondence
-
Returns whether or not the actual
value is said to correspond to the expected
value for the purposes of this test.
- comparesEqualTo(T) - Method in class com.google.common.truth.ComparableSubject
-
- comparingElementsUsing(Correspondence<A, E>) - Method in class com.google.common.truth.IterableSubject
-
Starts a method chain for a test proposition in which the actual elements (i.e.
- comparingValuesUsing(Correspondence<A, E>) - Method in class com.google.common.truth.MapSubject
-
Starts a method chain for a test proposition in which the actual values (i.e.
- comparingValuesUsing(Correspondence<A, E>) - Method in class com.google.common.truth.MultimapSubject
-
Starts a method chain for a test proposition in which the actual values (i.e.
- comparisonFailure(String, String, String) - Static method in class com.google.common.truth.Platform
-
- compressType(String) - Static method in class com.google.common.truth.Platform
-
Inspired by JavaWriter.
- contains(Object) - Method in class com.google.common.truth.IterableSubject
-
Attests (with a side-effect failure) that the subject contains the supplied item.
- contains(E) - Method in class com.google.common.truth.IterableSubject.UsingCorrespondence
-
Attests that the subject contains at least one element that corresponds to the given expected
element.
- contains(CharSequence) - Method in class com.google.common.truth.StringSubject
-
Fails if the string does not contain the given sequence.
- contains(Object, Object) - Method in class com.google.common.truth.TableSubject
-
Fails if the table does not contain a mapping for the given row key and column key.
- containsAllIn(Iterable<?>) - Method in class com.google.common.truth.IterableSubject
-
Attests that the actual iterable contains at least all of the expected elements or fails.
- containsAllIn(Iterable<? extends E>) - Method in class com.google.common.truth.IterableSubject.UsingCorrespondence
-
Attests that the subject contains elements that corresponds to all of the expected elements,
i.e.
- containsAllOf(Object, Object, Object...) - Method in class com.google.common.truth.IterableSubject
-
Attests that the actual iterable contains at least all of the expected elements or fails.
- containsAllOf(E, E, E...) - Method in class com.google.common.truth.IterableSubject.UsingCorrespondence
-
Attests that the subject contains elements that corresponds to all of the expected elements,
i.e.
- containsAnyIn(Iterable<?>) - Method in class com.google.common.truth.IterableSubject
-
Attests that the subject contains at least one of the objects contained in the provided
collection or fails.
- containsAnyIn(Iterable<? extends E>) - Method in class com.google.common.truth.IterableSubject.UsingCorrespondence
-
Attests that the subject contains at least one element that corresponds to at least one of
the expected elements.
- containsAnyOf(Object, Object, Object...) - Method in class com.google.common.truth.IterableSubject
-
Attests that the subject contains at least one of the provided objects or fails.
- containsAnyOf(E, E, E...) - Method in class com.google.common.truth.IterableSubject.UsingCorrespondence
-
Attests that the subject contains at least one element that corresponds to at least one of
the expected elements.
- containsCell(Object, Object, Object) - Method in class com.google.common.truth.TableSubject
-
Fails if the table does not contain the given cell.
- containsColumn(Object) - Method in class com.google.common.truth.TableSubject
-
Fails if the table does not contain the given column key.
- containsEntry(Object, long) - Method in class com.google.common.truth.AtomicLongMapSubject
-
Fails if the AtomicLongMap
does not contain the given entry.
- containsEntry(Object, Object) - Method in class com.google.common.truth.MapSubject
-
Fails if the map does not contain the given entry.
- containsEntry(Object, E) - Method in class com.google.common.truth.MapSubject.UsingCorrespondence
-
Fails if the map does not contain an entry with the given key and a value that corresponds to
the given value.
- containsEntry(Object, Object) - Method in class com.google.common.truth.MultimapSubject
-
Fails if the multimap does not contain the given entry.
- containsEntry(Object, E) - Method in class com.google.common.truth.MultimapSubject.UsingCorrespondence
-
Fails if the multimap does not contain an entry with the given key and a value that
corresponds to the given value.
- containsExactly(Object...) - Method in class com.google.common.truth.IterableSubject
-
Attests that a subject contains exactly the provided objects or fails.
- containsExactly(E...) - Method in class com.google.common.truth.IterableSubject.UsingCorrespondence
-
Attests that subject contains exactly elements that correspond to the expected elements, i.e.
- containsExactly() - Method in class com.google.common.truth.MapSubject
-
Fails if the map is not empty.
- containsExactly(Object, Object, Object...) - Method in class com.google.common.truth.MapSubject
-
Fails if the map does not contain exactly the given set of key/value pairs.
- containsExactly(Object, E, Object...) - Method in class com.google.common.truth.MapSubject.UsingCorrespondence
-
Fails if the map does not contain exactly the given set of keys mapping to values that
correspond to the given values.
- containsExactly(Multimap<?, ?>) - Method in class com.google.common.truth.MultimapSubject
-
- containsExactlyElementsIn(Iterable<?>) - Method in class com.google.common.truth.IterableSubject
-
Attests that a subject contains exactly the provided objects or fails.
- containsExactlyElementsIn(Iterable<? extends E>) - Method in class com.google.common.truth.IterableSubject.UsingCorrespondence
-
Attests that subject contains exactly elements that correspond to the expected elements, i.e.
- containsExactlyEntriesIn(Map<?, ?>) - Method in class com.google.common.truth.MapSubject
-
Fails if the map does not contain exactly the given set of entries in the given map.
- containsExactlyEntriesIn(Map<K, V>) - Method in class com.google.common.truth.MapSubject.UsingCorrespondence
-
Fails if the map does not contain exactly the keys in the given map, mapping to values that
correspond to the values of the given map.
- containsExactlyEntriesIn(Multimap<?, ?>) - Method in class com.google.common.truth.MultimapSubject
-
Fails if the Multimap does not contain precisely the same entries as the argument Multimap.
- containsKey(Object) - Method in class com.google.common.truth.AtomicLongMapSubject
-
Fails if the AtomicLongMap
does not contain the given key.
- containsKey(Object) - Method in class com.google.common.truth.MapSubject
-
Fails if the map does not contain the given key.
- containsKey(Object) - Method in class com.google.common.truth.MultimapSubject
-
Fails if the multimap does not contain the given key.
- containsMatch(String, String) - Static method in class com.google.common.truth.Platform
-
Determines if the given subject contains a match for the given regex.
- containsMatch(Pattern) - Method in class com.google.common.truth.StringSubject
-
Fails if the string does not contain a match on the given regex.
- containsMatch(String) - Method in class com.google.common.truth.StringSubject
-
Fails if the string does not contain a match on the given regex.
- containsNoDuplicates() - Method in class com.google.common.truth.IterableSubject
-
Attests that the subject does not contain duplicate elements.
- containsNoneIn(Iterable<?>) - Method in class com.google.common.truth.IterableSubject
-
Attests that a actual iterable contains none of the elements contained in the excluded iterable
or fails.
- containsNoneIn(Iterable<? extends E>) - Method in class com.google.common.truth.IterableSubject.UsingCorrespondence
-
Attests that the subject contains no elements that correspond to any of the given elements.
- containsNoneOf(Object, Object, Object...) - Method in class com.google.common.truth.IterableSubject
-
Attests that a actual iterable contains none of the excluded objects or fails.
- containsNoneOf(E, E, E...) - Method in class com.google.common.truth.IterableSubject.UsingCorrespondence
-
Attests that the subject contains no elements that correspond to any of the given elements.
- containsRow(Object) - Method in class com.google.common.truth.TableSubject
-
Fails if the table does not contain the given row key.
- containsValue(Object) - Method in class com.google.common.truth.TableSubject
-
Fails if the table does not contain the given value.
- Correspondence<A,E> - Class in com.google.common.truth
-
Determines whether an instance of type A
corresponds in some way to an instance of type
E
.
- Correspondence() - Constructor for class com.google.common.truth.Correspondence
-
- create() - Static method in class com.google.common.truth.Expect
-
- create(Expect.ExpectationGatherer) - Static method in class com.google.common.truth.Expect
-
- createAndEnableStackTrace() - Static method in class com.google.common.truth.Expect
-
- inOrder() - Method in interface com.google.common.truth.Ordered
-
An additional assertion, implemented by some containment subjects which allows for a further
constraint of orderedness.
- IntegerSubject - Class in com.google.common.truth
-
- IntegerSubject(FailureStrategy, Integer) - Constructor for class com.google.common.truth.IntegerSubject
-
- internalCustomName() - Method in class com.google.common.truth.Subject
-
- isAbsent() - Method in class com.google.common.truth.GuavaOptionalSubject
-
Fails if the Optional
<T>
is present or the subject is null..
- isAnyOf(Object, Object, Object...) - Method in class com.google.common.truth.Subject
-
Fails unless the subject is equal to any of the given elements.
- isAssignableTo(Class<?>) - Method in class com.google.common.truth.ClassSubject
-
Fails if this class or interface is not the same as or a subclass or subinterface of, the given
class or interface.
- isAtLeast(T) - Method in class com.google.common.truth.ComparableSubject
-
Fails if the subject is less than the given value.
- isAtMost(T) - Method in class com.google.common.truth.ComparableSubject
-
Fails if the subject is greater than the given value.
- isEmpty() - Method in class com.google.common.truth.AbstractArraySubject
-
Fails if the array is not empty (i.e.
- isEmpty() - Method in class com.google.common.truth.AtomicLongMapSubject
-
Fails if the AtomicLongMap
is not empty.
- isEmpty() - Method in class com.google.common.truth.IterableSubject
-
Fails if the subject is not empty.
- isEmpty() - Method in class com.google.common.truth.MapSubject
-
Fails if the map is not empty.
- isEmpty() - Method in class com.google.common.truth.MultimapSubject
-
Fails if the multimap is not empty.
- isEmpty() - Method in class com.google.common.truth.StringSubject
-
Fails if the string is not equal to the zero-length "empty string."
- isEmpty() - Method in class com.google.common.truth.TableSubject
-
Fails if the table is not empty.
- isEqualTo(Object) - Method in class com.google.common.truth.AtomicLongMapSubject
-
- isEqualTo(Object) - Method in class com.google.common.truth.BigDecimalSubject
-
Fails if the subject's value and scale is not equal to the given
BigDecimal
.
- isEqualTo(Double) - Method in class com.google.common.truth.DoubleSubject
-
Asserts that the subject is exactly equal to the given value, with equality defined as by
.
- isEqualTo(Float) - Method in class com.google.common.truth.FloatSubject
-
Asserts that the subject is exactly equal to the given value, with equality defined as by
.
- isEqualTo(SetMultimap<?, ?>) - Method in class com.google.common.truth.ListMultimapSubject
-
- isEqualTo(Object) - Method in class com.google.common.truth.MapSubject
-
Fails if the subject is not equal to the given object.
- isEqualTo(Object) - Method in class com.google.common.truth.MultimapSubject
-
- isEqualTo(Object) - Method in class com.google.common.truth.ObjectArraySubject
-
A proposition that the provided Object[] is an array of the same length and type, and contains
elements such that each element in expected
is equal to each element in the subject,
and in the same position.
- isEqualTo(Object) - Method in class com.google.common.truth.PrimitiveBooleanArraySubject
-
A proposition that the provided Object[] is an array of the same length and type, and contains
elements such that each element in expected
is equal to each element in the subject,
and in the same position.
- isEqualTo(Object) - Method in class com.google.common.truth.PrimitiveByteArraySubject
-
A proposition that the provided Object[] is an array of the same length and type, and contains
elements such that each element in expected
is equal to each element in the subject,
and in the same position.
- isEqualTo(Object) - Method in class com.google.common.truth.PrimitiveCharArraySubject
-
A proposition that the provided Object[] is an array of the same length and type, and contains
elements such that each element in expected
is equal to each element in the subject,
and in the same position.
- isEqualTo(Object) - Method in class com.google.common.truth.PrimitiveDoubleArraySubject
-
- isEqualTo(Object, double) - Method in class com.google.common.truth.PrimitiveDoubleArraySubject
-
- isEqualTo(Object) - Method in class com.google.common.truth.PrimitiveFloatArraySubject
-
- isEqualTo(Object, float) - Method in class com.google.common.truth.PrimitiveFloatArraySubject
-
- isEqualTo(Object) - Method in class com.google.common.truth.PrimitiveIntArraySubject
-
A proposition that the provided Object[] is an array of the same length and type, and contains
elements such that each element in expected
is equal to each element in the subject,
and in the same position.
- isEqualTo(Object) - Method in class com.google.common.truth.PrimitiveLongArraySubject
-
A proposition that the provided Object[] is an array of the same length and type, and contains
elements such that each element in expected
is equal to each element in the subject,
and in the same position.
- isEqualTo(Object) - Method in class com.google.common.truth.PrimitiveShortArraySubject
-
A proposition that the provided Object[] is an array of the same length and type, and contains
elements such that each element in expected
is equal to each element in the subject,
and in the same position.
- isEqualTo(ListMultimap<?, ?>) - Method in class com.google.common.truth.SetMultimapSubject
-
- isEqualTo(Object) - Method in class com.google.common.truth.StringSubject
-
- isEqualTo(Object) - Method in class com.google.common.truth.Subject
-
Fails if the subject is not equal to the given object.
- isEqualToIgnoringScale(BigDecimal) - Method in class com.google.common.truth.BigDecimalSubject
-
Fails if the subject's value is not equal to the value of the given
BigDecimal
.
- isEqualToIgnoringScale(String) - Method in class com.google.common.truth.BigDecimalSubject
-
Fails if the subject's value is not equal to the value of the
BigDecimal
created from
the expected string (i.e., fails if
actual.comparesTo(new BigDecimal(expected)) != 0
).
- isEqualToIgnoringScale(long) - Method in class com.google.common.truth.BigDecimalSubject
-
Fails if the subject's value is not equal to the value of the
BigDecimal
created from
the expected
long
(i.e., fails if
actual.comparesTo(new BigDecimal(expected)) !=
0
).
- isEquivalentAccordingToCompareTo(BigDecimal) - Method in class com.google.common.truth.BigDecimalSubject
-
Fails if the subject is not equivalent to the given value according to
Comparable.compareTo(T)
, (i.e., fails if
a.comparesTo(b) != 0
).
- isEquivalentAccordingToCompareTo(T) - Method in class com.google.common.truth.ComparableSubject
-
Fails if the subject is not equivalent to the given value according to
Comparable.compareTo(T)
, (i.e., fails if
a.comparesTo(b) != 0
).
- isEquivalentAccordingToCompareTo(Double) - Method in class com.google.common.truth.DoubleSubject
-
- isEquivalentAccordingToCompareTo(Float) - Method in class com.google.common.truth.FloatSubject
-
- isEquivalentAccordingToCompareTo(Integer) - Method in class com.google.common.truth.IntegerSubject
-
- isEquivalentAccordingToCompareTo(Long) - Method in class com.google.common.truth.LongSubject
-
- isEquivalentAccordingToCompareTo(String) - Method in class com.google.common.truth.StringSubject
-
- isFalse() - Method in class com.google.common.truth.BooleanSubject
-
Fails if the subject is true or null
.
- isFinite() - Method in class com.google.common.truth.DoubleSubject
-
Asserts that the subject is finite, i.e.
- isFinite() - Method in class com.google.common.truth.FloatSubject
-
Asserts that the subject is finite, i.e.
- isGreaterThan(T) - Method in class com.google.common.truth.ComparableSubject
-
Fails if the subject is not greater than the given value.
- isIn(Range<T>) - Method in class com.google.common.truth.ComparableSubject
-
Fails if the subject is not in the given range.
- isIn(Iterable<?>) - Method in class com.google.common.truth.Subject
-
Fails unless the subject is equal to any element in the given iterable.
- isInstanceOf(Class<?>) - Method in class com.google.common.truth.Subject
-
Fails if the subject is not an instance of the given class.
- isInstanceOfType(Object, Class<?>) - Static method in class com.google.common.truth.Platform
-
Returns true if the instance is assignable to the type Clazz.
- isLessThan(T) - Method in class com.google.common.truth.ComparableSubject
-
Fails if the subject is not less than the given value.
- isNaN() - Method in class com.google.common.truth.DoubleSubject
-
- isNaN() - Method in class com.google.common.truth.FloatSubject
-
- isNegativeInfinity() - Method in class com.google.common.truth.DoubleSubject
-
- isNegativeInfinity() - Method in class com.google.common.truth.FloatSubject
-
- isNoneOf(Object, Object, Object...) - Method in class com.google.common.truth.Subject
-
Fails if the subject is equal to any of the given elements.
- isNonZero() - Method in class com.google.common.truth.DoubleSubject
-
Asserts that the subject is a non-null value other than zero (i.e.
- isNonZero() - Method in class com.google.common.truth.FloatSubject
-
Asserts that the subject is a non-null value other than zero (i.e.
- isNotEmpty() - Method in class com.google.common.truth.AbstractArraySubject
-
Fails if the array is empty (i.e.
- isNotEmpty() - Method in class com.google.common.truth.AtomicLongMapSubject
-
Fails if the AtomicLongMap
is empty.
- isNotEmpty() - Method in class com.google.common.truth.IterableSubject
-
Fails if the subject is empty.
- isNotEmpty() - Method in class com.google.common.truth.MapSubject
-
Fails if the map is empty.
- isNotEmpty() - Method in class com.google.common.truth.MultimapSubject
-
Fails if the multimap is empty.
- isNotEmpty() - Method in class com.google.common.truth.StringSubject
-
Fails if the string is equal to the zero-length "empty string."
- isNotEmpty() - Method in class com.google.common.truth.TableSubject
-
Fails if the table is empty.
- isNotEqualTo(Object) - Method in class com.google.common.truth.AtomicLongMapSubject
-
- isNotEqualTo(Double) - Method in class com.google.common.truth.DoubleSubject
-
Asserts that the subject is not exactly equal to the given value, with equality defined as by
.
- isNotEqualTo(Float) - Method in class com.google.common.truth.FloatSubject
-
Asserts that the subject is not exactly equal to the given value, with equality defined as by
.
- isNotEqualTo(Object) - Method in class com.google.common.truth.ObjectArraySubject
-
- isNotEqualTo(Object) - Method in class com.google.common.truth.PrimitiveBooleanArraySubject
-
- isNotEqualTo(Object) - Method in class com.google.common.truth.PrimitiveByteArraySubject
-
- isNotEqualTo(Object) - Method in class com.google.common.truth.PrimitiveCharArraySubject
-
- isNotEqualTo(Object) - Method in class com.google.common.truth.PrimitiveDoubleArraySubject
-
- isNotEqualTo(Object, double) - Method in class com.google.common.truth.PrimitiveDoubleArraySubject
-
- isNotEqualTo(Object) - Method in class com.google.common.truth.PrimitiveFloatArraySubject
-
- isNotEqualTo(Object, float) - Method in class com.google.common.truth.PrimitiveFloatArraySubject
-
- isNotEqualTo(Object) - Method in class com.google.common.truth.PrimitiveIntArraySubject
-
- isNotEqualTo(Object) - Method in class com.google.common.truth.PrimitiveLongArraySubject
-
- isNotEqualTo(Object) - Method in class com.google.common.truth.PrimitiveShortArraySubject
-
- isNotEqualTo(Object) - Method in class com.google.common.truth.Subject
-
Fails if the subject is equal to the given object.
- isNotIn(Range<T>) - Method in class com.google.common.truth.ComparableSubject
-
Fails if the subject is in the given range.
- isNotIn(Iterable<?>) - Method in class com.google.common.truth.Subject
-
Fails if the subject is equal to any element in the given iterable.
- isNotInstanceOf(Class<?>) - Method in class com.google.common.truth.Subject
-
Fails if the subject is an instance of the given class.
- isNotNaN() - Method in class com.google.common.truth.DoubleSubject
-
- isNotNaN() - Method in class com.google.common.truth.FloatSubject
-
- isNotNull() - Method in class com.google.common.truth.Subject
-
Fails if the subject is null.
- isNotSameAs(Object) - Method in class com.google.common.truth.Subject
-
Fails if the subject is the same instance as the given object.
- isNotWithin(double) - Method in class com.google.common.truth.DoubleSubject
-
Prepares for a check that the subject is a finite number not within the given tolerance of an
expected value that will be provided in the next call in the fluent chain.
- isNotWithin(float) - Method in class com.google.common.truth.FloatSubject
-
Prepares for a check that the subject is a finite number not within the given tolerance of an
expected value that will be provided in the next call in the fluent chain.
- isNull() - Method in class com.google.common.truth.StringSubject
-
Fails if the string is not null.
- isNull() - Method in class com.google.common.truth.Subject
-
Fails if the subject is not null.
- isOrdered() - Method in class com.google.common.truth.IterableSubject
-
Fails if the iterable is not ordered, according to the natural ordering of its elements.
- isOrdered(Comparator<?>) - Method in class com.google.common.truth.IterableSubject
-
Fails if the iterable is not ordered, according to the given comparator.
- isPartiallyOrdered() - Method in class com.google.common.truth.IterableSubject
-
- isPartiallyOrdered(Comparator<?>) - Method in class com.google.common.truth.IterableSubject
-
- isPositiveInfinity() - Method in class com.google.common.truth.DoubleSubject
-
- isPositiveInfinity() - Method in class com.google.common.truth.FloatSubject
-
- isPresent() - Method in class com.google.common.truth.GuavaOptionalSubject
-
Fails if the Optional
<T>
is absent or the subject is null.
- isSameAs(Object) - Method in class com.google.common.truth.Subject
-
Fails if the subject is not the same instance as the given object.
- isStrictlyOrdered() - Method in class com.google.common.truth.IterableSubject
-
Fails if the iterable is not strictly ordered, according to the natural ordering of its
elements.
- isStrictlyOrdered(Comparator<?>) - Method in class com.google.common.truth.IterableSubject
-
Fails if the iterable is not strictly ordered, according to the given comparator.
- isTrue() - Method in class com.google.common.truth.BooleanSubject
-
Fails if the subject is false or null
.
- isWithin(double) - Method in class com.google.common.truth.DoubleSubject
-
Prepares for a check that the subject is a finite number within the given tolerance of an
expected value that will be provided in the next call in the fluent chain.
- isWithin(float) - Method in class com.google.common.truth.FloatSubject
-
Prepares for a check that the subject is a finite number within the given tolerance of an
expected value that will be provided in the next call in the fluent chain.
- isZero() - Method in class com.google.common.truth.DoubleSubject
-
Asserts that the subject is zero (i.e.
- isZero() - Method in class com.google.common.truth.FloatSubject
-
Asserts that the subject is zero (i.e.
- IterableSubject - Class in com.google.common.truth
-
- IterableSubject(FailureStrategy, Iterable<?>) - Constructor for class com.google.common.truth.IterableSubject
-
- IterableSubject.UsingCorrespondence<A,E> - Class in com.google.common.truth
-
A partially specified proposition in which the actual elements (normally the elements of the
Iterable
under test) are compared to expected elements using a
Correspondence
.