[Java development framework SpringBoot] SpringBoot unit testing

SpringBoot unit test writing

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

    @Test
    public void test() {
    
    
        System.out.println("单元测试");
    }
}

Required pom dependencies

<!--SpringBoot单元测试-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-test</artifactId>
    <scope>test</scope>
</dependency>

to sum up

如果觉得不错,可以点赞+收藏或者关注下博主。感谢阅读!

Guess you like

Origin blog.csdn.net/weixin_42825651/article/details/109203440