springboot第二天 junit单元测试
来源:互联网 发布:苹果8plus数据参数 编辑:程序博客网 时间:2024/06/01 19:25
pom 文件:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>spring-boot</groupId>
<artifactId>springboot02</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>springboot02</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.0.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
启动类:
package spring_boot.springboot03;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* Hello world!
*
*/
@SpringBootApplication
public class ApplicationTest {
public static void main( String[] args ){
SpringApplication.run(ApplicationTest.class, args);
}
}
测试类:
package spring_boot.springboot03;
import org.junit.runner.RunWith;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class) //加载junit
@SpringApplicationConfiguration(classes = ApplicationTest.class)// 加载驱动类
public class Test {
@org.junit.Test
public void test(){
System.out.println("323132123137498");
}
}
- springboot第二天 junit单元测试
- SpringBoot Junit单元测试
- SpringBoot junit单元测试
- SpringBoot的Junit单元测试
- SpringBoot 使用JUnit 单元测试
- SpringBoot开发Junit单元测试方法
- SpringBoot与JUnit+Mockito 单元测试
- SpringBoot框架下基于Junit的单元测试
- SpringBoot 学习记录(三)- Junit 单元测试
- SpringBoot-JUnit
- JUnit单元测试
- JUnit 单元测试
- 单元测试JUnit
- Junit单元测试
- Junit单元测试
- junit单元测试
- JUnit单元测试
- Junit单元测试
- Linux Platform总线+SPI总线分析
- oracle for linux安装报错 file /home/oracle/.Xauthority does not exist
- python下的单例模式
- IO流简介及方法
- 给定俩个字符串一个S(母串),一个T(子串),有多少种方法从母串中移除字符得到子字符串
- springboot第二天 junit单元测试
- 【比特币】BIP-0009 软叉标准
- SVM之线性不可分
- mysql使用between and处理时间区间不包括右边界问题
- c++ 中vector用法
- 异常:Can't connect to MySQL server (10060)
- js 阿拉伯数字转中文大写货币
- Ubuntu 16.04无线wifi频繁掉线及信号不足解决办法
- Cookie测试的测试点