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.使用

原文地址:https://www.cnblogs.com/c2g5201314/p/13090405.html