SpingBoot测试

引入依赖:

 
                org.springframework.boot
                spring-boot-starter-test
                2.1.6.RELEASE
                test
            

@RunWith(value = SpringRunner.class)
@SpringBootTest(classes = 启动类.class)
@ActiveProfiles("dev")
public class ApplicationTest {

    @Before
    public void init(){
        System.out.println(
                "init"
        );
    }

}

你可能感兴趣的:(SpingBoot测试)