无法比较空标签/元素,其中一个是自闭标签与属性值,另一个是没有属性的普通标签

时间:2016-08-15 14:24:12

标签: java xmlunit

<addressLine2 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:nil="1" />

<addressLine2></addressLine2>

差异的输出是:

Expected attribute name 'nil' but was 'null' - comparing <addressLine2...> at /Envelope[1]/Body[1]/createOrder[1]/createOrderRequest[1]/order[1]/customer[1]/billingAddress[1]/addressLine2[1] to <addressLine2...> at /Envelope[1]/Body[1]/createOrder[1]/createOrderRequest[1]/order[1]/customer[1]/billingAddress[1]/addressLine2[1]

我也在下面使用方法。 XMLUnit.setIgnoreDiffBetweenTextAndCDATA(Boolean.TRUE); XMLUnit.setIgnoreAttributeOrder(Boolean.TRUE);

0 个答案:

没有答案