spring boot 测试用例

依赖包

复制代码
<dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>5.2.5.RELEASE</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>RELEASE</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-test</artifactId>
            <version>2.2.6.RELEASE</version>
            <scope>compile</scope>
        </dependency>

目录结构

复制代码
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.*;

@RunWith(SpringRunner.class)
@SpringBootTest
public class Test {

    @org.junit.Test
    public void test() {}
}
相关推荐
赴前尘8 小时前
golang 查看指定版本库所依赖库的版本
开发语言·后端·golang
张太行_8 小时前
Linux静态库:多模块高效管理
linux·运维·服务器
ID_180079054739 小时前
YouTube item_get_video接口认证方式:API密钥与OAuth2.0的选择与应用
服务器·windows·microsoft
wgl6665209 小时前
Linux---基础IO!
linux·运维·服务器
Ancelin安心9 小时前
kali-dirsearch的使用
linux·运维·服务器·python·计算机网络·web安全·网络安全
jun_bai10 小时前
python+Java的网盘程序升级版。无感知备份文档,保护数据资产利器。
运维·服务器
上海云盾-高防顾问10 小时前
筑牢网络防线:境外恶意网址与IP防范指南
服务器·网络·安全
程序员张311 小时前
Mybatis条件判断某属性是否等于指定字符串
java·spring boot·mybatis
weixin_5160230711 小时前
VESTA在Linux下的安装
linux·运维·服务器
热心市民R先生12 小时前
IGH EtherCAT 主站核心文件体系全解析:构成、区别与运维实践
运维·服务器·网络