Skip to content

Commit

Permalink
[#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 5b37bcf commit 32f50ac
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 32f50ac

Please sign in to comment.