spring8-spring整合junit 请设置文章作者 LanguageJavaSpring Language Java Spring 发布于:2020年4月6日 nexthexonextbutterflyvolantisyearnyiliashokaindigoapollolandscapecactusmateryicarusfluidmaterial spring整合junit@RunWith 我们需要切换junit的main @ContextConfiguration 指定配置类或者配置文件 12345<dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <version>4.3.8.RELEASE</version></dependency> 123456@RunWith(SpringJUnit4ClassRunner.class)@ContextConfiguration(classes = Springconfig.class)public class MainTest { @Autowired private Main m = null;} 123456@RunWith(SpringJUnit4ClassRunner.class)@ContextConfiguration(locations= "classpath:bean.xml")public class MainTest { @Autowired private Main m = null;} 更新于:2020年4月6日 spring9-动态代理 nexthexonextbutterflyvolantisyearnyiliashokaindigoapollolandscapecactusmateryicarusfluidmaterial ... spring7-注解配置IOC nexthexonextbutterflyvolantisyearnyiliashokaindigoapollolandscapecactusmateryicarusfluidmaterial ...