Performance: Test profiles and configuration
MEDIUM IMPACT
This concept affects application startup time and memory usage during testing by controlling which beans and configurations load.
@SpringBootTest @ActiveProfiles("test") public class UserServiceTest { // Loads only test-specific beans }
@SpringBootTest
public class UserServiceTest {
// No profile specified, loads all beans
}| Pattern | Beans Loaded | Startup Time | Memory Usage | Verdict |
|---|---|---|---|---|
| No profile specified | All beans | High (slow) | High | [X] Bad |
| @ActiveProfiles("test") used | Only test beans | Low (fast) | Low | [OK] Good |