Skip to content

Deprecate hasCauseReference(Throwable) from Throwable assertions #3715

@scordio

Description

@scordio

hasCauseReference() has been introduced in 3.13 (#1443) to support reference comparison.

However, 3.20 introduced cause(), which allows for more flexible assertions, including reference comparison.

Given that the following:

assertThat(exception).hasCauseReference(expected);

can be rewritten as:

assertThat(exception).cause().isSameAs(expected);

we should deprecate hasCauseReference() as it's too specific.

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions