fix(接口测试): mock期望支持匹配content-type为application/xml的数据

--bug=1024996 --user=宋天阳
【接口测试】github#23293,接口测试】-mock后置脚本-不支持获取content-type类型application/xml的xml数据
https://www.tapd.cn/55049933/s/1357826
This commit is contained in:
song-tianyang 2023-03-30 18:21:27 +08:00 committed by 建国
parent 7e2baa9d37
commit 8a95c28ed0
1 changed files with 1 additions and 1 deletions

View File

@ -371,7 +371,7 @@ public class MockApiUtils {
} catch (Exception e) { } catch (Exception e) {
LogUtil.error(e); LogUtil.error(e);
} }
} else if (StringUtils.startsWithIgnoreCase(request.getContentType(), "text/xml")) { } else if (StringUtils.startsWithIgnoreCase(request.getContentType(), "text/xml") || StringUtils.startsWithIgnoreCase(request.getContentType(), "application/xml")) {
mockParams.setParamType(MockRequestType.XML.name()); mockParams.setParamType(MockRequestType.XML.name());
String xmlString = readXml(request); String xmlString = readXml(request);
JSONObject xmlJsonObject = XMLUtil.xmlStringToJSONObject(xmlString); JSONObject xmlJsonObject = XMLUtil.xmlStringToJSONObject(xmlString);