示例
package com.xxx;import com.xxx.ut.AbstractBasicTest;
import com.xxx.ut.uttool.TestModel;
import com.xxx.ut.uttool.TestModelEnum;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;public class QueryXXXImplTest extends AbstractBasicTest {@Autowiredprivate QueryxxxImpl service;@TestModel(value = TestModelEnum.LOCAL_PRIOR)@Testpublic void execute_xxx_PAYMENT_unionOrder() {QueryxxxRequest request = new QueryxxxRequest ();request.setDealNo("1022110407363100000003199");QueryxxxResponse response = service.execute(request);compareAndWrite(response);}
1、按测试方法名生成文件目录
2、按调用类名+方法名生成mock文件,可防重名
3、生成结果result.json
4、对结果result.json进行比对,数据校验