spring boot 测试用例

依赖包


            org.springframework
            spring-test
            5.2.5.RELEASE
            compile
        
        
            junit
            junit
            RELEASE
            compile
        
        
            org.springframework.boot
            spring-boot-test
            2.2.6.RELEASE
            compile
        

目录结构

spring boot 测试用例_第1张图片 

import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.*;

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

    @org.junit.Test
    public void test() {}
}

你可能感兴趣的:(spring,boot,服务器,后端)