@ApplicationModuleTest
in separate test files does not cache the ApplicationContext
#1050
Labels
Milestone
Somewhat related to #725
When creating
@ApplicationModuleTest
's across test files within the same module, theApplicationContext
is not cached. From what I can see,ModuleContextCustomizerFactory.hashCode()
is considering the source Class (which is the Test class) and that results in separate tests to be considered 'different' from aAC
cache perspective. Though, from an actualAC
perspective, these are the same contexts.Relatively easy to re-produce in the spring-modulith-example-full module. I just added a duplicate
OrderIntegrationTest
calledAnotherOrderIntegrationTest
in a separate test file, and when running these together, I'd expect to have 1AC
but am seeing 2. Along with 2 cache misseslogging.level.org.springframework.test.context.cache=debug
, where I'd expect 1 (loading it for the first test (miss) but not the second (hit)).The text was updated successfully, but these errors were encountered: