Spring Boot的单元测试

1.maven中导入两个依赖

     <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>

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

2.Test类中加上注解

@RunWith(SpringRunner.class)
@SpringBootTest
public class InsertServiceImplTest {
    @Test
    public void testInsert3() {

 

posted on 2020-04-20 16:14  我欲皆真  阅读(1605)  评论(0编辑  收藏  举报

导航