Spring annotation-based test IOC container object

AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(MyConfiguration.class);
Employee employee = applicationContext .getBean(Employee.class);

Container configuration class, using annotation @Configuration based on @Bean

Guess you like

Origin blog.csdn.net/huangbaokang/article/details/113754352