-
Notifications
You must be signed in to change notification settings - Fork 40.8k
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
@ImportTestcontainers doesn't work with AOT #42891
base: 3.3.x
Are you sure you want to change the base?
Conversation
2b1535f
to
e9795bb
Compare
91e3273
to
cd63de3
Compare
Unfortunately, handling the bean instance supplier for container fields only addresses |
008de18
to
65e3548
Compare
@philwebb |
7c38b50
to
e6b1c3e
Compare
Sorry for the delay @nosan, I haven't had the chance to look in detail at this one yet. |
@philwebb |
Add TestcontainersBeanRegistrationAotProcessor that replaces InstanceSupplier of Container by either direct field usage or a reflection equivalent. Add DynamicPropertySourceBeanFactoryInitializationAotProcessor that generates methods for each annotated @DynamicPropertySource method See spring-projectsgh-42891 Signed-off-by: Dmytro Nosan <dimanosan@gmail.com>
#42875
Since Bean's InstanceSupplier cannot be used during the AOT process, I added
BeanRegistrationAotProcessor
to replace it.If a container's field is inaccessible, the generated code will be:
If a container's field is accessible, the generated code will be:
An alternative way is
FactoryBean
instead ofInstanceSupplier
.The target branch is 3.2.x