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

1.依赖包

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

2.在测试了添加注解

@RunWith(SpringRunner.class)
@SpringBootTest

 

 3.使用

 

posted @ 2020-06-10 23:50  岑惜  阅读(838)  评论(0编辑  收藏  举报