spring8-spring整合junit 2020-04-06 LanguageJavaSpring 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-04-06 00:05:43 这里可以写作者留言,标签和 hexo 中所有变量及辅助函数等均可调用,示例:<%- page.permalink.replace(/index\.html$/, '') %> 赏 Prev spring9-动态代理 Next spring7-注解配置IOC