-
Notifications
You must be signed in to change notification settings - Fork 40.9k
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
Use beanName as default name of @ServiceConnection #36064
Conversation
What about bean name as |
IIRC, this was introduced in order to make sure the ConnectionFactory to be used. This is due there is no specific Testcontainers implementation. Redis and Zipkin fall into this because both use GenericContainer but the issue comes with custom images ("my-custom-kv-store") which will always requires |
If people migrate @ServiceConnection
GenericContainer<?> redis = return new GenericContainer<>("redis").withExposedPorts(6379); to @Bean
@ServiceConnection
GenericContainer<?> redis() {
return new GenericContainer<>("redis").withExposedPorts(6379);
} They will encounter unexpected |
That's not because the field is called
When you're using |
I know that because I read sources before preparing this PR, but most people doesn't read sources even documents, they want intuitional programming experience. |
Using beanName as default name of |
Before this commit, ConnectionDetailsNotFoundException will be raised if unnamed @Serviceconnection is annotated on @bean method and containerType is not accepted by ContainerConnectionSource.
Before this commit,
ConnectionDetailsNotFoundException
will be raised if unnamed@ServiceConnection
is annotated on@Bean
method andcontainerType
is not accepted byContainerConnectionSource
.For example:
After this commit, name of
@ServiceConnection
could be omitted.