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(){
      
        
    }

}
世界上所有的不公平都是由于当事人能力不足造成的.
原文地址:https://www.cnblogs.com/javayida/p/13346939.html