Top Fields Constructors Methods
org.assertj.core.api

public Class WithThrowable

extends Object
Class Inheritance
Imports
org.assertj.core.util.CheckReturnValue

Field Summary

Modifier and TypeField and Description
private final Throwable

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public ThrowableAssertAlternative<?>

Returns:

a ThrowableAssertAlternative built with underlying throwable.
withThrowableOfType
(Class<? extends Throwable>
the expected Throwable type
type
)

Checks that the underlying throwable is of the given type and returns a ThrowableAssertAlternative to chain further assertions on the underlying throwable.

public ThrowableAssertAlternative<?>

Returns:

a ThrowableAssertAlternative built with underlying throwable.
withThrowableThat
()

Returns a ThrowableAssertAlternative to chain assertions on the underlying throwable.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

throwableback to summary
private final Throwable throwable

Constructor Detail

WithThrowableback to summary
pack-priv WithThrowable(Throwable exception)

Method Detail

withThrowableOfTypeback to summary
public ThrowableAssertAlternative<?> withThrowableOfType(Class<? extends Throwable> type)

Checks that the underlying throwable is of the given type and returns a ThrowableAssertAlternative to chain further assertions on the underlying throwable.

Equivalent to withThrowableThat().isInstanceOf(type)

Parameters
type:Class<? extends Throwable>

the expected Throwable type

Returns:ThrowableAssertAlternative<?>

a ThrowableAssertAlternative built with underlying throwable.

withThrowableThatback to summary
public ThrowableAssertAlternative<?> withThrowableThat()

Returns a ThrowableAssertAlternative to chain assertions on the underlying throwable.

Returns:ThrowableAssertAlternative<?>

a ThrowableAssertAlternative built with underlying throwable.

Annotations
@CheckReturnValue