Skip to content

Commit

Permalink
[quarkusio#36582] Add test case to TransactionalUniAsserterTest
Browse files Browse the repository at this point in the history
Test that `assert.fail()` actually makes the test fails
  • Loading branch information
DavideD committed Oct 31, 2023
1 parent d2c837a commit a74217f
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
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;

import io.quarkus.hibernate.reactive.panache.Panache;
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 {
Expand All @@ -30,4 +32,9 @@ public void testTransactionalUniAsserter(TransactionalUniAsserter asserter) {
});
}

@Test
@RunOnVertxContext
public void testFailure(final TransactionalUniAsserter asserter) {
assertThrows(AssertionFailedError.class, asserter::fail);
}
}

0 comments on commit a74217f

Please sign in to comment.