mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-22 05:49:04 +00:00
Lazily start resources on demand (if necessary outside of lifecycle)
See gh-32945
This commit is contained in:
+18
@@ -261,4 +261,22 @@ class ReactorResourceFactoryTests {
|
||||
assertThat(resourceFactory.isRunning()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
void lazilyStartOnConnectionProviderAccess() {
|
||||
assertThat(this.resourceFactory.isRunning()).isFalse();
|
||||
this.resourceFactory.getConnectionProvider();
|
||||
assertThat(this.resourceFactory.isRunning()).isTrue();
|
||||
this.resourceFactory.stop();
|
||||
assertThat(this.resourceFactory.isRunning()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
void lazilyStartOnLoopResourcesAccess() {
|
||||
assertThat(this.resourceFactory.isRunning()).isFalse();
|
||||
this.resourceFactory.getLoopResources();
|
||||
assertThat(this.resourceFactory.isRunning()).isTrue();
|
||||
this.resourceFactory.stop();
|
||||
assertThat(this.resourceFactory.isRunning()).isFalse();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user