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:
parent
728b8a0f08
commit
6ced16f461
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue