diff --git a/api-test/backend/src/main/java/io/metersphere/api/exec/generator/JSONSchemaRunTest.java b/api-test/backend/src/main/java/io/metersphere/api/exec/generator/JSONSchemaRunTest.java index f69bd76b0e..519759f689 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/exec/generator/JSONSchemaRunTest.java +++ b/api-test/backend/src/main/java/io/metersphere/api/exec/generator/JSONSchemaRunTest.java @@ -3,10 +3,8 @@ package io.metersphere.api.exec.generator; import com.google.gson.*; import io.metersphere.commons.constants.PropertyConstant; -import io.metersphere.commons.utils.EnumPropertyUtil; import io.metersphere.commons.utils.JSONUtil; import io.metersphere.jmeter.utils.ScriptEngineUtils; -import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.json.JSONArray; @@ -14,7 +12,6 @@ import org.json.JSONObject; import org.springframework.util.NumberUtils; import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Map.Entry; @@ -252,12 +249,6 @@ public class JSONSchemaRunTest { if (isMock(object)) { String value = ScriptEngineUtils.buildFunctionCallString(object.get(PropertyConstant.MOCK).getAsJsonObject().get(PropertyConstant.MOCK).getAsString()); return value; - } else if (object.has(PropertyConstant.ENUM)) { - List list = EnumPropertyUtil.analyzeEnumProperty(object); - if (CollectionUtils.isNotEmpty(list)) { - int index = (int) (Math.random() * list.size()); - return list.get(index); - } } } catch (Exception e) { return object.get(PropertyConstant.MOCK).getAsJsonObject().get(PropertyConstant.MOCK);