Skip to content

Annotations like @Ssl don't work on @Bean methods when using @ServiceConnection#50033

Closed
kwondh5217 wants to merge 0 commit intospring-projects:3.5.xfrom
kwondh5217:fix/50011-service-connection-bean-method-annotations
Closed

Annotations like @Ssl don't work on @Bean methods when using @ServiceConnection#50033
kwondh5217 wants to merge 0 commit intospring-projects:3.5.xfrom
kwondh5217:fix/50011-service-connection-bean-method-annotations

Conversation

@kwondh5217
Copy link
Copy Markdown
Contributor

Previously, annotations such as @Ssl placed on @Bean methods were not
detected when using @ServiceConnection, because
ServiceConnectionAutoConfigurationRegistrar only read annotations from
TestcontainerBeanDefinition instances and passed null for regular @Bean
method beans.

This commit fixes the issue by reading annotations from the resolved
factory method of the RootBeanDefinition when the bean is not a
TestcontainerBeanDefinition.

Closes gh-50011

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Apr 11, 2026
@kwondh5217 kwondh5217 force-pushed the fix/50011-service-connection-bean-method-annotations branch from e9e911c to fd684d2 Compare April 11, 2026 18:25
@philwebb philwebb self-assigned this Apr 13, 2026
@philwebb philwebb added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Apr 13, 2026
@philwebb philwebb added this to the 3.5.x milestone Apr 13, 2026
@philwebb philwebb force-pushed the fix/50011-service-connection-bean-method-annotations branch from fd684d2 to ffabe11 Compare April 13, 2026 22:17
philwebb pushed a commit to kwondh5217/spring-boot that referenced this pull request Apr 13, 2026
Update `ServiceConnectionAutoConfigurationRegistrar` to include
annotations from `@Bean` methods.

See spring-projectsgh-50033

Signed-off-by: Daeho Kwon <trewq231@naver.com>
philwebb added a commit to kwondh5217/spring-boot that referenced this pull request Apr 13, 2026
@philwebb philwebb changed the title Detect annotations on @Bean methods when using @ServiceConnection Annotations like @Ssl don't work on @Bean methods when using @ServiceConnection Apr 13, 2026
@philwebb philwebb changed the base branch from main to 3.5.x April 13, 2026 22:19
@philwebb philwebb modified the milestones: 3.5.x, 3.5.14 Apr 13, 2026
@philwebb philwebb closed this in 9c3a2e0 Apr 13, 2026
philwebb added a commit that referenced this pull request Apr 13, 2026
* pr/50033:
  Polish 'Include @bean method annotations in ContainerConnectionSource'
  Include @bean method annotations in ContainerConnectionSource

Closes gh-50033
@philwebb
Copy link
Copy Markdown
Member

Thanks very much @kwondh5217. I've tweaked the fix a bit in d3c8829 to make use of AnnotatedBeanDefinition which can directly provide the annotation details.

@philwebb philwebb reopened this Apr 13, 2026
@philwebb philwebb closed this Apr 13, 2026
@philwebb philwebb force-pushed the fix/50011-service-connection-bean-method-annotations branch from ffabe11 to 208d750 Compare April 13, 2026 22:58
@kwondh5217 kwondh5217 deleted the fix/50011-service-connection-bean-method-annotations branch April 13, 2026 23:07
@kwondh5217
Copy link
Copy Markdown
Contributor Author

Thanks @philwebb ! looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug A general bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Annotations like @Ssl don't work on @Bean methods when using @ServiceConnection

3 participants