public final class OptionalSubject extends Subject<OptionalSubject,Optional<?>>
Optional subjects.failureStrategy| Modifier and Type | Method and Description | 
|---|---|
void | 
hasValue(Object expected)
Fails if the  
Optional<T> does not have the given value or the subject is null. | 
void | 
isEmpty()
Fails if the  
Optional<T> is present or the subject is null. | 
void | 
isPresent()
Fails if the  
Optional<T> is empty or the subject is null. | 
static SubjectFactory<OptionalSubject,Optional<?>> | 
optionals()  | 
actual, actualAsString, actualCustomStringRepresentation, check, equals, fail, fail, fail, failWithBadResults, failWithCustomSubject, failWithoutActual, failWithoutSubject, failWithRawMessage, getDisplaySubject, getSubject, hashCode, ignoreCheck, internalCustomName, isAnyOf, isEqualTo, isIn, isInstanceOf, isNoneOf, isNotEqualTo, isNotIn, isNotInstanceOf, isNotNull, isNotSameAs, isNull, isSameAs, namedpublic void isPresent()
Optional<T> is empty or the subject is null.public void isEmpty()
Optional<T> is present or the subject is null.public void hasValue(Object expected)
Optional<T> does not have the given value or the subject is null.
 To make more complex assertions on the optional's value split your assertion in two:
 assertThat(myOptional).isPresent();
 assertThat(myOptional.get()).contains("foo");
 public static SubjectFactory<OptionalSubject,Optional<?>> optionals()
Copyright © 2017. All rights reserved.