mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
fix test
This commit is contained in:
parent
41bbd86a14
commit
9157fa332b
@ -159,7 +159,7 @@ public class XmlUtilTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getByPathTest(){
|
public void getByPathTest() {
|
||||||
String xmlStr = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
|
String xmlStr = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
|
||||||
"<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\n" +
|
"<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\n" +
|
||||||
" <soap:Body>\n" +
|
" <soap:Body>\n" +
|
||||||
@ -172,12 +172,12 @@ public class XmlUtilTest {
|
|||||||
Document document = XmlUtil.readXML(xmlStr);
|
Document document = XmlUtil.readXML(xmlStr);
|
||||||
Object value = XmlUtil.getByXPath(
|
Object value = XmlUtil.getByXPath(
|
||||||
"//soap:Envelope/soap:Body/ns2:testResponse/return",
|
"//soap:Envelope/soap:Body/ns2:testResponse/return",
|
||||||
document,XPathConstants.STRING);//
|
document, XPathConstants.STRING);//
|
||||||
Assert.assertEquals("2020/04/15 21:01:21", value);
|
Assert.assertEquals("2020/04/15 21:01:21", value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void xmlToBeanTest(){
|
public void xmlToBeanTest() {
|
||||||
final TestBean testBean = new TestBean();
|
final TestBean testBean = new TestBean();
|
||||||
testBean.setReqCode("1111");
|
testBean.setReqCode("1111");
|
||||||
testBean.setAccountName("账户名称");
|
testBean.setAccountName("账户名称");
|
||||||
@ -197,7 +197,7 @@ public class XmlUtilTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public static class TestBean{
|
public static class TestBean {
|
||||||
private String ReqCode;
|
private String ReqCode;
|
||||||
private String AccountName;
|
private String AccountName;
|
||||||
private String Operator;
|
private String Operator;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user