-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Support sprint boot @ServiceConnection annotation in tests #5273
Description
Is your feature request related to a problem? Please describe.
In Spring Boot 3.1, test containers support has improved - https://spring.io/blog/2023/06/23/improved-testcontainers-support-in-spring-boot-3-1
Basically, this should be enough to configure a working integration test:
@SpringBootTest
@Testcontainers
class MyIntegrationTests {
@Container
@ServiceConnection
static Neo4jContainer<?> neo4j = new Neo4jContainer<>("neo4j:5");
@Test
void myTest() {
// ...
}
}However, this doesn't work with Redisson Spring Boot starter as there are changes needed from the framework to make it work.
I haven't check the details, but it turns out that Spring Boot introduced a new class - RedisConnectionDetails that is an interface holding connection details. This interface is created automatically by Spring Boot whenever ServiceConnection annotation is used.
Describe the solution you'd like
Redisson auto configuration should use RedisConnectionDetails when configuring connection factory.
Describe alternatives you've considered