Use a safe pattern to check for exception in tests

Description

We have this pattern in several places in the code, in particular when we cannot use @Test.expected or the ExpectedException rule:

Unfortunately, this pattern is very error-prone, as it's very easy to forget the Assert.fail call. And we did forget it in several places (though not all...).

Let's find a better way to achieve this, once that is more error-proof.

Environment

None

Status

Assignee

Yoann Rodière

Reporter

Yoann Rodière

Labels

None

Suitable for new contributors

None

Feedback Requested

None

Components

Fix versions

Priority

Major
Configure