Skip to content

Support Assumptions.assumeThat in Quarkus #46642

@liamzwbao

Description

@liamzwbao

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();
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions