@@ -161,12 +161,11 @@ void testConvertDocument() throws Exception {
161161 Object result = XmlDomUtils .convertDocument (doc , MAX_RECURSION );
162162
163163 assertNotNull (result );
164- assertTrue (result instanceof List );
164+ assertTrue (result instanceof Map );
165165
166166 @ SuppressWarnings ("unchecked" )
167- List <Object > resultList = (List <Object >) result ;
168- assertEquals (1 , resultList .size ());
169- assertTrue (resultList .get (0 ) instanceof Map );
167+ Map <String , Object > resultMap = (Map <String , Object >) result ;
168+ assertTrue (resultMap .containsKey ("children" ));
170169 }
171170
172171 @ Test
@@ -184,12 +183,11 @@ void testConvertElement() throws Exception {
184183 Object result = XmlDomUtils .convertElement (element , MAX_RECURSION );
185184
186185 assertNotNull (result );
187- assertTrue (result instanceof List );
186+ assertTrue (result instanceof Map );
188187
189188 @ SuppressWarnings ("unchecked" )
190- List <Object > resultList = (List <Object >) result ;
191- assertEquals (1 , resultList .size ());
192- assertTrue (resultList .get (0 ) instanceof Map );
189+ Map <String , Object > resultMap = (Map <String , Object >) result ;
190+ assertTrue (resultMap .containsKey ("children" ));
193191 }
194192
195193 @ Test
@@ -206,7 +204,7 @@ void testProcessXmlForWaf_withDocument() throws Exception {
206204 Object result = XmlDomUtils .processXmlForWaf (doc , MAX_RECURSION );
207205
208206 assertNotNull (result );
209- assertTrue (result instanceof List );
207+ assertTrue (result instanceof Map );
210208 }
211209
212210 @ Test
@@ -218,7 +216,7 @@ void testProcessXmlForWaf_withElement() throws Exception {
218216 Object result = XmlDomUtils .processXmlForWaf (element , MAX_RECURSION );
219217
220218 assertNotNull (result );
221- assertTrue (result instanceof List );
219+ assertTrue (result instanceof Map );
222220 }
223221
224222 @ Test
@@ -228,12 +226,11 @@ void testProcessXmlForWaf_withXmlString() {
228226 Object result = XmlDomUtils .processXmlForWaf (xmlContent , MAX_RECURSION );
229227
230228 assertNotNull (result );
231- assertTrue (result instanceof List );
229+ assertTrue (result instanceof Map );
232230
233231 @ SuppressWarnings ("unchecked" )
234- List <Object > resultList = (List <Object >) result ;
235- assertEquals (1 , resultList .size ());
236- assertTrue (resultList .get (0 ) instanceof Map );
232+ Map <String , Object > resultMap = (Map <String , Object >) result ;
233+ assertTrue (resultMap .containsKey ("children" ));
237234 }
238235
239236 @ Test
@@ -258,12 +255,11 @@ void testParseXmlStringToWafFormat_validXml() throws Exception {
258255 Object result = XmlDomUtils .parseXmlStringToWafFormat (xmlContent , MAX_RECURSION );
259256
260257 assertNotNull (result );
261- assertTrue (result instanceof List );
258+ assertTrue (result instanceof Map );
262259
263260 @ SuppressWarnings ("unchecked" )
264- List <Object > resultList = (List <Object >) result ;
265- assertEquals (1 , resultList .size ());
266- assertTrue (resultList .get (0 ) instanceof Map );
261+ Map <String , Object > resultMap = (Map <String , Object >) result ;
262+ assertTrue (resultMap .containsKey ("children" ));
267263
268264 @ SuppressWarnings ("unchecked" )
269265 Map <String , Object > rootMap = (Map <String , Object >) resultList .get (0 );
@@ -301,7 +297,7 @@ void testHandleXmlString_validXml() {
301297 Object result = XmlDomUtils .handleXmlString (xmlContent , MAX_RECURSION );
302298
303299 assertNotNull (result );
304- assertTrue (result instanceof List );
300+ assertTrue (result instanceof Map );
305301 }
306302
307303 @ Test
@@ -332,7 +328,7 @@ void testXmlWithNamespaces() throws Exception {
332328 Object result = XmlDomUtils .processXmlForWaf (xmlContent , MAX_RECURSION );
333329
334330 assertNotNull (result );
335- assertTrue (result instanceof List );
331+ assertTrue (result instanceof Map );
336332 }
337333
338334 @ Test
@@ -342,7 +338,7 @@ void testXmlWithCDATA() throws Exception {
342338 Object result = XmlDomUtils .processXmlForWaf (xmlContent , MAX_RECURSION );
343339
344340 assertNotNull (result );
345- assertTrue (result instanceof List );
341+ assertTrue (result instanceof Map );
346342 }
347343
348344 @ Test
@@ -371,12 +367,11 @@ void testComplexXmlStructure() throws Exception {
371367 Object result = XmlDomUtils .processXmlForWaf (xmlContent , MAX_RECURSION );
372368
373369 assertNotNull (result );
374- assertTrue (result instanceof List );
370+ assertTrue (result instanceof Map );
375371
376372 @ SuppressWarnings ("unchecked" )
377- List <Object > resultList = (List <Object >) result ;
378- assertEquals (1 , resultList .size ());
379- assertTrue (resultList .get (0 ) instanceof Map );
373+ Map <String , Object > resultMap = (Map <String , Object >) result ;
374+ assertTrue (resultMap .containsKey ("children" ));
380375
381376 @ SuppressWarnings ("unchecked" )
382377 Map <String , Object > rootMap = (Map <String , Object >) resultList .get (0 );
0 commit comments