0
我試圖用下面的XML來比較元素值CUSTOMER
使用放心。我無法找到價值爲CUSTOMER
的標籤。其他保證:驗證子標記的xml值
一旦我比較成功,我需要比較INVOICE, ITEM, PRODUCT
以及其他細節。
<resource xmlns:xlink="http://www.w3.org/1999/xlink">
<CUSTOMERList xlink:href="http://thomas-bayer.com/sqlrest/CUSTOMER/">CUSTOMER</CUSTOMERList>
<INVOICEList xlink:href="http://thomas-bayer.com/sqlrest/INVOICE/">INVOICE</INVOICEList>
<ITEMList xlink:href="http://thomas-bayer.com/sqlrest/ITEM/">**ITEM**</ITEMList>
<PRODUCTList xlink:href="http://thomas-bayer.com/sqlrest/PRODUCT/">PRODUCT</PRODUCTList>
</resource>
下面是我的代碼Java代碼:運行代碼後生成
RestAssured.baseURI = "http://thomas-bayer.com";
try {
RestAssured.given().parameter("CUSTOMERList")
.when().post("/sqlrest").then()
.body("resource.CUSTOMERList", Matchers.equalTo("CUSTOMER"));
} catch (Exception e) {
e.printStackTrace();
}
錯誤:
java.lang.AssertionError: XML path resource.CUSTOMERList doesn't match.
Expected: CUSTOMER