Skip to content

Introduce support for disabling JUnit Jupiter tests with SpEL expressions [SPR-14614] #19181

Closed
@spring-projects-issues

Description

@spring-projects-issues

Tadaya Tsuyukubo opened SPR-14614 and commented

Status Quo

The JUnit Jupiter API in JUnit 5 currently provides @Disabled to disable tests; however, disabling of tests via this annotation is determined at compile time. Thus it's not flexible.

Another option is to use Assumptions within test methods, but it may not so intuitive since the logic resides in the method. Furthermore, the use of assumptions is not very reusable.

Proposal

For JUnit Jupiter and the Spring TestContext Framework, using SpEL expressions would provide a dynamic means for disabling tests.

Suggested API:

@DisabledIf("SpEL expression here")

Related Resources


Issue Links:

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions