Class CheckedProviderSubject<T,P extends CheckedProvider<T>>
- java.lang.Object
-
- com.google.common.truth.Subject
-
- com.google.inject.testing.throwingproviders.CheckedProviderSubject<T,P>
-
public final class CheckedProviderSubject<T,P extends CheckedProvider<T>> extends com.google.common.truth.Subject
TruthSubject
for use withCheckedProvider
classes.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.common.truth.Subject
com.google.common.truth.Subject.Factory<SubjectT extends com.google.common.truth.Subject,ActualT extends Object>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T,P extends CheckedProvider<T>>
CheckedProviderSubject<T,P>assertThat(P provider)
static <T,P extends CheckedProvider<T>>
com.google.common.truth.Subject.Factory<CheckedProviderSubject<T,P>,P>checkedProviders()
com.google.common.truth.Subject
providedValue()
Allows for assertions on the value provided by this provider.com.google.common.truth.ThrowableSubject
thrownException()
Allows for assertions on the exception thrown by this provider.-
Methods inherited from class com.google.common.truth.Subject
actual, actualAsString, actualCustomStringRepresentation, check, equals, failWithActual, failWithActual, failWithoutActual, getSubject, hashCode, ignoreCheck, internalCustomName, isAnyOf, isEqualTo, isIn, isInstanceOf, isNoneOf, isNotEqualTo, isNotIn, isNotInstanceOf, isNotNull, isNotSameInstanceAs, isNull, isSameInstanceAs, named, toString
-
-
-
-
Method Detail
-
checkedProviders
public static <T,P extends CheckedProvider<T>> com.google.common.truth.Subject.Factory<CheckedProviderSubject<T,P>,P> checkedProviders()
-
assertThat
public static <T,P extends CheckedProvider<T>> CheckedProviderSubject<T,P> assertThat(@Nullable P provider)
-
providedValue
public com.google.common.truth.Subject providedValue()
Allows for assertions on the value provided by this provider.The value provided by a checked provider is the object returned by a call to
CheckedProvider.get()
- Returns:
- a
Subject
for asserting against the return value ofCheckedProvider.get()
-
thrownException
public com.google.common.truth.ThrowableSubject thrownException()
Allows for assertions on the exception thrown by this provider.The exception thrown by a checked provider is the
Throwable
thrown by a call toCheckedProvider.get()
- Returns:
- a
ThrowableSubject
for asserting against theThrowable
thrown byCheckedProvider.get()
-
-