spring boot 整合junit

1,添加起步依赖

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

2,在测试类中加上

@SpringBootTest注解

@RunWith(SpringRunner.class)

测试方法上加@Test

posted @ 2021-08-30 14:57  在线电影制作人  阅读(3)  评论(0)    收藏  举报  来源