-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
Description
Description
Currently, AssertJ's Assumptions (e.g., org.assertj.core.api.Assumptions.assumeThat) do not work as expected within Quarkus tests. Unlike JUnit’s Assumptions.assumeTrue, which properly skips tests when the assumption fails, AssertJ’s assumption throws an exception instead of skipping the test.
Expected Behavior
- When using
org.assertj.core.api.Assumptions.assumeThat(condition).isTrue(), the test should be skipped rather than failing with an exception.
Actual Behavior
- The test fails with an exception instead of being skipped.
Example
import io.quarkus.test.junit.QuarkusTest;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.Test;
@QuarkusTest
class QuarkusAssertJTest {
private boolean supportFeature() {
return false;
}
@Test
void testQuarkusJunitAssumptions() {
// Will skip
Assumptions.assumeTrue(supportFeature());
}
@Test
void testQuarkusAssertJAssumptions() {
// Will throw exception
org.assertj.core.api.Assumptions.assumeThat(supportFeature()).isTrue();
}
}