From 1546905d4bcc03660898519158261aa7cba8f634 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Mon, 13 Sep 2021 16:28:18 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=94=A8=E6=88=B7=E8=B7=9F=E8=B8=AA):xmind?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E6=A0=87=E7=AD=BE=E4=BC=98=E5=8C=96=20--bug?= =?UTF-8?q?=3D1006452=20--user=3D=E7=8E=8B=E5=AD=9D=E5=88=9A=20=E3=80=90gi?= =?UTF-8?q?thub#5995=E3=80=91V1.12.1=E4=B8=ADxmind=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=EF=BC=8C=E6=A0=87=E7=AD=BEtag=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E8=BF=9B=E8=A1=8C=E5=A4=9A=E6=A0=87=E7=AD=BE=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=EF=BC=8C=E4=BC=9A=E8=A2=AB=E5=90=88=E5=B9=B6=E4=B8=BA?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=20https://www.tapd.cn/55049933/s/1046070?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/metersphere/xmind/XmindCaseParser.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/backend/src/main/java/io/metersphere/xmind/XmindCaseParser.java b/backend/src/main/java/io/metersphere/xmind/XmindCaseParser.java index 193d96a6f6..5c42289b26 100644 --- a/backend/src/main/java/io/metersphere/xmind/XmindCaseParser.java +++ b/backend/src/main/java/io/metersphere/xmind/XmindCaseParser.java @@ -160,10 +160,10 @@ public class XmindCaseParser { //用例名称判断 - if(StringUtils.isEmpty(data.getName())){ + if (StringUtils.isEmpty(data.getName())) { validatePass = false; process.add("name" + Translator.get("cannot_be_null"), nodePath + ""); - }else { + } else { if (data.getName().length() > 200) { validatePass = false; process.add(Translator.get("test_case") + Translator.get("test_track.length_less_than") + "200", nodePath + data.getName()); @@ -171,7 +171,6 @@ public class XmindCaseParser { } - if (!StringUtils.isEmpty(nodePath)) { String[] nodes = nodePath.split("/"); if (nodes.length > TestCaseConstants.MAX_NODE_DEPTH + 1) { @@ -418,7 +417,13 @@ public class XmindCaseParser { testCase.setCustomNum(customId.toString()); } - testCase.setTags(JSON.toJSONString(tags)); + List tagsNew = new ArrayList(); + if (CollectionUtils.isNotEmpty(tags)) { + String tagsData = tags.get(0); + String[] array = tagsData.split("[, ,]"); + Arrays.asList(array).stream().forEach(x -> tagsNew.add(x)); + } + testCase.setTags(JSON.toJSONString(tagsNew)); testCase.setSteps(this.getSteps(steps)); // 校验合规性 if (validate(testCase)) {