From 16319f486f2f75dd0302c67816589d25ee4cf621 Mon Sep 17 00:00:00 2001 From: Davide D'Alto Date: Tue, 31 Oct 2023 11:15:31 +0100 Subject: [PATCH] [#36582] Add test case to TransactionalUniAsserterTest Test that `assert.fail()` actually makes the test fails --- .../it/panache/reactive/TransactionalUniAsserterTest.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/integration-tests/hibernate-reactive-panache/src/test/java/io/quarkus/it/panache/reactive/TransactionalUniAsserterTest.java b/integration-tests/hibernate-reactive-panache/src/test/java/io/quarkus/it/panache/reactive/TransactionalUniAsserterTest.java index e04ce655b113f..e1d86c2847446 100644 --- a/integration-tests/hibernate-reactive-panache/src/test/java/io/quarkus/it/panache/reactive/TransactionalUniAsserterTest.java +++ b/integration-tests/hibernate-reactive-panache/src/test/java/io/quarkus/it/panache/reactive/TransactionalUniAsserterTest.java @@ -3,6 +3,7 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; import org.junit.jupiter.api.Test; @@ -10,6 +11,7 @@ import io.quarkus.test.hibernate.reactive.panache.TransactionalUniAsserter; import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.vertx.RunOnVertxContext; +import org.opentest4j.AssertionFailedError; @QuarkusTest public class TransactionalUniAsserterTest { @@ -30,4 +32,9 @@ public void testTransactionalUniAsserter(TransactionalUniAsserter asserter) { }); } + @Test + @RunOnVertxContext + public void testFailure(final TransactionalUniAsserter asserter) { + assertThrows(AssertionFailedError.class, asserter::fail); + } }