Class OptionalLongSubject
java.lang.Object
com.google.common.truth.Subject
com.google.common.truth.OptionalLongSubject
A subject for
OptionalLong values.- Since:
- 1.3.0 (previously part of
truth-java8-extension)
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.common.truth.Subject
Subject.Factory<SubjectT extends Subject, ActualT> -
Method Summary
Modifier and TypeMethodDescriptionvoidhasValue(long expected) Checks that the actualOptionalLongcontains the given value.voidisEmpty()Checks that the actualOptionalLongdoes not contain a value.voidChecks that the actualOptionalLongcontains a value.Deprecated.Methods inherited from class com.google.common.truth.Subject
actualCustomStringRepresentation, check, equals, failWithActual, failWithActual, failWithoutActual, hashCode, ignoreCheck, isAnyOf, isEqualTo, isIn, isInstanceOf, isNoneOf, isNotEqualTo, isNotIn, isNotInstanceOf, isNotNull, isNotSameInstanceAs, isNull, isSameInstanceAs, toString
-
Method Details
-
isPresent
public void isPresent()Checks that the actualOptionalLongcontains a value. -
isEmpty
public void isEmpty()Checks that the actualOptionalLongdoes not contain a value. -
hasValue
public void hasValue(long expected) Checks that the actualOptionalLongcontains the given value. More sophisticated comparisons can be done usingassertThat(optional.getAsLong())…. -
optionalLongs
Deprecated.Instead ofabout(optionalLongs()).that(...), use justthat(...). Similarly, instead ofassertAbout(optionalLongs()).that(...), use justassertThat(...).Obsolete factory instance. This factory was previously necessary for assertions likeassertWithMessage(...).about(optionalLongs()).that(optional)..... Now, you can perform assertions like that without theabout(...)call.
-
about(optionalLongs()).that(...), use justthat(...).