The test suite has 400 @SpringBootTest classes and takes twenty minutes. Where does the time go?
Mostly into starting Spring application contexts. Context caching reuses one context per distinct test configuration, so each unique mock bean, property set, profile or @DirtiesContext forces a fresh start. Count contexts from the cache statistics log, converge the configurations, and move narrow tests to slices.