@ServiceConnection on a @Bean method does not work in sliced tests#36037
Closed
eddumelendez wants to merge 5 commits intospring-projects:3.1.xfrom
Closed
@ServiceConnection on a @Bean method does not work in sliced tests#36037eddumelendez wants to merge 5 commits intospring-projects:3.1.xfrom
eddumelendez wants to merge 5 commits intospring-projects:3.1.xfrom
Conversation
Currently, in order to use `@ServiceConnection` in beans along with slice test annotations `@ImportAutoConfiguration(ServiceConnectionAutoConfiguration.class)` should be added to make it work. This commit register `ServiceConnectionAutoConfiguration` in specific slice test annotations. See spring-projectsgh-35252
eddumelendez
commented
Jun 23, 2023
...rg.springframework.boot.test.autoconfigure.data.couchbase.AutoConfigureDataCouchbase.imports
Outdated
Show resolved
Hide resolved
quaff
reviewed
Jun 25, 2023
...ot/test/autoconfigure/data/redis/DataRedisTestWithServiceConnectionBeanIntegrationTests.java
Show resolved
Hide resolved
Member
|
Thanks for the PR, @eddumelendez. These changes introduce a cycle between
I'm not sure how best to break this cycle. A couple of options:
1 feels the slightly better of these two options. There may also be others that I've overlooked. I'll discuss things with the team. |
wilkinsona
pushed a commit
that referenced
this pull request
Aug 1, 2023
Previously, to use `@ServiceConnection` on a `@Bean` method in a sliced test required ServiceConnectionAutoConfiguration to be imported using `@ImportAutoConfiguration`. This commit removes the need for this import by registering ServiceConnectionAutoConfiguration in specific slice test annotations. See gh-36037
wilkinsona
added a commit
that referenced
this pull request
Aug 1, 2023
Member
|
Thanks very much for the PR, @eddumelendez. In the end, we went with the second of the two options above. An entry in a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, in order to use
@ServiceConnectionin beans along withslice test annotations
@ImportAutoConfiguration(ServiceConnectionAutoConfiguration.class)should be added to make it work. This commit register
ServiceConnectionAutoConfigurationin specific slice test annotations.See gh-35252