Skip navigation links
A B C D E F G H I L M N O P S T U V W 

A

about(Subject.Factory<S, A>) - Method in class com.google.common.truth.StandardSubjectBuilder
Given a factory for some Subject class, returns a builder whose that(actual) method creates instances of that class.
about(CustomSubjectBuilder.Factory<CustomSubjectBuilderT>) - Method in class com.google.common.truth.StandardSubjectBuilder
 
actual() - Method in class com.google.common.truth.Subject
Returns the unedited, unformatted raw actual value.
actualAsString() - Method in class com.google.common.truth.Subject
Returns a string representation of the actual value.
actualCustomStringRepresentation() - Method in class com.google.common.truth.IterableSubject
 
actualCustomStringRepresentation() - Method in class com.google.common.truth.Subject
Supplies the direct string representation of the actual value to other methods which may prefix or otherwise position it in an error message.
apply(A, E) - Method in interface com.google.common.truth.Correspondence.BinaryPredicate
Returns whether or not the actual and expected values satisfy the condition defined by this predicate.
apply(Statement, Description) - Method in class com.google.common.truth.Expect
 
apply(Statement, Description) - Method in class com.google.common.truth.ExpectFailure
 
asList() - Method in class com.google.common.truth.ObjectArraySubject
 
asList() - Method in class com.google.common.truth.PrimitiveBooleanArraySubject
 
asList() - Method in class com.google.common.truth.PrimitiveByteArraySubject
 
asList() - Method in class com.google.common.truth.PrimitiveCharArraySubject
 
asList() - Method in class com.google.common.truth.PrimitiveIntArraySubject
 
asList() - Method in class com.google.common.truth.PrimitiveLongArraySubject
 
asList() - Method in class com.google.common.truth.PrimitiveShortArraySubject
 
assert_() - Static method in class com.google.common.truth.Truth
Begins a call chain with the fluent Truth API.
assertAbout(Subject.Factory<S, T>) - Static method in class com.google.common.truth.Truth
Given a factory for some Subject class, returns a builder whose that(actual) method creates instances of that class.
assertAbout(CustomSubjectBuilder.Factory<CustomSubjectBuilderT>) - Static method in class com.google.common.truth.Truth
A generic, advanced method of extension of Truth to new types, which is documented on CustomSubjectBuilder.
assertThat(AssertionError) - Static method in class com.google.common.truth.ExpectFailure
Creates a subject for asserting about the given AssertionError, usually one produced by Truth.
assertThat(T) - Static method in class com.google.common.truth.Truth
 
assertThat(BigDecimal) - Static method in class com.google.common.truth.Truth
 
assertThat(Object) - Static method in class com.google.common.truth.Truth
 
assertThat(Class<?>) - Static method in class com.google.common.truth.Truth
 
assertThat(Throwable) - Static method in class com.google.common.truth.Truth
 
assertThat(Long) - Static method in class com.google.common.truth.Truth
 
assertThat(Double) - Static method in class com.google.common.truth.Truth
 
assertThat(Float) - Static method in class com.google.common.truth.Truth
 
assertThat(Integer) - Static method in class com.google.common.truth.Truth
 
assertThat(Boolean) - Static method in class com.google.common.truth.Truth
 
assertThat(String) - Static method in class com.google.common.truth.Truth
 
assertThat(Iterable<?>) - Static method in class com.google.common.truth.Truth
 
assertThat(SortedSet<?>) - Static method in class com.google.common.truth.Truth
 
assertThat(T[]) - Static method in class com.google.common.truth.Truth
 
assertThat(boolean[]) - Static method in class com.google.common.truth.Truth
 
assertThat(short[]) - Static method in class com.google.common.truth.Truth
 
assertThat(int[]) - Static method in class com.google.common.truth.Truth
 
assertThat(long[]) - Static method in class com.google.common.truth.Truth
 
assertThat(byte[]) - Static method in class com.google.common.truth.Truth
 
assertThat(char[]) - Static method in class com.google.common.truth.Truth
 
assertThat(float[]) - Static method in class com.google.common.truth.Truth
 
assertThat(double[]) - Static method in class com.google.common.truth.Truth
 
assertThat(Optional<?>) - Static method in class com.google.common.truth.Truth
 
assertThat(Map<?, ?>) - Static method in class com.google.common.truth.Truth
 
assertThat(SortedMap<?, ?>) - Static method in class com.google.common.truth.Truth
 
assertThat(Multimap<?, ?>) - Static method in class com.google.common.truth.Truth
 
assertThat(ListMultimap<?, ?>) - Static method in class com.google.common.truth.Truth
 
assertThat(SetMultimap<?, ?>) - Static method in class com.google.common.truth.Truth
 
assertThat(Multiset<?>) - Static method in class com.google.common.truth.Truth
 
assertThat(Table<?, ?, ?>) - Static method in class com.google.common.truth.Truth
 
assertThat(AtomicLongMap<?>) - Static method in class com.google.common.truth.Truth
 
assertWithMessage(String) - Static method in class com.google.common.truth.Truth
Returns a StandardSubjectBuilder that will prepend the given message to the failure message in the event of a test failure.
assertWithMessage(String, Object...) - Static method in class com.google.common.truth.Truth
Returns a StandardSubjectBuilder that will prepend the formatted message using the specified arguments to the failure message in the event of a test failure.
assume() - Static method in class com.google.common.truth.TruthJUnit
Begins a call chain with the fluent Truth API.
AtomicLongMapSubject - Class in com.google.common.truth
Propositions for AtomicLongMap subjects.

B

BigDecimalSubject - Class in com.google.common.truth
Propositions for BigDecimal typed subjects.
BooleanSubject - Class in com.google.common.truth
Propositions for boolean subjects.

C

check() - Method in class com.google.common.truth.Subject
Returns a builder for creating a derived subject but without providing information about how the derived subject will relate to the current subject.
check(String, Object...) - Method in class com.google.common.truth.Subject
Returns a builder for creating a derived subject.
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
Propositions for Comparable typed subjects.
ComparableSubject(FailureMetadata, T) - Constructor for class com.google.common.truth.ComparableSubject
Constructor for use by subclasses.
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 check 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 check 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 check in which the actual values (i.e.
contains(Object) - Method in class com.google.common.truth.IterableSubject
Checks (with a side-effect failure) that the subject contains the supplied item.
contains(E) - Method in class com.google.common.truth.IterableSubject.UsingCorrespondence
Checks 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.CaseInsensitiveStringComparison
Fails if the string does not contain the given sequence (while ignoring case).
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
Checks that the actual iterable contains at least all of the expected elements or fails.
containsAllIn(Object[]) - Method in class com.google.common.truth.IterableSubject
Checks 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
Checks that the subject contains elements that corresponds to all of the expected elements, i.e.
containsAllIn(E[]) - Method in class com.google.common.truth.IterableSubject.UsingCorrespondence
Checks 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
Checks 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
Checks that the subject contains elements that corresponds to all of the expected elements, i.e.
containsAllOf(double[]) - Method in class com.google.common.truth.PrimitiveDoubleArraySubject.DoubleArrayAsIterable
containsAllOf(float[]) - Method in class com.google.common.truth.PrimitiveFloatArraySubject.FloatArrayAsIterable
containsAnyIn(Iterable<?>) - Method in class com.google.common.truth.IterableSubject
Checks that the subject contains at least one of the objects contained in the provided collection or fails.
containsAnyIn(Object[]) - Method in class com.google.common.truth.IterableSubject
Checks that the subject contains at least one of the objects contained in the provided array or fails.
containsAnyIn(Iterable<? extends E>) - Method in class com.google.common.truth.IterableSubject.UsingCorrespondence
Checks that the subject contains at least one element that corresponds to at least one of the expected elements.
containsAnyIn(E[]) - Method in class com.google.common.truth.IterableSubject.UsingCorrespondence
Checks 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
Checks 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
Checks that the subject contains at least one element that corresponds to at least one of the expected elements.
containsAnyOf(double[]) - Method in class com.google.common.truth.PrimitiveDoubleArraySubject.DoubleArrayAsIterable
containsAnyOf(float[]) - Method in class com.google.common.truth.PrimitiveFloatArraySubject.FloatArrayAsIterable
containsAtLeast(Object, Object, Object...) - Method in class com.google.common.truth.MapSubject
 
containsAtLeast(Object, E, Object...) - Method in class com.google.common.truth.MapSubject.UsingCorrespondence
Fails if the map does not contain at least the given set of keys mapping to values that correspond to the given values.
containsAtLeast(Object, Object, Object...) - Method in class com.google.common.truth.MultimapSubject
Fails if the multimap does not contain at least the given key/value pairs.
containsAtLeast(Object, Object, Object...) - Method in class com.google.common.truth.MultimapSubject.UsingCorrespondence
Fails if the multimap does not contain at least the given key/value pairs.
containsAtLeastEntriesIn(Map<?, ?>) - Method in class com.google.common.truth.MapSubject
Fails if the map does not contain at least the given set of entries in the given map.
containsAtLeastEntriesIn(Map<K, V>) - Method in class com.google.common.truth.MapSubject.UsingCorrespondence
Fails if the map does not contain at least the keys in the given map, mapping to values that correspond to the values of the given map.
containsAtLeastEntriesIn(Multimap<?, ?>) - Method in class com.google.common.truth.MultimapSubject
Fails if the Multimap does not contain at least the entries in the argument Multimap.
containsAtLeastEntriesIn(Multimap<K, V>) - Method in class com.google.common.truth.MultimapSubject.UsingCorrespondence
Fails if the map does not contain at least the keys in the given multimap, mapping to values that correspond to the values of the given multimap.
containsCell(Object, Object, Object) - Method in class com.google.common.truth.TableSubject
Fails if the table does not contain the given cell.
containsCell(Table.Cell<?, ?, ?>) - 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
Checks that a subject contains exactly the provided objects or fails.
containsExactly(E...) - Method in class com.google.common.truth.IterableSubject.UsingCorrespondence
Checks 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() - Method in class com.google.common.truth.MultimapSubject
Fails if the multimap is not empty.
containsExactly(Object, Object, Object...) - Method in class com.google.common.truth.MultimapSubject
Fails if the multimap does not contain exactly the given set of key/value pairs.
containsExactly(Object, Object, Object...) - Method in class com.google.common.truth.MultimapSubject.UsingCorrespondence
Fails if the multimap does not contain exactly the given set of key/value pairs.
containsExactly() - Method in class com.google.common.truth.MultimapSubject.UsingCorrespondence
Fails if the multimap is not empty.
containsExactly(double[]) - Method in class com.google.common.truth.PrimitiveDoubleArraySubject.DoubleArrayAsIterable
containsExactly(float[]) - Method in class com.google.common.truth.PrimitiveFloatArraySubject.FloatArrayAsIterable
containsExactlyElementsIn(Iterable<?>) - Method in class com.google.common.truth.IterableSubject
Checks that a subject contains exactly the provided objects or fails.
containsExactlyElementsIn(Object[]) - Method in class com.google.common.truth.IterableSubject
Checks that a subject contains exactly the provided objects or fails.
containsExactlyElementsIn(Iterable<? extends E>) - Method in class com.google.common.truth.IterableSubject.UsingCorrespondence
Checks that subject contains exactly elements that correspond to the expected elements, i.e.
containsExactlyElementsIn(E[]) - Method in class com.google.common.truth.IterableSubject.UsingCorrespondence
Checks 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.
containsExactlyEntriesIn(Multimap<K, V>) - Method in class com.google.common.truth.MultimapSubject.UsingCorrespondence
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.
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(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
Checks that the subject does not contain duplicate elements.
containsNoneIn(Iterable<?>) - Method in class com.google.common.truth.IterableSubject
Checks that the actual iterable contains none of the elements contained in the excluded iterable or fails.
containsNoneIn(Object[]) - Method in class com.google.common.truth.IterableSubject
Checks that the actual iterable contains none of the elements contained in the excluded array or fails.
containsNoneIn(Iterable<? extends E>) - Method in class com.google.common.truth.IterableSubject.UsingCorrespondence
Checks that the subject contains no elements that correspond to any of the given elements.
containsNoneIn(E[]) - Method in class com.google.common.truth.IterableSubject.UsingCorrespondence
Checks 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
Checks 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
Checks that the subject contains no elements that correspond to any of the given elements.
containsNoneOf(double[]) - Method in class com.google.common.truth.PrimitiveDoubleArraySubject.DoubleArrayAsIterable
containsNoneOf(float[]) - Method in class com.google.common.truth.PrimitiveFloatArraySubject.FloatArrayAsIterable
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 for the purposes of a test assertion.
Correspondence() - Constructor for class com.google.common.truth.Correspondence
 
Correspondence.BinaryPredicate<A,E> - Interface in com.google.common.truth
A functional interface for a binary predicate, to be used to test whether a pair of objects of types A and E satisfy some condition.
create() - Static method in class com.google.common.truth.Expect
 
createAndEnableStackTrace() - Static method in class com.google.common.truth.Expect
 
createSubject(FailureMetadata, ActualT) - Method in interface com.google.common.truth.Subject.Factory
Creates a new Subject.
createSubjectBuilder(FailureMetadata) - Method in interface com.google.common.truth.CustomSubjectBuilder.Factory
Creates a new CustomSubjectBuilder of the appropriate type.
CustomSubjectBuilder - Class in com.google.common.truth
In a fluent assertion chain, exposes one or more "custom" that methods, which accept a value under test and return a Subject.
CustomSubjectBuilder(FailureMetadata) - Constructor for class com.google.common.truth.CustomSubjectBuilder
Constructor for use by subclasses.
CustomSubjectBuilder.Factory<CustomSubjectBuilderT extends CustomSubjectBuilder> - Interface in com.google.common.truth
In a fluent assertion chain, the argument to the "custom" overload of about, the method that specifies what kind of Subject to create.

D

DefaultSubject - Class in com.google.common.truth
 
displayingDiffsPairedBy(Function<? super E, ? extends Object>) - Method in class com.google.common.truth.IterableSubject.UsingCorrespondence
Specifies a way to pair up unexpected and missing elements in the message when an assertion fails.
displayingDiffsPairedBy(Function<? super A, ? extends Object>, Function<? super E, ? extends Object>) - Method in class com.google.common.truth.IterableSubject.UsingCorrespondence
Specifies a way to pair up unexpected and missing elements in the message when an assertion fails.
doesNotContain(Object) - Method in class com.google.common.truth.IterableSubject
Checks (with a side-effect failure) that the subject does not contain the supplied item.
doesNotContain(E) - Method in class com.google.common.truth.IterableSubject.UsingCorrespondence
Checks that none of the actual elements correspond to the given element.
doesNotContain(CharSequence) - Method in class com.google.common.truth.StringSubject.CaseInsensitiveStringComparison
Fails if the string contains the given sequence (while ignoring case).
doesNotContain(CharSequence) - Method in class com.google.common.truth.StringSubject
Fails if the string contains the given sequence.
doesNotContain(Object, Object) - Method in class com.google.common.truth.TableSubject
Fails if the table contains a mapping for the given row key and column key.
doesNotContainCell(Object, Object, Object) - Method in class com.google.common.truth.TableSubject
Fails if the table contains the given cell.
doesNotContainCell(Table.Cell<?, ?, ?>) - Method in class com.google.common.truth.TableSubject
Fails if the table contains the given cell.
doesNotContainEntry(Object, long) - Method in class com.google.common.truth.AtomicLongMapSubject
 
doesNotContainEntry(Object, Object) - Method in class com.google.common.truth.MapSubject
Fails if the map contains the given entry.
doesNotContainEntry(Object, E) - Method in class com.google.common.truth.MapSubject.UsingCorrespondence
Fails if the map contains an entry with the given key and a value that corresponds to the given value.
doesNotContainEntry(Object, Object) - Method in class com.google.common.truth.MultimapSubject
Fails if the multimap contains the given entry.
doesNotContainEntry(Object, E) - Method in class com.google.common.truth.MultimapSubject.UsingCorrespondence
Fails if the multimap contains an entry with the given key and a value that corresponds to the given value.
doesNotContainKey(Object) - Method in class com.google.common.truth.AtomicLongMapSubject
Fails if the AtomicLongMap contains the given key.
doesNotContainKey(Object) - Method in class com.google.common.truth.MapSubject
Fails if the map contains the given key.
doesNotContainKey(Object) - Method in class com.google.common.truth.MultimapSubject
Fails if the multimap contains the given key.
doesNotContainMatch(Pattern) - Method in class com.google.common.truth.StringSubject
Fails if the string contains a match on the given regex.
doesNotContainMatch(String) - Method in class com.google.common.truth.StringSubject
Fails if the string contains a match on the given regex.
doesNotMatch(String) - Method in class com.google.common.truth.StringSubject
Fails if the string matches the given regex.
doesNotMatch(Pattern) - Method in class com.google.common.truth.StringSubject
Fails if the string matches the given regex.
DoubleSubject - Class in com.google.common.truth
Propositions for Double subjects.
DoubleSubject.TolerantDoubleComparison - Class in com.google.common.truth
A partially specified check about an approximate relationship to a double subject using a tolerance.

E

endsWith(String) - Method in class com.google.common.truth.StringSubject
Fails if the string does not end with the given string.
equals(Object) - Method in class com.google.common.truth.Correspondence
Deprecated.
Object.equals(Object) is not supported. If you meant to compare objects using this Correspondence, use Correspondence.compare(A, E).
equals(Object) - Method in class com.google.common.truth.DoubleSubject.TolerantDoubleComparison
Deprecated.
Object.equals(Object) is not supported on TolerantDoubleComparison. If you meant to compare doubles, use DoubleSubject.TolerantDoubleComparison.of(double) instead.
equals(Object) - Method in class com.google.common.truth.FloatSubject.TolerantFloatComparison
Deprecated.
Object.equals(Object) is not supported on TolerantFloatComparison. If you meant to compare floats, use FloatSubject.TolerantFloatComparison.of(float) instead.
equals(Object) - Method in class com.google.common.truth.PrimitiveDoubleArraySubject.TolerantPrimitiveDoubleArrayComparison
equals(Object) - Method in class com.google.common.truth.PrimitiveFloatArraySubject.TolerantPrimitiveFloatArrayComparison
equals(Object) - Method in class com.google.common.truth.Subject
Deprecated.
Object.equals(Object) is not supported on Truth subjects. If you meant to test object equality between an expected and the actual value, use Subject.isEqualTo(Object) instead.
equalWithinTolerance(double, double, double) - Static method in class com.google.common.truth.MathUtil
Returns true iff left and right are finite values within tolerance of each other.
equalWithinTolerance(float, float, float) - Static method in class com.google.common.truth.MathUtil
Returns true iff left and right are finite values within tolerance of each other.
Expect - Class in com.google.common.truth
A TestRule that batches up all failures encountered during a test, and reports them all together at the end (similar to ErrorCollector).
ExpectFailure - Class in com.google.common.truth
A utility for testing that assertions against a custom Subject fail when they should, plus a utility to assert about parts of the resulting failure messages.
ExpectFailure() - Constructor for class com.google.common.truth.ExpectFailure
Creates a new instance for use as a @Rule.
expectFailure(ExpectFailure.StandardSubjectBuilderCallback) - Static method in class com.google.common.truth.ExpectFailure
Static alternative that directly returns the triggered failure.
ExpectFailure.SimpleSubjectBuilderCallback<S extends Subject<S,A>,A> - Interface in com.google.common.truth
A "functional interface" for expectFailureAbout() to invoke and capture failures.
ExpectFailure.StandardSubjectBuilderCallback - Interface in com.google.common.truth
A "functional interface" for expectFailure() to invoke and capture failures.
expectFailureAbout(Subject.Factory<S, A>, ExpectFailure.SimpleSubjectBuilderCallback<S, A>) - Static method in class com.google.common.truth.ExpectFailure
Static alternative that directly returns the triggered failure.

F

Fact - Class in com.google.common.truth
A string key-value pair in a failure message, such as "expected: abc" or "but was: xyz."
fact(String, Object) - Static method in class com.google.common.truth.Fact
Creates a fact with the given key and value, which will be printed in a format like "key: value." The value is converted to a string by calling String.valueOf on it.
factKeys() - Method in class com.google.common.truth.TruthFailureSubject
Returns a subject for the list of fact keys.
factValue(String) - Method in class com.google.common.truth.TruthFailureSubject
Returns a subject for the value with the given name.
factValue(String, int) - Method in class com.google.common.truth.TruthFailureSubject
Returns a subject for the value of the index-th instance of the fact with the given name.
fail(AssertionError) - Method in interface com.google.common.truth.FailureStrategy
Handles a failure.
fail() - Method in class com.google.common.truth.StandardSubjectBuilder
Triggers the failure strategy with an empty failure message
fail(String, Object...) - Method in class com.google.common.truth.StandardSubjectBuilder
Triggers the failure strategy with the given failure message
fail(String) - Method in class com.google.common.truth.Subject
Deprecated.
Prefer to construct Fact-style methods, typically by using failWithActual(simpleFact(...)). However, if you want to preserve your exact failure message as a migration aid, you can inline this method (and then inline the resulting method call, as well).
fail(String, Object) - Method in class com.google.common.truth.Subject
Deprecated.
Prefer to construct Fact-style methods, typically by using Subject.failWithActual(String, Object). However, if you want to preserve your exact failure message as a migration aid, you can inline this method (and then inline the resulting method call, as well).
fail(String, Object...) - Method in class com.google.common.truth.Subject
Deprecated.
Prefer to construct Fact-style methods, typically by using Subject.failWithActual(Fact, Fact...). However, if you want to preserve your exact failure message as a migration aid, you can inline this method.
FailureMetadata - Class in com.google.common.truth
An opaque, immutable object containing state from the previous calls in the fluent assertion chain.
FailureStrategy - Interface in com.google.common.truth
Defines what to do when a check fails.
failWithActual(String, Object) - Method in class com.google.common.truth.Subject
Fails, reporting a message with two "facts": key: value but was: actual value.
failWithActual(Fact, Fact...) - Method in class com.google.common.truth.Subject
Fails, reporting a message with the given facts, followed by an automatically added fact of the form: but was: actual value.
failWithBadResults(String, Object, String, Object) - Method in class com.google.common.truth.Subject
Deprecated.
Prefer to construct Fact-style methods, typically by using Subject.failWithActual(Fact, Fact...). However, if you want to preserve your exact failure message as a migration aid, you can inline this method.
failWithCustomSubject(String, Object, Object) - Method in class com.google.common.truth.Subject
Deprecated.
Prefer to construct Fact-style methods, typically by using Subject.failWithoutActual(Fact, Fact...). However, if you want to preserve your exact failure message as a migration aid, you can inline this method.
failWithoutActual(Fact, Fact...) - Method in class com.google.common.truth.Subject
Fails, reporting a message with the given facts, without automatically adding the actual value.
failWithoutActual(String) - Method in class com.google.common.truth.Subject
Deprecated.
Prefer to construct Fact-style methods, typically by using failWithoutActual(simpleFact(...)). However, if you want to preserve your exact failure message as a migration aid, you can inline this method (and then inline the resulting method call, as well).
failWithoutSubject(String) - Method in class com.google.common.truth.Subject
Deprecated.
Prefer to construct Fact-style methods, typically by using failWithoutActual(simpleFact(...)). However, if you want to preserve your exact failure message as a migration aid, you can inline this method.
FloatSubject - Class in com.google.common.truth
Propositions for Float subjects.
FloatSubject.TolerantFloatComparison - Class in com.google.common.truth
A partially specified check about an approximate relationship to a float subject using a tolerance.
forCustomFailureStrategy(FailureStrategy) - Static method in class com.google.common.truth.StandardSubjectBuilder
Returns a new instance that invokes the given FailureStrategy when a check fails.
formatDiff(A, E) - Method in class com.google.common.truth.Correspondence
Returns a String describing the difference between the actual and expected values, if possible, or null if not.
from(Correspondence.BinaryPredicate<A, E>, String) - Static method in class com.google.common.truth.Correspondence
Constructs a Correspondence that compares actual and expected elements using the given binary predicate.

G

getFailure() - Method in class com.google.common.truth.ExpectFailure
Returns the captured failure, if one occurred.
getSubject() - Method in class com.google.common.truth.Subject
Deprecated.
Prefer #actual() for direct access to the subject.
GuavaOptionalSubject - Class in com.google.common.truth
Propositions for Guava Optional subjects.

H

hasCauseThat() - Method in class com.google.common.truth.ThrowableSubject
Returns a new ThrowableSubject that supports assertions on this throwable's direct cause.
hasCount(Object, int) - Method in class com.google.common.truth.MultisetSubject
Fails if the element does not have the given count.
hasFailures() - Method in class com.google.common.truth.Expect
 
hasFirstElement(Object) - Method in class com.google.common.truth.SortedSetSubject
Fails if the subject does not have the given first element.
hasFirstEntry(Object, Object) - Method in class com.google.common.truth.SortedMapSubject
Fails if the map's first key/value pair is not equal to the given entry.
hasFirstKey(Object) - Method in class com.google.common.truth.SortedMapSubject
Fails if the map's first key is not equal to the given key.
hashCode() - Method in class com.google.common.truth.Correspondence
Deprecated.
Object.hashCode() is not supported.
hashCode() - Method in class com.google.common.truth.DoubleSubject.TolerantDoubleComparison
Deprecated.
Object.hashCode() is not supported on TolerantDoubleComparison
hashCode() - Method in class com.google.common.truth.FloatSubject.TolerantFloatComparison
Deprecated.
Object.hashCode() is not supported on TolerantFloatComparison
hashCode() - Method in class com.google.common.truth.PrimitiveDoubleArraySubject.TolerantPrimitiveDoubleArrayComparison
Deprecated.
Object.hashCode() is not supported on TolerantPrimitiveDoubleArrayComparison
hashCode() - Method in class com.google.common.truth.PrimitiveFloatArraySubject.TolerantPrimitiveFloatArrayComparison
Deprecated.
Object.hashCode() is not supported on TolerantPrimitiveFloatArrayComparison
hashCode() - Method in class com.google.common.truth.Subject
Deprecated.
Object.hashCode() is not supported on Truth subjects.
hasLastElement(Object) - Method in class com.google.common.truth.SortedSetSubject
Fails if the subject does not have the given last element.
hasLastEntry(Object, Object) - Method in class com.google.common.truth.SortedMapSubject
Fails if the map's last key/value pair is not equal to the given entry.
hasLastKey(Object) - Method in class com.google.common.truth.SortedMapSubject
Fails if the map's last key is not equal to the given key.
hasLength(int) - Method in class com.google.common.truth.StringSubject
Fails if the string does not have the given length.
hasMessage(String) - Method in class com.google.common.truth.ThrowableSubject
Deprecated.
Use hasMessageThat().isEqualTo(expected) instead. You may also consider using inexact matching of the message (e.g. hasMessageThat().contains(substring)) for less brittle tests.
hasMessageThat() - Method in class com.google.common.truth.ThrowableSubject
Returns a StringSubject to make assertions about the throwable's message.
hasSize(int) - Method in class com.google.common.truth.AtomicLongMapSubject
Fails if the AtomicLongMap does not have the given size.
hasSize(int) - Method in class com.google.common.truth.IterableSubject
Fails if the subject does not have the given size.
hasSize(int) - Method in class com.google.common.truth.MapSubject
Fails if the map does not have the given size.
hasSize(int) - Method in class com.google.common.truth.MultimapSubject
Fails if the multimap does not have the given size.
hasSize(int) - Method in class com.google.common.truth.TableSubject
Fails if the table does not have the given size.
hasSum(long) - Method in class com.google.common.truth.AtomicLongMapSubject
Fails if the AtomicLongMap does not have the given sum.
hasValue(Object) - Method in class com.google.common.truth.GuavaOptionalSubject
Fails if the Optional<T> does not have the given value or the subject is null.
hasValuesNotWithin(double) - Method in class com.google.common.truth.PrimitiveDoubleArraySubject
Deprecated.
Write a for loop over the values looking for mismatches (see this implementation for an example)
hasValuesNotWithin(float) - Method in class com.google.common.truth.PrimitiveFloatArraySubject
Deprecated.
Write a for loop over the values looking for mismatches (see this implementation for an example)
hasValuesWithin(double) - Method in class com.google.common.truth.PrimitiveDoubleArraySubject
Deprecated.
Use PrimitiveDoubleArraySubject.usingTolerance(double), e.g. assertThat(doubleArray).usingTolerance(1e-5).containsExactly(1.2, 3.4, 5.6).inOrder();
hasValuesWithin(float) - Method in class com.google.common.truth.PrimitiveFloatArraySubject
Deprecated.
Use PrimitiveFloatArraySubject.usingTolerance(double), e.g. assertThat(floatArray).usingTolerance(1e-5).containsExactly(1.2f, 3.4f, 5.6f).inOrder();

I

ignoreCheck() - Method in class com.google.common.truth.Subject
Begins a new call chain that ignores any failures.
ignoringCase() - Method in class com.google.common.truth.StringSubject
Returns a StringSubject-like instance that will ignore the case of the characters.
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
Propositions for Integer subjects.
IntegerSubject(FailureMetadata, Integer) - Constructor for class com.google.common.truth.IntegerSubject
Constructor for use by subclasses.
internalCustomName() - Method in class com.google.common.truth.Subject
An internal method used to obtain the value set by Subject.named(String, Object...).
invokeAssertion(SimpleSubjectBuilder<S, A>) - Method in interface com.google.common.truth.ExpectFailure.SimpleSubjectBuilderCallback
 
invokeAssertion(StandardSubjectBuilder) - Method in interface com.google.common.truth.ExpectFailure.StandardSubjectBuilderCallback
 
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
Checks that the subject is greater than or equal to other.
isAtMost(T) - Method in class com.google.common.truth.ComparableSubject
Checks that the subject is less than or equal to other.
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
Deprecated.
AtomicLongMap does not define equality (i.e., it does not implement equals()), so you probably don't want to call this method. Instead, perform your assertion on the map view (e.g., assertThat(atomicLongMap.asMap()).isEqualTo(EXPECTED_MAP)).
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 Double#equals.
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 Float#equals.
isEqualTo(SetMultimap<?, ?>) - Method in class com.google.common.truth.ListMultimapSubject
Deprecated.
A SetMultimap can never compare equal with a ListMultimap if either Multimap is non-empty, because Set and List can never compare equal. Prefer MultimapSubject.containsExactlyEntriesIn(com.google.common.collect.Multimap) instead. Consult Multimap.equals(java.lang.Object) for more information.
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.PrimitiveDoubleArraySubject
A check that the actual array and expected are arrays of the same length and type, containing elements such that each element in expected is equal to each element in the actual array, and in the same position, with element equality defined the same way that Arrays.equals(double[], double[]) and Double.equals(Object) define it (which is different to the way that the == operator on primitive double defines it).
isEqualTo(Object) - Method in class com.google.common.truth.PrimitiveFloatArraySubject
A check that the actual array and expected are arrays of the same length and type, containing elements such that each element in expected is equal to each element in the actual array, and in the same position, with element equality defined the same way that Arrays.equals(float[], float[]) and Float.equals(Object) define it (which is different to the way that the == operator on primitive float defines it).
isEqualTo(ListMultimap<?, ?>) - Method in class com.google.common.truth.SetMultimapSubject
Deprecated.
A ListMultimap can never compare equal with a SetMultimap if either Multimap is non-empty, because List and Set can never compare equal. Prefer MultimapSubject.containsExactlyEntriesIn(com.google.common.collect.Multimap) instead. Consult Multimap.equals(java.lang.Object) for more information.
isEqualTo(String) - Method in class com.google.common.truth.StringSubject.CaseInsensitiveStringComparison
Fails if the subject is not equal to the given sequence (while ignoring case).
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
Checks that the subject is equivalent to other according to Comparable.compareTo(T), (i.e., checks that a.comparesTo(b) == 0).
isEquivalentAccordingToCompareTo(Double) - Method in class com.google.common.truth.DoubleSubject
Deprecated.
Use DoubleSubject.isWithin(double) or DoubleSubject.isEqualTo(java.lang.Double) instead (see documentation for advice).
isEquivalentAccordingToCompareTo(Float) - Method in class com.google.common.truth.FloatSubject
Deprecated.
Use FloatSubject.isWithin(float) or FloatSubject.isEqualTo(java.lang.Float) instead (see documentation for advice).
isEquivalentAccordingToCompareTo(Integer) - Method in class com.google.common.truth.IntegerSubject
Deprecated.
Use Subject.isEqualTo(java.lang.Object) instead. Integer comparison is consistent with equality.
isEquivalentAccordingToCompareTo(Long) - Method in class com.google.common.truth.LongSubject
Deprecated.
Use Subject.isEqualTo(java.lang.Object) instead. Long comparison is consistent with equality.
isEquivalentAccordingToCompareTo(String) - Method in class com.google.common.truth.StringSubject
Deprecated.
Use Subject.isEqualTo(java.lang.Object) instead. String comparison is consistent with equality.
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
Checks that the subject is greater than other.
isIn(Range<T>) - Method in class com.google.common.truth.ComparableSubject
Checks that the subject is in 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.
isLessThan(T) - Method in class com.google.common.truth.ComparableSubject
Checks that the subject is less than other.
isNaN() - Method in class com.google.common.truth.DoubleSubject
Asserts that the subject is Double.NaN.
isNaN() - Method in class com.google.common.truth.FloatSubject
Asserts that the subject is Float.NaN.
isNegativeInfinity() - Method in class com.google.common.truth.DoubleSubject
Asserts that the subject is Double.NEGATIVE_INFINITY.
isNegativeInfinity() - Method in class com.google.common.truth.FloatSubject
Asserts that the subject is Float.NEGATIVE_INFINITY.
isNoneOf(Object, Object, Object...) - Method in class com.google.common.truth.IterableSubject
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.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
Deprecated.
AtomicLongMap does not define equality (i.e., it does not implement equals()), so you probably don't want to call this method. Instead, perform your assertion on the map view (e.g., assertThat(atomicLongMap.asMap()).isNotEqualTo(UNEXPECTED_MAP)).
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 Double#equals.
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 Float#equals.
isNotEqualTo(Object) - Method in class com.google.common.truth.PrimitiveDoubleArraySubject
A check that the actual array and expected are not arrays of the same length and type, containing elements such that each element in expected is equal to each element in the actual array, and in the same position, with element equality defined the same way that Arrays.equals(double[], double[]) and Double.equals(Object) define it (which is different to the way that the == operator on primitive double defines it).
isNotEqualTo(Object) - Method in class com.google.common.truth.PrimitiveFloatArraySubject
A check that the actual array and expected are not arrays of the same length and type, containing elements such that each element in expected is equal to each element in the actual array, and in the same position, with element equality defined the same way that Arrays.equals(float[], float[]) and Float.equals(Object) define it (which is different to the way that the == operator on primitive float defines it).
isNotEqualTo(String) - Method in class com.google.common.truth.StringSubject.CaseInsensitiveStringComparison
Fails if the subject is equal to the given string (while ignoring case).
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
Checks that the subject is not in range.
isNotIn(Iterable<?>) - Method in class com.google.common.truth.IterableSubject
Deprecated.
You probably meant to call IterableSubject.containsNoneIn(java.lang.Iterable<?>) instead.
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
Asserts that the subject is a non-null value other than Double.NaN (but it may be Double.POSITIVE_INFINITY or Double.NEGATIVE_INFINITY).
isNotNaN() - Method in class com.google.common.truth.FloatSubject
Asserts that the subject is a non-null value other than Float.NaN (but it may be Float.POSITIVE_INFINITY or Float.NEGATIVE_INFINITY).
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.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.
isPositiveInfinity() - Method in class com.google.common.truth.DoubleSubject
Asserts that the subject is Double.POSITIVE_INFINITY.
isPositiveInfinity() - Method in class com.google.common.truth.FloatSubject
Asserts that the subject is Float.POSITIVE_INFINITY.
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
Propositions for Iterable subjects.
IterableSubject(FailureMetadata, Iterable<?>) - Constructor for class com.google.common.truth.IterableSubject
Constructor for use by subclasses.
IterableSubject.UsingCorrespondence<A,E> - Class in com.google.common.truth
A partially specified check in which the actual elements (normally the elements of the Iterable under test) are compared to expected elements using a Correspondence.

L

ListMultimapSubject - Class in com.google.common.truth
Type-specific extensions of Multimap subjects for ListMultimap subjects.
LongSubject - Class in com.google.common.truth
Propositions for long subjects.
LongSubject(FailureMetadata, Long) - Constructor for class com.google.common.truth.LongSubject
Constructor for use by subclasses.

M

MapSubject - Class in com.google.common.truth
Propositions for Map subjects.
MapSubject.UsingCorrespondence<A,E> - Class in com.google.common.truth
A partially specified check in which the actual values (i.e.
matches(String) - Method in class com.google.common.truth.StringSubject
Fails if the string does not match the given regex.
matches(Pattern) - Method in class com.google.common.truth.StringSubject
Fails if the string does not match the given regex.
MathUtil - Class in com.google.common.truth
Math utilities to be shared by numeric subjects.
metadata() - Method in class com.google.common.truth.CustomSubjectBuilder
Returns the FailureMetadata instance that that methods should pass to Subject constructors.
MultimapSubject - Class in com.google.common.truth
Propositions for Multimap subjects.
MultimapSubject.UsingCorrespondence<A,E> - Class in com.google.common.truth
A partially specified check in which the actual values (i.e.
MultisetSubject - Class in com.google.common.truth
Propositions for Multiset subjects.

N

named(String, Object...) - Method in class com.google.common.truth.ListMultimapSubject
 
named(String, Object...) - Method in class com.google.common.truth.MultisetSubject
 
named(String, Object...) - Method in class com.google.common.truth.SetMultimapSubject
 
named(String, Object...) - Method in class com.google.common.truth.SortedMapSubject
 
named(String, Object...) - Method in class com.google.common.truth.SortedSetSubject
 
named(String, Object...) - Method in class com.google.common.truth.Subject
Adds a prefix to the subject, when it is displayed in error messages.
notEqualWithinTolerance(double, double, double) - Static method in class com.google.common.truth.MathUtil
Returns true iff left and right are finite values not within tolerance of each other.
notEqualWithinTolerance(float, float, float) - Static method in class com.google.common.truth.MathUtil
Returns true iff left and right are finite values not within tolerance of each other.

O

ObjectArraySubject<T> - Class in com.google.common.truth
A Subject for Object[] and more generically T[].
of(double) - Method in class com.google.common.truth.DoubleSubject.TolerantDoubleComparison
Fails if the subject was expected to be within the tolerance of the given value but was not or if it was expected not to be within the tolerance but was.
of(float) - Method in class com.google.common.truth.FloatSubject.TolerantFloatComparison
Fails if the subject was expected to be within the tolerance of the given value but was not or if it was expected not to be within the tolerance but was.
of(double...) - Method in class com.google.common.truth.PrimitiveDoubleArraySubject.TolerantPrimitiveDoubleArrayComparison
Fails if the values in the subject were expected to be within the tolerance of the given values but were not or if they were expected not to be within the tolerance but were.
of(float...) - Method in class com.google.common.truth.PrimitiveFloatArraySubject.TolerantPrimitiveFloatArrayComparison
Fails if the values in the subject were expected to be within the tolerance of the given values but were not or if they were expected not to be within the tolerance but were.
ofElementsIn(Iterable<? extends Number>) - Method in class com.google.common.truth.PrimitiveDoubleArraySubject.TolerantPrimitiveDoubleArrayComparison
Fails if the values in the subject were expected to be within the tolerance of the given values but were not or if they were expected not to be within the tolerance but were.
ofElementsIn(Iterable<? extends Number>) - Method in class com.google.common.truth.PrimitiveFloatArraySubject.TolerantPrimitiveFloatArrayComparison
Fails if the values in the subject were expected to be within the tolerance of the given values but were not or if they were expected not to be within the tolerance but were.
Ordered - Interface in com.google.common.truth
Returned by calls like IterableSubject.containsExactly(java.lang.Object...), Ordered lets the caller additionally check that the expected elements were present in the order they were passed to the previous calls.

P

PrimitiveBooleanArraySubject - Class in com.google.common.truth
A Subject for boolean[].
PrimitiveByteArraySubject - Class in com.google.common.truth
A Subject for byte[].
PrimitiveCharArraySubject - Class in com.google.common.truth
A Subject for char[].
PrimitiveDoubleArraySubject - Class in com.google.common.truth
A Subject for double[].
PrimitiveDoubleArraySubject.DoubleArrayAsIterable - Class in com.google.common.truth
A partially specified check for doing assertions on the array similar to the assertions supported for Iterable subjects, in which the elements of the array under test are compared to expected elements using either exact or tolerant double equality: see PrimitiveDoubleArraySubject.usingExactEquality() and PrimitiveDoubleArraySubject.usingTolerance(double).
PrimitiveDoubleArraySubject.TolerantPrimitiveDoubleArrayComparison - Class in com.google.common.truth
A partially specified check about an approximate relationship to a double[] subject using a tolerance.
PrimitiveFloatArraySubject - Class in com.google.common.truth
A Subject for float[].
PrimitiveFloatArraySubject.FloatArrayAsIterable - Class in com.google.common.truth
A partially specified check for doing assertions on the array similar to the assertions supported for Iterable subjects, in which the elements of the array under test are compared to expected elements using either exact or tolerant float equality: see PrimitiveFloatArraySubject.usingExactEquality() and PrimitiveFloatArraySubject.usingTolerance(double).
PrimitiveFloatArraySubject.TolerantPrimitiveFloatArrayComparison - Class in com.google.common.truth
A partially specified check about an approximate relationship to a float[] subject using a tolerance.
PrimitiveIntArraySubject - Class in com.google.common.truth
A Subject for int[].
PrimitiveLongArraySubject - Class in com.google.common.truth
A Subject for long[].
PrimitiveShortArraySubject - Class in com.google.common.truth
A Subject for short[].

S

SetMultimapSubject - Class in com.google.common.truth
Type-specific extensions of Multimap subjects for SetMultimap subjects.
simpleFact(String) - Static method in class com.google.common.truth.Fact
Creates a fact with no value, which will be printed in the format "key" (with no colon or value).
SimpleSubjectBuilder<SubjectT extends Subject<SubjectT,ActualT>,ActualT> - Class in com.google.common.truth
In a fluent assertion chain, exposes the most common that method, which accepts a value under test and returns a Subject.
SortedMapSubject - Class in com.google.common.truth
Tests for SortedMap and NavigableMap objects.
SortedSetSubject - Class in com.google.common.truth
Tests for SortedSet and NavigableSet objects.
StandardSubjectBuilder - Class in com.google.common.truth
In a fluent assertion chain, an object with which you can do any of the following: Set an optional message with StandardSubjectBuilder.withMessage(java.lang.String).
startsWith(String) - Method in class com.google.common.truth.StringSubject
Fails if the string does not start with the given string.
StringSubject - Class in com.google.common.truth
Propositions for string subjects.
StringSubject(FailureMetadata, String) - Constructor for class com.google.common.truth.StringSubject
Constructor for use by subclasses.
StringSubject.CaseInsensitiveStringComparison - Class in com.google.common.truth
Case insensitive propositions for string subjects.
Subject<S extends Subject<S,T>,T> - Class in com.google.common.truth
An object that lets you perform checks on the value under test.
Subject(FailureMetadata, T) - Constructor for class com.google.common.truth.Subject
Constructor for use by subclasses.
Subject.Factory<SubjectT extends Subject<SubjectT,ActualT>,ActualT> - Interface in com.google.common.truth
In a fluent assertion chain, the argument to the common overload of about, the method that specifies what kind of Subject to create.

T

TableSubject - Class in com.google.common.truth
Propositions for Table subjects.
that(ActualT) - Method in class com.google.common.truth.SimpleSubjectBuilder
 
that(ComparableT) - Method in class com.google.common.truth.StandardSubjectBuilder
 
that(BigDecimal) - Method in class com.google.common.truth.StandardSubjectBuilder
 
that(Object) - Method in class com.google.common.truth.StandardSubjectBuilder
 
that(Class<?>) - Method in class com.google.common.truth.StandardSubjectBuilder
 
that(Throwable) - Method in class com.google.common.truth.StandardSubjectBuilder
 
that(Long) - Method in class com.google.common.truth.StandardSubjectBuilder
 
that(Double) - Method in class com.google.common.truth.StandardSubjectBuilder
 
that(Float) - Method in class com.google.common.truth.StandardSubjectBuilder
 
that(Integer) - Method in class com.google.common.truth.StandardSubjectBuilder
 
that(Boolean) - Method in class com.google.common.truth.StandardSubjectBuilder
 
that(String) - Method in class com.google.common.truth.StandardSubjectBuilder
 
that(Iterable<?>) - Method in class com.google.common.truth.StandardSubjectBuilder
 
that(SortedSet<?>) - Method in class com.google.common.truth.StandardSubjectBuilder
 
that(T[]) - Method in class com.google.common.truth.StandardSubjectBuilder
 
that(boolean[]) - Method in class com.google.common.truth.StandardSubjectBuilder
 
that(short[]) - Method in class com.google.common.truth.StandardSubjectBuilder
 
that(int[]) - Method in class com.google.common.truth.StandardSubjectBuilder
 
that(long[]) - Method in class com.google.common.truth.StandardSubjectBuilder
 
that(char[]) - Method in class com.google.common.truth.StandardSubjectBuilder
 
that(byte[]) - Method in class com.google.common.truth.StandardSubjectBuilder
 
that(float[]) - Method in class com.google.common.truth.StandardSubjectBuilder
 
that(double[]) - Method in class com.google.common.truth.StandardSubjectBuilder
 
that(Optional<?>) - Method in class com.google.common.truth.StandardSubjectBuilder
 
that(Map<?, ?>) - Method in class com.google.common.truth.StandardSubjectBuilder
 
that(SortedMap<?, ?>) - Method in class com.google.common.truth.StandardSubjectBuilder
 
that(Multimap<?, ?>) - Method in class com.google.common.truth.StandardSubjectBuilder
 
that(ListMultimap<?, ?>) - Method in class com.google.common.truth.StandardSubjectBuilder
 
that(SetMultimap<?, ?>) - Method in class com.google.common.truth.StandardSubjectBuilder
 
that(Multiset<?>) - Method in class com.google.common.truth.StandardSubjectBuilder
 
that(Table<?, ?, ?>) - Method in class com.google.common.truth.StandardSubjectBuilder
 
that(AtomicLongMap<?>) - Method in class com.google.common.truth.StandardSubjectBuilder
 
ThrowableSubject - Class in com.google.common.truth
Propositions for Throwable subjects.
tolerance(double) - Static method in class com.google.common.truth.Correspondence
Returns a Correspondence between Number instances that considers instances to correspond (i.e.
toString() - Method in class com.google.common.truth.Correspondence
Returns a description of the correspondence, suitable to fill the gap in a failure message of the form {@code " is an element that ...
toString() - Method in class com.google.common.truth.Fact
Returns a simple string representation for the fact.
toString() - Method in class com.google.common.truth.Subject
 
transforming(Function<A, ? extends E>, String) - Static method in class com.google.common.truth.Correspondence
Constructs a Correspondence that compares elements by transforming the actual elements using the given function and testing for equality with the expected elements.
transforming(Function<A, ?>, Function<E, ?>, String) - Static method in class com.google.common.truth.Correspondence
Constructs a Correspondence that compares elements by transforming the actual and the expected elements using the given functions and testing the transformed values for equality.
Truth - Class in com.google.common.truth
The primary entry point for Truth, a fluent framework for test assertions.
TruthFailureSubject - Class in com.google.common.truth
Subject for AssertionError objects thrown by Truth.
TruthJUnit - Class in com.google.common.truth
Provides a way to use Truth to perform JUnit "assumptions." An assumption is a check that, if false, aborts (skips) the test.

U

usingExactEquality() - Method in class com.google.common.truth.PrimitiveDoubleArraySubject
Starts a method chain for a check in which the actual values (i.e.
usingExactEquality() - Method in class com.google.common.truth.PrimitiveFloatArraySubject
Starts a method chain for a check in which the actual values (i.e.
usingTolerance(double) - Method in class com.google.common.truth.PrimitiveDoubleArraySubject
Starts a method chain for a check in which the actual values (i.e.
usingTolerance(double) - Method in class com.google.common.truth.PrimitiveFloatArraySubject
Starts a method chain for a check in which the actual values (i.e.

V

valuesForKey(Object) - Method in class com.google.common.truth.MultimapSubject
Returns a context-aware Subject for making assertions about the values for the given key within the Multimap.

W

whenTesting() - Method in class com.google.common.truth.ExpectFailure
Returns a test verb that expects the chained assertion to fail, and makes the failure available via ExpectFailure.getFailure().
withMessage(String) - Method in class com.google.common.truth.StandardSubjectBuilder
 
withMessage(String, Object...) - Method in class com.google.common.truth.StandardSubjectBuilder
Returns a new instance that will output the given message before the main failure message.
A B C D E F G H I L M N O P S T U V W 
Skip navigation links

Copyright © 2019. All rights reserved.