Spring Cloud微服务实战 打造企业级优惠券系统 3-8 SpringBoot 单元测试

0    课程地址

http://coding.imooc.com/lesson/380.html#mid=28359

1    浓缩精华
2    个人关注
2.1  个人关注

测试用例至少有一个空方法,否则异常

3    课程内容
4    代码演练
4.1  测试用例

 测试用例demo:

package com.imooc.springboot.application;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

/**
 * SpringBootStudyTest
 *
 * @author 魏豆豆
 * @date 2021/3/23
 */
@SpringBootTest//带有SpringBoot支持的引导程序,提供了可指定外部环境的参数
@RunWith(SpringRunner.class)//junit引用spring的支持
public class SpringBootStudyTest {
    @Test//至少有一个测试用例,否则报java.lang.Exception: No runnable methods  异常
    public void blankFunction(){

    }
}
诸葛
原文地址:https://www.cnblogs.com/1446358788-qq/p/14296100.html