springboot单元测试

引入依赖

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

然后编写测试类:

@RunWith(SpringRunner.class)
@SpringBootTest
public class BRoleControllerTest {

    @Autowired
    private StringRedisTemplate stringRedisTemplate;

    @Test
    public void test1(){
      
        
    }

}
posted @ 2019-06-20 10:19  你就像甜甜的益达  阅读(30)  评论(0编辑  收藏  举报