zl程序教程

您现在的位置是:首页 >  后端

当前栏目

spring boot 单元测试 --- 在测试类使用 javabean注解操作接口

SpringBoot测试接口 操作 --- 注解 单元测试
2023-09-14 09:06:40 时间

1.依赖包

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

2.在测试了添加注解

@RunWith(SpringRunner.class)
@SpringBootTest

 

 3.使用