File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
framework-docs/modules/ROOT/pages/testing/testcontext-framework/ctx-management Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -63,13 +63,15 @@ alternative, you can set the same property via the
63
63
xref:appendix.adoc#appendix-spring-properties[`SpringProperties`] mechanism.
64
64
65
65
As of Spring Framework 7.0, an application context stored in the context cache will be
66
- stopped when it is no longer actively in use and automatically restarted the next time
66
+ _paused_ when it is no longer actively in use and automatically _restarted_ the next time
67
67
the context is retrieved from the cache. Specifically, the latter will restart all
68
68
auto-startup beans in the application context, effectively restoring the lifecycle state.
69
69
This ensures that background processes within the context are not actively running while
70
70
the context is not used by tests. For example, JMS listener containers, scheduled tasks,
71
71
and any other components in the context that implement `Lifecycle` or `SmartLifecycle`
72
- will be in a "stopped" state until the context is used again by a test.
72
+ will be in a "stopped" state until the context is used again by a test. Note, however,
73
+ that `SmartLifecycle` components can opt out of pausing by returning `false` from
74
+ `SmartLifecycle#isPauseable()`.
73
75
74
76
Since having a large number of application contexts loaded within a given test suite can
75
77
cause the suite to take an unnecessarily long time to run, it is often beneficial to
You can’t perform that action at this time.
0 commit comments