Skip to content

ApplicationModuleTest seems to block EntityScan packages #1134

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

Closed
ivanfryda opened this issue Mar 31, 2025 · 5 comments
Closed

ApplicationModuleTest seems to block EntityScan packages #1134

ivanfryda opened this issue Mar 31, 2025 · 5 comments
Assignees
Labels
in: test support Spring Boot integration testing resolution: invalid The issues is not an actually an issue with Spring Modulith

Comments

@ivanfryda
Copy link

Hello,

My application has a @EntityScan with my root package and a Spring Modulith package and a couple of Axon packages. My ApplicationModuleTest fails since it does not have the Axon entities in the JPA Metamodel. How can I tell ApplicationModuleTest not to restrict it? Or maybe this is beyond the scope of it and I should test this differently?

@odrotbohm odrotbohm added in: test support Spring Boot integration testing resolution: invalid The issues is not an actually an issue with Spring Modulith labels Apr 1, 2025
@odrotbohm odrotbohm self-assigned this Apr 1, 2025
@odrotbohm
Copy link
Member

odrotbohm commented Apr 1, 2025

This is a shortcoming of @EntityScan, already reported with Spring Boot here.

@odrotbohm odrotbohm closed this as not planned Won't fix, can't repro, duplicate, stale Apr 1, 2025
@ivanfryda
Copy link
Author

But the issue still persists if I replace EntityScan with AutoConfigurationPackage. Are there any recommended/possible workarounds?

@odrotbohm
Copy link
Member

Can you elaborate why you'd need to explicitly list the Axon packages as entity packages? Is that generated code? If so, why is it not generated into the module's packages or – if shared – into the package of a core module that's declared as shared module?

@ivanfryda
Copy link
Author

I just figured I don't need to do that in order for Axon to work, in fact I'd argue that using EntityScan should be avoided whenever possible. I was able to get it all configured "automatically" with minimal intervention.

@odrotbohm
Copy link
Member

That's great to hear. Happy coding! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: test support Spring Boot integration testing resolution: invalid The issues is not an actually an issue with Spring Modulith
Projects
None yet
Development

No branches or pull requests

2 participants