File tree Expand file tree Collapse file tree 3 files changed +10
-8
lines changed
src/test/java/com/fasterxml/jackson/dataformat/xml Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -230,15 +230,18 @@ protected static XmlMapper.Builder mapperBuilder() {
230
230
return XmlMapper .builder ();
231
231
}
232
232
233
+ protected static XmlMapper .Builder mapperBuilder (boolean useListWrapping ) {
234
+ return XmlMapper .builder ()
235
+ .defaultUseWrapper (useListWrapping );
236
+ }
237
+
233
238
protected static XmlMapper .Builder mapperBuilder (XmlFactory f ) {
234
239
return XmlMapper .builder (f );
235
240
}
236
241
237
242
protected XmlMapper xmlMapper (boolean useListWrapping )
238
243
{
239
- JacksonXmlModule module = new JacksonXmlModule ();
240
- module .setDefaultUseWrapper (useListWrapping );
241
- return new XmlMapper (module );
244
+ return mapperBuilder (useListWrapping ).build ();
242
245
}
243
246
244
247
protected AnnotationIntrospector jakartaXMLBindAnnotationIntrospector () {
Original file line number Diff line number Diff line change @@ -349,15 +349,15 @@ public void testBuilderMethodReturnMoreGeneral() throws Exception
349
349
@ Test
350
350
public void testBuilderMethodReturnMoreSpecific () throws Exception
351
351
{
352
- final String json = "<ValueInterface2><x>1</x></ValueInterface2>} " ;
352
+ final String json = "<ValueInterface2><x>1</x></ValueInterface2>" ;
353
353
ValueInterface2 value = MAPPER .readValue (json , ValueInterface2 .class );
354
354
assertEquals (2 , value .getX ());
355
355
}
356
356
357
357
@ Test
358
358
public void testSelfBuilder777 () throws Exception
359
359
{
360
- SelfBuilder777 result = MAPPER .readValue ("<SelfBuilder777><x>3</x></SelfBuilder777>' " ,
360
+ SelfBuilder777 result = MAPPER .readValue ("<SelfBuilder777><x>3</x></SelfBuilder777>" ,
361
361
SelfBuilder777 .class );
362
362
assertNotNull (result );
363
363
assertEquals (3 , result .x );
Original file line number Diff line number Diff line change @@ -28,9 +28,8 @@ public void testSimpleRead() throws Exception
28
28
assertEquals (sr .next (), XMLStreamConstants .START_ELEMENT );
29
29
assertEquals ("root" , sr .getLocalName ());
30
30
31
- /* 30-May-2014, tatu: This is bit tricky... need to ensure that currently
32
- * pointed to START_ELEMENT is sort of re-read.
33
- */
31
+ // 30-May-2014, tatu: This is bit tricky... need to ensure that currently
32
+ // pointed to START_ELEMENT is sort of re-read.
34
33
assertEquals (sr .next (), XMLStreamConstants .START_ELEMENT );
35
34
assertEquals ("NameBean" , sr .getLocalName ());
36
35
You can’t perform that action at this time.
0 commit comments