单元测试

单元测试

  • junit单元测试
  • 导入依赖
<!-- https://mvnrepository.com/artifact/junit/junit -->
<dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>4.12</version>
</dependency>
  • 编写单元测试
@Test
public void test(){
    ...
}
  • @Test注解只能用于方法,加了注解就能运行
posted @ 2021-01-29 13:34  一天到晚睡觉的鱼  阅读(20)  评论(0)    收藏  举报