diff --git a/backend/src/main/java/io/metersphere/api/service/APITestService.java b/backend/src/main/java/io/metersphere/api/service/APITestService.java index b664601031..c20dff7e18 100644 --- a/backend/src/main/java/io/metersphere/api/service/APITestService.java +++ b/backend/src/main/java/io/metersphere/api/service/APITestService.java @@ -133,7 +133,12 @@ public class APITestService { public void copy(SaveAPITestRequest request) { checkQuota(); - checkNameExist(request); + + ApiTestExample example = new ApiTestExample(); + example.createCriteria().andNameEqualTo(request.getName()).andProjectIdEqualTo(request.getProjectId()); + if (apiTestMapper.countByExample(example) > 0) { + MSException.throwException(Translator.get("load_test_already_exists")); + } // copy test ApiTest copy = get(request.getId());