Method and Description |
---|
com.google.common.truth.ComparableSubject.comparesEqualTo(T) |
com.google.common.truth.DoubleSubject.TolerantDoubleComparison.equals(Object)
Object.equals(Object) is not supported on TolerantDoubleComparison. If
you meant to compare doubles, use DoubleSubject.TolerantDoubleComparison.of(double) instead. |
com.google.common.truth.PrimitiveDoubleArraySubject.TolerantPrimitiveDoubleArrayComparison.equals(Object)
Object.equals(Object) is not supported on
TolerantPrimitiveDoubleArrayComparison. If you meant to compare double arrays, use PrimitiveDoubleArraySubject.TolerantPrimitiveDoubleArrayComparison.of(double...) or PrimitiveDoubleArraySubject.TolerantPrimitiveDoubleArrayComparison.ofElementsIn(java.lang.Iterable<? extends java.lang.Number>) instead. |
com.google.common.truth.Correspondence.equals(Object)
Object.equals(Object) is not supported. If you meant to compare objects
using this Correspondence , use Correspondence.compare(A, E) . |
com.google.common.truth.FloatSubject.TolerantFloatComparison.equals(Object)
Object.equals(Object) is not supported on TolerantFloatComparison. If you
meant to compare floats, use FloatSubject.TolerantFloatComparison.of(float) instead. |
com.google.common.truth.Subject.equals(Object)
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. |
com.google.common.truth.PrimitiveFloatArraySubject.TolerantPrimitiveFloatArrayComparison.equals(Object)
Object.equals(Object) is not supported on
TolerantPrimitiveFloatArrayComparison. If you meant to compare float arrays, use PrimitiveFloatArraySubject.TolerantPrimitiveFloatArrayComparison.of(float...) or PrimitiveFloatArraySubject.TolerantPrimitiveFloatArrayComparison.ofElementsIn(java.lang.Iterable<? extends java.lang.Number>) instead. |
com.google.common.truth.extensions.proto.MultimapWithProtoValuesFluentAssertion.equals(Object)
Do not call
equals() on a MultimapWithProtoValuesFluentAssertion . |
com.google.common.truth.extensions.proto.IterableOfProtosFluentAssertion.equals(Object)
Do not call
equals() on a IterableOfProtosFluentAssertion . |
com.google.common.truth.extensions.proto.MapWithProtoValuesFluentAssertion.equals(Object)
Do not call
equals() on a MapWithProtoValuesFluentAssertion . |
com.google.common.truth.extensions.proto.ProtoFluentAssertion.equals(Object)
Do not call
equals() on a ProtoFluentAssertion . Use ProtoFluentAssertion.isEqualTo(Object) instead. |
com.google.common.truth.Subject.fail(String)
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). |
com.google.common.truth.Subject.fail(String, Object...)
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. |
com.google.common.truth.Subject.fail(String, Object)
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). |
com.google.common.truth.Subject.failComparing(String, CharSequence, CharSequence)
Instead of manually testing whether the actual value is equal to the expected and
then calling this method, ask Truth to do both with a statement like
check("foo()").that(actual().foo()).isEqualTo(expectedFoo) . (If you are comparing the
values using a method other than Object.equals(java.lang.Object) , you'll have to wrap your actual and
expected values in a custom object that implements your desired logic in equals and
forwards the toString method.) |
com.google.common.truth.Subject.failComparing(String, CharSequence, CharSequence, Throwable)
See the other
overload of this method for instructions on how to get Truth to throw a
ComparisonFailure . To make Truth also attach the Throwable cause to the assertion
failure, see the instructions on Subject.failWithRawMessageAndCause(java.lang.String, java.lang.Throwable) . |
com.google.common.truth.Subject.failWithBadResults(String, Object, String, Object)
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. |
com.google.common.truth.Subject.failWithCustomSubject(String, Object, Object)
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. |
com.google.common.truth.Subject.failWithoutActual(String)
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). |
com.google.common.truth.Subject.failWithoutSubject(String)
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. |
com.google.common.truth.Subject.failWithRawMessage(String, Object...)
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. |
com.google.common.truth.Subject.failWithRawMessageAndCause(String, Throwable)
Pass the message to
Subject.failWithRawMessage(java.lang.String, java.lang.Object...) , but also, to make Truth attach the
Throwable cause to the assertion failure, ensure that cause appears in the
assertion chain. This should typically already be the case, as in assertThat(throwable).hasMessageThat().isEqualTo("message") . If it is not, you will need
to introduce an extra check call into your chain, something like check().about(unexpectedFailures()).that(cause).wasASuccess(message) , with unexpectedFailures() returning a factory for a "dummy" subject type that defines only a
wasASuccess method that fails unconditionally. |
com.google.common.truth.Subject.getSubject()
Prefer
#actual() for direct access to the subject. |
com.google.common.truth.DoubleSubject.TolerantDoubleComparison.hashCode()
Object.hashCode() is not supported on TolerantDoubleComparison |
com.google.common.truth.PrimitiveDoubleArraySubject.TolerantPrimitiveDoubleArrayComparison.hashCode()
Object.hashCode() is not supported on
TolerantPrimitiveDoubleArrayComparison |
com.google.common.truth.Correspondence.hashCode()
Object.hashCode() is not supported. |
com.google.common.truth.FloatSubject.TolerantFloatComparison.hashCode()
Object.hashCode() is not supported on TolerantFloatComparison |
com.google.common.truth.Subject.hashCode()
Object.hashCode() is not supported on Truth subjects. |
com.google.common.truth.PrimitiveFloatArraySubject.TolerantPrimitiveFloatArrayComparison.hashCode()
Object.hashCode() is not supported on
TolerantPrimitiveFloatArrayComparison |
com.google.common.truth.extensions.proto.MultimapWithProtoValuesFluentAssertion.hashCode()
MultimapWithProtoValuesFluentAssertion does not support hashCode() . |
com.google.common.truth.extensions.proto.IterableOfProtosFluentAssertion.hashCode()
IterableOfProtosFluentAssertion does not support hashCode() . |
com.google.common.truth.extensions.proto.MapWithProtoValuesFluentAssertion.hashCode()
MapWithProtoValuesFluentAssertion does not support hashCode() . |
com.google.common.truth.extensions.proto.ProtoFluentAssertion.hashCode()
ProtoFluentAssertion does not support hashCode() . Use ProtoFluentAssertion.isEqualTo(Object) for testing. |
com.google.common.truth.ThrowableSubject.hasMessage(String)
Use
hasMessageThat().isEqualTo(expected) instead. You may also consider
using inexact matching of the message (e.g. hasMessageThat().contains(substring) )
for less brittle tests. |
com.google.common.truth.PrimitiveDoubleArraySubject.hasValuesNotWithin(double)
Write a for loop over the values looking for mismatches (see this implementation
for an example)
|
com.google.common.truth.PrimitiveFloatArraySubject.hasValuesNotWithin(float)
Write a for loop over the values looking for mismatches (see this implementation
for an example)
|
com.google.common.truth.PrimitiveDoubleArraySubject.hasValuesWithin(double)
Use
PrimitiveDoubleArraySubject.usingTolerance(double) , e.g. assertThat(doubleArray).usingTolerance(1e-5).containsExactly(1.2, 3.4, 5.6).inOrder(); |
com.google.common.truth.PrimitiveFloatArraySubject.hasValuesWithin(float)
Use
PrimitiveFloatArraySubject.usingTolerance(double) , e.g. assertThat(floatArray).usingTolerance(1e-5).containsExactly(1.2f, 3.4f, 5.6f).inOrder(); |
com.google.common.truth.SetMultimapSubject.isEqualTo(ListMultimap<?, ?>)
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. |
com.google.common.truth.extensions.proto.SetMultimapWithProtoValuesSubject.isEqualTo(ListMultimap<?, ?>)
#isEqualTo 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. |
com.google.common.truth.extensions.proto.LiteProtoSubject.isEqualTo(MessageLite.Builder)
A Builder can never compare equal to a MessageLite instance. Use
build() ,
or buildPartial() on the argument to get a MessageLite for comparison instead. |
com.google.common.truth.AtomicLongMapSubject.isEqualTo(Object)
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)). |
com.google.common.truth.ListMultimapSubject.isEqualTo(SetMultimap<?, ?>)
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. |
com.google.common.truth.extensions.proto.ListMultimapWithProtoValuesSubject.isEqualTo(SetMultimap<?, ?>)
#isEqualTo A SetMultimap can never compare equal with a ListMultimap if
either Multimap is non-empty, because Set and List can never compare equal.
Prefer MultimapWithProtoValuesSubject.containsExactlyEntriesIn(
com.google.common.collect.Multimap) instead. Consult Multimap.equals(java.lang.Object) for more information. |
com.google.common.truth.DoubleSubject.isEquivalentAccordingToCompareTo(Double)
Use
DoubleSubject.isWithin(double) or DoubleSubject.isEqualTo(java.lang.Double) instead (see documentation for advice). |
com.google.common.truth.FloatSubject.isEquivalentAccordingToCompareTo(Float)
Use
FloatSubject.isWithin(float) or FloatSubject.isEqualTo(java.lang.Float) instead (see documentation for advice). |
com.google.common.truth.IntegerSubject.isEquivalentAccordingToCompareTo(Integer)
Use
Subject.isEqualTo(java.lang.Object) instead. Integer comparison is consistent with equality. |
com.google.common.truth.LongSubject.isEquivalentAccordingToCompareTo(Long)
Use
Subject.isEqualTo(java.lang.Object) instead. Long comparison is consistent with equality. |
com.google.common.truth.StringSubject.isEquivalentAccordingToCompareTo(String)
Use
Subject.isEqualTo(java.lang.Object) instead. String comparison is consistent with equality. |
com.google.common.truth.IterableSubject.isNoneOf(Object, Object, Object...)
You probably meant to call
IterableSubject.containsNoneOf(java.lang.Object, java.lang.Object, java.lang.Object...) instead. |
com.google.common.truth.extensions.proto.LiteProtoSubject.isNotEqualTo(MessageLite.Builder)
A Builder will never compare equal to a MessageLite instance. Use
build() ,
or buildPartial() on the argument to get a MessageLite for comparison instead. |
com.google.common.truth.AtomicLongMapSubject.isNotEqualTo(Object)
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)). |
com.google.common.truth.IterableSubject.isNotIn(Iterable<?>)
You probably meant to call
IterableSubject.containsNoneIn(java.lang.Iterable<?>) instead. |
Copyright © 2018. All rights reserved.