You passed the mock at 90% — the only soft spot was Core (71%). This drills the exact five confusions that cost you, plus the one Boot miss, from fresh angles.
ApplicationContext vs BeanFactory (eager/lazy); where proxies are created; the exact
stereotype set; disambiguation (@Order is a decoy); @Repository's special power; and
CommandLineRunner. Master these and Core becomes your best section.
| Confusion | The nail-it fact |
|---|---|
ApplicationContext vs BeanFactory | ApplicationContext extends BeanFactory and pre-instantiates singletons eagerly. A plain BeanFactory is lazy. AppContext also adds events, i18n, resource loading, and auto-registers post-processors. |
| Where proxies are created | A BeanPostProcessor creates the proxy in postProcessAfterInitialization — the last creation step. BFPP works on definitions; BPP works on instances. |
| Stereotypes | @Component, @Service, @Repository, @Controller, @RestController. @Bean is NOT one — it's a method-level annotation, not a scanned class. |
| Disambiguation | @Qualifier, @Primary, and matching the bean name pick which bean to inject. @Order does NOT — it only orders items in a collection/advisor chain. |
@Repository's power | The only stereotype that adds real behaviour: persistence exception translation (SQLException → DataAccessException). |
CommandLineRunner | Runs code once, after the whole app context is ready (with access to args). Different from @PostConstruct, which runs per-bean right after that bean's DI. |
Same concepts, re-attacked so you're recognising the idea, not a memorised sentence. Options shuffle on every load.
postProcessAfterInitialization (not earlier),
or any other of these in depth? Ask.