spring-modulith icon indicating copy to clipboard operation
spring-modulith copied to clipboard

Config classes or components are not being scanned in the src/test folder

Open germandsantana opened this issue 1 year ago • 4 comments

We have configuration classes in the src/test folder that mock certain interfaces. However, when using @ApplicationModuleTest, these classes are not being scanned, even though they reside in the same module being tested. Interestingly, when using only @SpringBootTest, the classes are picked up correctly. Is there something I might be overlooking or missing in the configuration?

germandsantana avatar Mar 26 '25 23:03 germandsantana

This is likely a duplicate of GH-202. Would you mind giving the 1.4 M3 release a try?

odrotbohm avatar Mar 27 '25 07:03 odrotbohm

It’s working with 1.4 M3, thanks!

This might be out of scope, but I also have a test entity and a Spring Data test repository in the src folder. The repository is being scanned, but the entity is not. I’m getting the error: "Not a managed type: class com.module.ordering.service.DummyDomainNamedEntityDB."

germandsantana avatar Mar 27 '25 17:03 germandsantana

The entity was in a different module, no worries. Thanks!

germandsantana avatar Mar 27 '25 18:03 germandsantana

That's what I had hoped. Happy coding!

odrotbohm avatar Mar 27 '25 20:03 odrotbohm