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() {}
}
相关推荐
你的人类朋友4 小时前
说说签名与验签
后端
databook4 小时前
Manim实现脉冲闪烁特效
后端·python·动效
canonical_entropy7 小时前
AI时代,我们还需要低代码吗?—— 一场关于模型、演化与软件未来的深度问答
后端·低代码·aigc
颜如玉8 小时前
HikariCP:Dead code elimination优化
后端·性能优化·源码
考虑考虑9 小时前
Jpa使用union all
java·spring boot·后端
bobz9659 小时前
virtio vs vfio
后端
Rexi10 小时前
“Controller→Service→DAO”三层架构
后端
bobz96510 小时前
计算虚拟化的设计
后端
深圳蔓延科技10 小时前
Kafka的高性能之路
后端·kafka
Barcke10 小时前
深入浅出 Spring WebFlux:从核心原理到深度实战
后端