在main下的java包与test下的包虽然物理路径不一样,但是在编译后class文件里是一起的

13-使用Junit单元测试

1.引入junit依赖

<dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>4.12</version>
</dependency>

2.创建测试类

13-使用Junit单元测试

 

 2.引入Spring单元测试模块

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-test</artifactId>
    <version>4.3.13.RELEASE</version>
</dependency>

13-使用Junit单元测试

 使用单元测试模块总结:

13-使用Junit单元测试

 

相关文章: