I try to build a native image when having the following test:
@Testcontainers
@SpringBootTest
class RedisMyRepositoryTest(@Autowired val repository: RedisMyRepository) : MyRepositoryTest() {
companion object {
@Container
@ServiceConnection("redis")
val redis: GenericContainer<*> = GenericContainer("redis:latest").withExposedPorts(6379)
}
@Test
fun `should interact with repository - on happy path`() {
`should interact with the repo - happy path`(repository)
}
}
then during processTestAot task I get:
Code generation is not supported for bean definitions declaring an instance supplier callback : Root bean: class [org.springframework.boot.testcontainers.service.connection.redis.RedisContainerConnectionDetailsFactory$RedisContainerConnectionDetails]; scope=singleton; abstract=false; lazyInit=null; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodNames=null; destroyMethodNames=null
Comment From: philwebb
This may have been fixed by bd2fff1fd18603578c88386ea6517878f1dba44f. @kkocel What version of Spring Boot are you using?
Comment From: kkocel
@philwebb Bumping from 3.1.0 to 3.1.1 solved the issue. Thanks!
Comment From: wilkinsona
Great. Thanks for letting us know, @kkocel.