Skip to content

Commit 9ed6384

Browse files
committed
Update tests.
1 parent 829cc53 commit 9ed6384

2 files changed

Lines changed: 8 additions & 13 deletions

File tree

kilo-test/src/test/java/org/httprpc/kilo/test/WebServiceProxyTest.java

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -427,29 +427,21 @@ public void testFormDataPostProxy() throws URISyntaxException, IOException {
427427
}
428428

429429
@Test
430-
@SuppressWarnings("unchecked")
431430
public void testXMLPostProxy() throws IOException {
432431
var documentBuilder = ElementAdapter.newDocumentBuilder();
433432

434-
Document document;
435-
try (var inputStream = getClass().getResourceAsStream("account.xml")) {
436-
document = documentBuilder.parse(inputStream);
433+
Document document1;
434+
try (var inputStream = getClass().getResourceAsStream("test.xml")) {
435+
document1 = documentBuilder.parse(inputStream);
437436
} catch (SAXException exception) {
438437
throw new IOException(exception);
439438
}
440439

441440
var testServiceProxy = WebServiceProxy.of(TestServiceProxy.class, baseURI);
442441

443-
document = testServiceProxy.testXMLPost(1, 2, document);
442+
var document2 = testServiceProxy.testXMLPost(1, 2, document1);
444443

445-
var accountAdapter = new ElementAdapter(document.getDocumentElement());
446-
447-
assertEquals("101", accountAdapter.get("@id"));
448-
449-
var holder = (Map<String, Object>)accountAdapter.get("holder");
450-
451-
assertEquals("John", holder.get("firstName").toString());
452-
assertEquals("Smith", holder.get("lastName").toString());
444+
assertTrue(document1.isEqualNode(document2));
453445
}
454446

455447
@Test
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
3+
<foo id="101">bar</foo>

0 commit comments

Comments
 (0)