Package com.google.common.truth
Class OptionalLongSubject
java.lang.Object
com.google.common.truth.Subject
com.google.common.truth.OptionalLongSubject
Propositions for Java 8
OptionalLong subjects.-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.common.truth.Subject
Subject.EqualityCheck, Subject.Factory<SubjectT extends Subject,ActualT> -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionOptionalLongSubject(FailureMetadata failureMetadata, OptionalLong subject, String typeDescription) -
Method Summary
Modifier and TypeMethodDescriptionvoidhasValue(long expected) Fails if theOptionalLongdoes not have the given value or the subject is null.voidisEmpty()Fails if theOptionalLongis present or the subject is null.voidFails if theOptionalLongis empty or the subject is null.Methods inherited from class com.google.common.truth.Subject
actual, actualCustomStringRepresentation, actualCustomStringRepresentationForPackageMembersToCall, butWas, check, check, checkNoNeedToDisplayBothValues, equals, fail, fail, fail, failEqualityCheckForEqualsWithoutDescription, failWithActual, failWithActual, failWithActual, failWithActual, failWithBadResults, failWithCustomSubject, failWithoutActual, failWithoutActual, failWithoutActual, failWithoutActual, failWithoutSubject, hashCode, ignoreCheck, isAnyOf, isEqualTo, isIn, isInstanceOf, isNoneOf, isNotEqualTo, isNotIn, isNotInstanceOf, isNotNull, isNotSameInstanceAs, isNull, isSameInstanceAs, toString, typeDescription
-
Field Details
-
actual
-
-
Constructor Details
-
OptionalLongSubject
OptionalLongSubject(FailureMetadata failureMetadata, OptionalLong subject, String typeDescription)
-
-
Method Details
-
isPresent
public void isPresent()Fails if theOptionalLongis empty or the subject is null. -
isEmpty
public void isEmpty()Fails if theOptionalLongis present or the subject is null. -
hasValue
public void hasValue(long expected) Fails if theOptionalLongdoes not have the given value or the subject is null. More sophisticated comparisons can be done usingassertThat(optional.getAsLong())…. -
optionalLongs
-