| Package | Description |
|---|---|
| org.assertj.core.api |
| Modifier and Type | Class and Description |
|---|---|
class |
AbstractThrowableAssert<SELF extends AbstractThrowableAssert<SELF,ACTUAL>,ACTUAL extends Throwable>
Base class for all implementations of assertions for
Throwables. |
| Modifier and Type | Class and Description |
|---|---|
class |
ThrowableAssert<ACTUAL extends Throwable>
Assertion methods for
Throwables. |
| Modifier and Type | Field and Description |
|---|---|
static InstanceOfAssertFactory<Throwable,AbstractThrowableAssert<?,Throwable>> |
InstanceOfAssertFactories.THROWABLE
InstanceOfAssertFactory for a Throwable. |
| Modifier and Type | Method and Description |
|---|---|
default <T extends Throwable> |
WithAssertions.assertThat(T actual)
Creates a new instance of
. |
static <T extends Throwable> |
Java6Assertions.assertThat(T actual)
Deprecated.
Creates a new instance of
. |
static <T extends Throwable> |
AssertionsForClassTypes.assertThat(T actual)
Creates a new instance of
. |
static <T extends Throwable> |
Assertions.assertThat(T actual)
Creates a new instance of
. |
default AbstractThrowableAssert<?,? extends Throwable> |
WithAssertions.assertThatCode(ThrowableAssert.ThrowingCallable shouldRaiseOrNotThrowable)
Allows to capture and then assert on a
Throwable more easily when used with Java 8 lambdas. |
default AbstractThrowableAssert<?,? extends Throwable> |
Java6StandardSoftAssertionsProvider.assertThatCode(ThrowableAssert.ThrowingCallable shouldRaiseOrNotThrowable)
Allows to capture and then assert on a
Throwable more easily when used with Java 8 lambdas. |
static AbstractThrowableAssert<?,? extends Throwable> |
Java6Assertions.assertThatCode(ThrowableAssert.ThrowingCallable shouldRaiseOrNotThrowable)
Deprecated.
Allows to capture and then assert on a
Throwable. |
static AbstractThrowableAssert<?,? extends Throwable> |
AssertionsForClassTypes.assertThatCode(ThrowableAssert.ThrowingCallable shouldRaiseOrNotThrowable)
Allows to capture and then assert on a
Throwable more easily when used with Java 8 lambdas. |
static AbstractThrowableAssert<?,? extends Throwable> |
Assertions.assertThatCode(ThrowableAssert.ThrowingCallable shouldRaiseOrNotThrowable)
Allows to capture and then assert on a
Throwable (easier done with lambdas). |
default AbstractThrowableAssert<?,? extends Throwable> |
WithAssertions.assertThatThrownBy(ThrowableAssert.ThrowingCallable shouldRaiseThrowable)
Allows to capture and then assert on a
Throwable (easier done with lambdas). |
default AbstractThrowableAssert<?,? extends Throwable> |
Java6StandardSoftAssertionsProvider.assertThatThrownBy(ThrowableAssert.ThrowingCallable shouldRaiseThrowable)
Allows to capture and then assert on a
Throwable more easily when used with Java 8 lambdas. |
static AbstractThrowableAssert<?,? extends Throwable> |
Java6Assertions.assertThatThrownBy(ThrowableAssert.ThrowingCallable shouldRaiseThrowable)
Deprecated.
Allows to capture and then assert on a
Throwable more easily when used with Java 8 lambdas. |
static AbstractThrowableAssert<?,? extends Throwable> |
AssertionsForClassTypes.assertThatThrownBy(ThrowableAssert.ThrowingCallable shouldRaiseThrowable)
Allows to capture and then assert on a
Throwable (easier done with lambdas). |
static AbstractThrowableAssert<?,? extends Throwable> |
Assertions.assertThatThrownBy(ThrowableAssert.ThrowingCallable shouldRaiseThrowable)
Allows to capture and then assert on a
Throwable (easier done with lambdas). |
default AbstractThrowableAssert<?,? extends Throwable> |
WithAssertions.assertThatThrownBy(ThrowableAssert.ThrowingCallable shouldRaiseThrowable,
String description,
Object... args)
Allows to capture and then assert on a
Throwable like assertThatThrownBy(ThrowingCallable) but this method
let you set the assertion description the same way you do with as(String, Object...). |
default AbstractThrowableAssert<?,? extends Throwable> |
Java6StandardSoftAssertionsProvider.assertThatThrownBy(ThrowableAssert.ThrowingCallable shouldRaiseThrowable,
String description,
Object... args)
Allows to capture and then assert on a
Throwable like assertThatThrownBy(ThrowingCallable) but this method
let you set the assertion description the same way you do with as(String, Object...). |
static AbstractThrowableAssert<?,? extends Throwable> |
Java6Assertions.assertThatThrownBy(ThrowableAssert.ThrowingCallable shouldRaiseThrowable,
String description,
Object... args)
Deprecated.
Allows to capture and then assert on a
Throwable like assertThatThrownBy(ThrowingCallable) but this method
let you set the assertion description the same way you do with as(String, Object...). |
static AbstractThrowableAssert<?,? extends Throwable> |
AssertionsForClassTypes.assertThatThrownBy(ThrowableAssert.ThrowingCallable shouldRaiseThrowable,
String description,
Object... args)
Allows to capture and then assert on a
Throwable like assertThatThrownBy(ThrowingCallable) but this method
let you set the assertion description the same way you do with as(String, Object...). |
static AbstractThrowableAssert<?,? extends Throwable> |
Assertions.assertThatThrownBy(ThrowableAssert.ThrowingCallable shouldRaiseThrowable,
String description,
Object... args)
Allows to capture and then assert on a
Throwable like assertThatThrownBy(ThrowingCallable) but this method
let you set the assertion description the same way you do with as(String, Object...). |
default <T extends Throwable> |
WithAssumptions.assumeThat(T actual)
Creates a new instance of
assumption. |
static <T extends Throwable> |
Assumptions.assumeThat(T actual)
Creates a new instance of
assumption. |
default AbstractThrowableAssert<?,? extends Throwable> |
WithAssumptions.assumeThatCode(ThrowableAssert.ThrowingCallable shouldRaiseOrNotThrowable)
Allows to capture and then assume on a
Throwable (easier done with lambdas). |
static AbstractThrowableAssert<?,? extends Throwable> |
Assumptions.assumeThatCode(ThrowableAssert.ThrowingCallable shouldRaiseOrNotThrowable)
Allows to capture and then assume on a
Throwable (easier done with lambdas). |
default AbstractThrowableAssert<?,? extends Throwable> |
WithAssumptions.assumeThatThrownBy(ThrowableAssert.ThrowingCallable shouldRaiseThrowable)
Allows to capture and then assume on a
Throwable (easier done with lambdas). |
static AbstractThrowableAssert<?,? extends Throwable> |
Assumptions.assumeThatThrownBy(ThrowableAssert.ThrowingCallable shouldRaiseThrowable)
Allows to capture and then assume on a
Throwable (easier done with lambdas). |
AbstractThrowableAssert<?,?> |
AbstractThrowableAssert.cause()
Returns a new assertion object that uses the cause of the current Throwable as the actual Throwable under test.
|
AbstractThrowableAssert<?,?> |
AbstractThrowableAssert.getCause()
Deprecated.
use
cause() instead.
Returns a new assertion object that uses the cause of the current Throwable as the actual Throwable under test. Examples: |
AbstractThrowableAssert<?,?> |
AbstractThrowableAssert.getRootCause()
Deprecated.
use
rootCause() instead.
Returns a new assertion object that uses the root cause of the current Throwable as the actual Throwable under test. Examples: |
static <T extends Throwable> |
BDDAssumptions.given(T actual)
Creates a new assumption's instance for a
Throwable value. |
static AbstractThrowableAssert<?,? extends Throwable> |
BDDAssumptions.givenCode(ThrowableAssert.ThrowingCallable lambda)
Creates a new assumption's instance from a no parameters lambda expression,
() -> { /* some code */ }. |
AbstractThrowableAssert<?,? extends Throwable> |
AbstractCompletableFutureAssert.hasFailedWithThrowableThat()
Deprecated.
Although not 100% the same, consider using
This assertion is deprecated because it relies on AbstractCompletableFutureAssert.hasFailed() semantics which we want to move away from (they
are not clear!) and to use failure semantics corresponding to CompletableFuture.get() failing.
Original javadoc
Verifies that the Assertion will pass :
Assertion will fail :
|
AbstractThrowableAssert<?,?> |
AbstractThrowableAssert.rootCause()
Returns a new assertion object that uses the root cause of the current Throwable as the actual Throwable under test.
|
static <T extends Throwable> |
Java6BDDAssertions.then(T actual)
Deprecated.
Creates a new instance of
. |
static <T extends Throwable> |
BDDAssertions.then(T actual)
Creates a new instance of
. |
default AbstractThrowableAssert<?,? extends Throwable> |
Java6BDDSoftAssertionsProvider.thenCode(ThrowableAssert.ThrowingCallable shouldRaiseOrNotThrowable)
Allows to capture and then assert on a
Throwable more easily when used with Java 8 lambdas. |
AbstractThrowableAssert<?,? extends Throwable> |
Java6BDDAssertions.thenCode(ThrowableAssert.ThrowingCallable shouldRaiseOrNotThrowable)
Deprecated.
Allows to capture and then assert on a
Throwable more easily when used with Java 8 lambdas. |
static AbstractThrowableAssert<?,? extends Throwable> |
BDDAssertions.thenCode(ThrowableAssert.ThrowingCallable shouldRaiseOrNotThrowable)
Allows to capture and then assert on a
Throwable more easily when used with Java 8 lambdas. |
default AbstractThrowableAssert<?,? extends Throwable> |
Java6BDDSoftAssertionsProvider.thenThrownBy(ThrowableAssert.ThrowingCallable shouldRaiseThrowable)
Allows to capture and then assert on a
Throwable more easily when used with Java 8 lambdas. |
static AbstractThrowableAssert<?,? extends Throwable> |
Java6BDDAssertions.thenThrownBy(ThrowableAssert.ThrowingCallable shouldRaiseThrowable)
Deprecated.
Allows to capture and then assert on a
Throwable more easily when used with Java 8 lambdas. |
static AbstractThrowableAssert<?,? extends Throwable> |
BDDAssertions.thenThrownBy(ThrowableAssert.ThrowingCallable shouldRaiseThrowable)
Allows to capture and then assert on a
Throwable (easier done with lambdas). |
default AbstractThrowableAssert<?,? extends Throwable> |
Java6BDDSoftAssertionsProvider.thenThrownBy(ThrowableAssert.ThrowingCallable shouldRaiseThrowable,
String description,
Object... args)
Allows to capture and then assert on a
Throwable like thenThrownBy(ThrowingCallable) but this method
let you set the assertion description the same way you do with as(String, Object...). |
static AbstractThrowableAssert<?,? extends Throwable> |
Java6BDDAssertions.thenThrownBy(ThrowableAssert.ThrowingCallable shouldRaiseThrowable,
String description,
Object... args)
Deprecated.
Allows to capture and then assert on a
Throwable like thenThrownBy(ThrowingCallable) but this method
let you set the assertion description the same way you do with as(String, Object...). |
static AbstractThrowableAssert<?,? extends Throwable> |
BDDAssertions.thenThrownBy(ThrowableAssert.ThrowingCallable shouldRaiseThrowable,
String description,
Object... args)
Allows to capture and then assert on a
Throwable like thenThrownBy(ThrowingCallable) but this method
let you set the assertion description the same way you do with as(String, Object...). |
| Modifier and Type | Method and Description |
|---|---|
static <T extends Throwable> |
InstanceOfAssertFactories.throwable(Class<T> type)
InstanceOfAssertFactory for a Throwable. |
Copyright © 2025. All rights reserved.