Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw exception with meaningful message if JUnit 4.9+ not present [SPR-13521] #18098

spring-projects-issues opened this issue Sep 28, 2015 · 1 comment
in: test type: enhancement


Copy link

@spring-projects-issues spring-projects-issues commented Sep 28, 2015

Sam Brannen opened SPR-13521 and commented

Status Quo

Spring Framework 4.1 raised the minimum JUnit version to 4.9 in the Spring TestContext Framework. At that time a check was added to SpringJUnit4ClassRunner to ensure that the withRules() method in BlockJUnit4ClassRunner is present. However, this is not a robust solution since the withRules() method exists since JUnit 4.7, and this has led to confusion in the community. See the linked discussion on Stack Overflow for details.


In SpringJUnit4ClassRunner, SpringClassRule, and SpringMethodRule:

  1. Log an exception if org.junit.runners.model.MultipleFailureException is not present.

Affects: 4.1 GA

Reference URL:

Referenced from: commits d883efc

Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Sep 28, 2015

Sam Brannen commented

Completed in GitHub commit d883efc:

Throw meaningful exception if JUnit 4.9 is not present

SpringJUnit4ClassRunner, SpringClassRule, and SpringMethodRule now throw an IllegalStateException with a meaningful message if JUnit 4.9 is not present in the classpath (specifically if org.junit.runners.model.MultipleFailureException cannot be loaded).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
in: test type: enhancement
None yet

No branches or pull requests

2 participants