doc / ch.tutteli.atrium.api.fluent.en_GB.jdk8 / isPresent

isPresent

fun <E, T : Optional<E>> Expect<T>.isPresent(): Expect<E>
Deprecated: Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0

Expects that the subject of the assertion (an Optional) is present and returns an Expect for the inner type E.

Shortcut for more or less something like feature(Optional<T>::get) but with error handling; yet it depends on the underlying implementation though.

Exceptions

AssertionError - Might throw an AssertionError if the given assertion is not a success.

Return
The newly created Expect for the inner type E.

Since
0.9.0

fun <E, T : Optional<E>> Expect<T>.isPresent(assertionCreator: Expect<E>.() -> Unit): Expect<T>
Deprecated: Use the function from the normal jvm module; the jdk8 extension will be removed with 1.0.0

Expects that the subject of the assertion (an Optional) is present and that it holds all assertions the given assertionCreator creates.

Exceptions

AssertionError - Might throw an AssertionError if the given assertions are not success.

Return
An Expect for the current subject of the assertion.

Since
0.9.0