-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Reconsider @SpringIntegrationTest #3679
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
Labels
Milestone
Comments
artembilan
added a commit
to artembilan/spring-integration
that referenced
this issue
May 5, 2022
Fixes spring-projects#3679 The `@SpringIntegrationTest` makes a test cache key based on its attributes values when the same application context can be used in different test classes with different endpoints to have stopped originally. * Rework an `IntegrationEndpointsInitializer` to the `SpringIntegrationTestExecutionListener` which consult a `MockIntegrationContext` for endpoints to be started or not before the test execution and definitely stopped after the test execution to have a flexibility with the cached context * Improve a `MockIntegrationContext` to gather `AbstractEndpoint` beans and have them marked for stopping in the beginning of the application context. The `SpringIntegrationTestExecutionListener` takes care about startup in its `beforeTestClass()` * Verify different state for the `SpringIntegrationTest` with the `CachedSpringIntegrationTestAnnotationTests`
artembilan
added a commit
to artembilan/spring-integration
that referenced
this issue
May 6, 2022
Fixes spring-projects#3679 The `@SpringIntegrationTest` makes a test cache key based on its attributes values when the same application context can be used in different test classes with different endpoints to have stopped originally. * Rework an `IntegrationEndpointsInitializer` to the `SpringIntegrationTestExecutionListener` which consult a `MockIntegrationContext` for endpoints to be started or not before the test execution and definitely stopped after the test execution to have a flexibility with the cached context * Improve a `MockIntegrationContext` to gather `AbstractEndpoint` beans and have them marked for stopping in the beginning of the application context. The `SpringIntegrationTestExecutionListener` takes care about startup in its `beforeTestClass()` * Verify different state for the `SpringIntegrationTest` with the `CachedSpringIntegrationTestAnnotationTests`
garyrussell
pushed a commit
that referenced
this issue
May 9, 2022
* GH-3679: Better caching for SpringIntegrationTest Fixes #3679 The `@SpringIntegrationTest` makes a test cache key based on its attributes values when the same application context can be used in different test classes with different endpoints to have stopped originally. * Rework an `IntegrationEndpointsInitializer` to the `SpringIntegrationTestExecutionListener` which consult a `MockIntegrationContext` for endpoints to be started or not before the test execution and definitely stopped after the test execution to have a flexibility with the cached context * Improve a `MockIntegrationContext` to gather `AbstractEndpoint` beans and have them marked for stopping in the beginning of the application context. The `SpringIntegrationTestExecutionListener` takes care about startup in its `beforeTestClass()` * Verify different state for the `SpringIntegrationTest` with the `CachedSpringIntegrationTestAnnotationTests` * * Improve `SpringIntegrationTestExecutionListener` performance when no `@SpringIntegrationTest.noAutoStartup()` is configured * Fix `CachedSpringIntegrationTestAnnotationTests` check `isRunning()` for the endpoint under the testing instead of `isAutoStartup()` which is changed in one test class, but not other, and the order of their execution would matter * Migrate `MockMessageSourceTests` to JUnit 5 as a roadmap of the whole project * Fixes #3787
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Perhaps create a JUnit5 condition to stop/start the specified endpoints instead of adding an
IntegrationEndpointsInitializer
to the context.The current mechanism defeats the test context caching mechanism because each test class with
@SpringIntegrationTest
gets a different context customizer.See #3674 (reply in thread) for more information.
The text was updated successfully, but these errors were encountered: