From 33af5e4bd33a45d47ef04fd575caf51fd2aa30c4 Mon Sep 17 00:00:00 2001 From: Marc Philipp Date: Tue, 22 Oct 2024 13:13:24 +0200 Subject: [PATCH] Document that assertions and exceptions take precedence over assumptions Resolves #4084. --- .../src/main/java/org/junit/jupiter/api/Assumptions.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Assumptions.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Assumptions.java index f1ade0746475..68b0b66ac62f 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Assumptions.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/Assumptions.java @@ -27,7 +27,12 @@ * *

In direct contrast to failed {@linkplain Assertions assertions}, * failed assumptions do not result in a test failure; rather, - * a failed assumption results in a test being aborted. + * a failed assumption results in a test being aborted. However, + * failed assertions and other exceptions thrown by tests take precedence over + * failed assumptions when both are thrown during the execution of a test + * (for example, by different lifecycle methods), regardless of the order they + * are thrown in. In such cases, the test will be reported as failed + * rather than aborted. * *

Assumptions are typically used whenever it does not make sense to * continue execution of a given test method — for example, if the