2. SpringBoot 整合 单元测试Junit

65 阅读1分钟

2. SpringBoot 整合 单元测试Junit

📕 引入依赖

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-test</artifactId>
    <scope>test</scope>
</dependency>
<dependency>
    <groupId>org.junit.jupiter</groupId>
    <artifactId>junit-jupiter-api</artifactId>
    <scope>test</scope>
</dependency>

📕 test 目录下面进行单元测试

image-20231030210523146

📕 测试结果

image-20231030210946084