##junit
@RunWith(SpringRunner.class) @Import({WebConfigurer.class}) @ComponentScan("包路径") @PropertySource({"classpath:boot.properties", "classpath:config.properties"})@ImportResource({ "classpath:spring/spring-dao.xml"})
##mock测试
@RunWith(PowerMockRunner.class) @PrepareForTest({需要mock的类.class}) @PowerMockIgnore({"javax.net.ssl.*", "javax.management.*"}) @PropertySource({"classpath:boot.properties", "classpath:important.properties"})ctx = new AnnotationConfigApplicationContext(类.class);Service xxService = new xxService(){ }; MemberModifier.field(类.class,"xxService") .set(xxService,xxService);