# Spring与Junit的整合
今天学习了下,总结一下,使用方法
## 导入依赖
```
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>5.0.2.RELEASE</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
```
## 使用
```
@ContextConfiguration(locations = "classpath:bean.xml")
@RunWith(SpringJUnit4ClassRunner.class)
public class Mytext {
@Autowired
private IAccountService ac;
@Test
public void Mytest1(){
ac.transfer("bbb","ccc",500f);
}
}
```