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
6363xref:appendix.adoc#appendix-spring-properties[`SpringProperties`] mechanism.
6464
6565As 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
6767the context is retrieved from the cache. Specifically, the latter will restart all
6868auto-startup beans in the application context, effectively restoring the lifecycle state.
6969This ensures that background processes within the context are not actively running while
7070the context is not used by tests. For example, JMS listener containers, scheduled tasks,
7171and 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()`.
7375
7476Since having a large number of application contexts loaded within a given test suite can
7577cause 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