Skip to content

Introduce support for JUnit 5 in the TestContext framework [SPR-13575] #18151

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

Closed
16 tasks done
spring-projects-issues opened this issue Oct 15, 2015 · 3 comments
Closed
16 tasks done
Assignees
Labels
in: test Issues in the test module type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Oct 15, 2015

Juergen Hoeller opened SPR-13575 and commented

Work in Progress

The current work for supporting JUnit 5 in the Spring TestContext Framework can be seen in the spring-test-junit5 repository.

Feedback is Welcome

Developers are encouraged to try out the SpringExtension and provide feedback!

Deliverables

  1. Introduce a SpringExtension to be configured via @ExtendWith(SpringExtension.class) (analogous to @RunWith(SpringRunner.class) for JUnit 4)
  2. Implement ParameterResolver
  3. Implement BeforeAllCallback
  4. Implement AfterAllCallback
  5. Implement TestInstancePostProcessor
  6. Implement BeforeEachCallback
  7. Implement AfterEachCallback
  8. Implement BeforeTestExecutionCallback and AfterTestExecutionCallback
  9. Delete custom MethodParameterFactory
  10. Migrate to ExecutionContext.Store
  11. Provide the test exception to TestContextManager.afterTestMethod()

Reference URL: https://github.com/junit-team/junit5

Issue Links:

Referenced from: commits ecbec54, 862fb2a, 9a9551b, 7e783dd, 873fc53

2 votes, 9 watchers

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Mar 15, 2016

Sam Brannen commented

This issue depends on #9043, #18627, #18628, #18629, and #18630.

@spring-projects-issues
Copy link
Collaborator Author

Sam Brannen commented

I have now integrated the code from my personal spring-test-junit5 repository into master in GitHub commit 873fc53:

Introduce support for JUnit 5 in the TestContext framework

This commit introduces initial support for JUnit Jupiter (i.e., the new
programming and extension models in JUnit 5) in the Spring TestContext
Framework.

Specifically, this commit introduces the following.

  • SpringExtension: an implementation of multiple extension APIs from JUnit Jupiter that provides full support for the existing feature set of the Spring TestContext Framework. This support is enabled via @ExtendWith(SpringExtension.class).

  • @SpringJUnitConfig: a composed annotation that combines @ExtendWith(SpringExtension.class) from JUnit Jupiter with @ContextConfiguration from the Spring TestContext Framework.

  • @SpringJUnitWebConfig: a composed annotation that combines @ExtendWith(SpringExtension.class) from JUnit Jupiter with @ContextConfiguration and @WebAppConfiguration from the Spring TestContext Framework.

@spring-projects-issues
Copy link
Collaborator Author

Sam Brannen commented

Resolving this issue as Complete since all core features have been merged into master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: test Issues in the test module type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants