-
Notifications
You must be signed in to change notification settings - Fork 38.9k
Closed
Closed
Copy link
Labels
in: testIssues in the test moduleIssues in the test moduletype: enhancementA general enhancementA general enhancement
Milestone
Description
Status Quo
A custom TestExecutionListener can gain access to the test's ApplicationContext via TestContext#getApplicationContext(); however, there are times when a custom TestExecutionListener would like to know if the ApplicationContext is already available (i.e., has already been successfully loaded and cached) before proceeding with a particular action.
Invoking TestContext#getApplicationContext() just to see if the ApplicationContext can be loaded is not a good option, since that will eagerly load the context, potentially resulting in negative side effects.
Proposal
Introduce support in the TestContext framework that allows a TestExecutionListener to query whether the test's ApplicationContext has already been loaded.
Related Issues
Deliverables
- Introduce
boolean hasApplicationContext()in theTestContextAPI. - Introduce
boolean isContextLoaded(MergedContextConfiguration)in theCacheAwareContextLoaderDelegateAPI.
Metadata
Metadata
Assignees
Labels
in: testIssues in the test moduleIssues in the test moduletype: enhancementA general enhancementA general enhancement