mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-02 03:58:33 +08:00
fix(接口测试): 修复接口覆盖率的统计方式,当没有接口或场景时覆盖率为0
修复接口覆盖率的统计方式,当没有接口或场景时覆盖率为0
This commit is contained in:
parent
ed74ad21bb
commit
eddfd7903e
@ -268,7 +268,7 @@ public class APITestController {
|
||||
|
||||
@GetMapping("/countApiCoverage/{projectId}")
|
||||
public String countApiCoverage(@PathVariable String projectId) {
|
||||
String returnStr = "100%";
|
||||
String returnStr = "0%";
|
||||
/**
|
||||
* 接口覆盖率
|
||||
* 接口有案例/被场景引用 : 所有的接口
|
||||
@ -289,7 +289,7 @@ public class APITestController {
|
||||
|
||||
@GetMapping("/countInterfaceCoverage/{projectId}")
|
||||
public String countInterfaceCoverage(@PathVariable String projectId) {
|
||||
String returnStr = "100%";
|
||||
String returnStr = "0%";
|
||||
/**
|
||||
* 接口覆盖率
|
||||
* 复制的接口定义/复制或引用的单接口用例/ 添加的自定义请求 url 路径与现有的接口定义一致的请求
|
||||
|
@ -1560,7 +1560,7 @@ public class ApiAutomationService {
|
||||
*/
|
||||
public float countInterfaceCoverage(List<ApiScenarioWithBLOBs> allScenarioInfoList, List<ApiDefinition> allEffectiveApiList) {
|
||||
if (allEffectiveApiList == null || allEffectiveApiList.isEmpty()) {
|
||||
return 100;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Map<ApiMethodUrlDTO, List<String>> urlMap = new HashMap<>();
|
||||
|
Loading…
Reference in New Issue
Block a user