SpringBoot 学习记录(三)- Junit 单元测试
来源:互联网 发布:html 数组 编辑:程序博客网 时间:2024/05/19 13:44
pom.xml 添加maven 依赖:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
测试类代码:
package com.phpfzh;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = Application.class)// 1.4.0 前版本
public class FastdfsTest {
@Test
public void Test(){
System.out.println("fdsfdsfdsfd");
}
}
启动类代码:
package com.phpfzh;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
- SpringBoot 学习记录(三)- Junit 单元测试
- spring框架学习(三)junit单元测试
- spring框架学习(三)junit单元测试
- spring框架学习(三)junit单元测试
- spring框架学习(三)junit单元测试
- spring框架学习(三)junit单元测试
- spring框架学习(三)junit单元测试
- spring框架学习(三)junit单元测试
- spring框架学习(三)junit单元测试
- spring框架学习(三)junit单元测试
- spring框架学习(三)junit单元测试
- spring框架学习(三)junit单元测试
- spring框架学习(三)junit单元测试
- spring框架学习(三)junit单元测试
- spring框架学习(三)junit单元测试
- spring框架学习(三)junit单元测试
- spring框架学习(三)junit单元测试
- Junit单元测试学习笔记三
- 测试
- viewPager+fragment嵌套viewPager+fragment
- python: extend (扩展) 与 append (追加) 的差别
- Android项目中调起手机地图导航
- SQL练习 学校场景
- SpringBoot 学习记录(三)- Junit 单元测试
- python处理表格(一)
- JAVA 读取文件转换字符集
- yii2简单分页
- HTTP Header解析
- Android 事件处理过程,(1)
- JPA介绍与实例
- zookeeper
- mac环境下安装使用Sunny-Ngrok