Skip to content

Commit fd61dc6

Browse files
committed
Minor test fixes (backport from master)
1 parent 1e56ff8 commit fd61dc6

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

src/test/java/com/fasterxml/jackson/dataformat/xml/XmlTestUtil.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,15 +230,18 @@ protected static XmlMapper.Builder mapperBuilder() {
230230
return XmlMapper.builder();
231231
}
232232

233+
protected static XmlMapper.Builder mapperBuilder(boolean useListWrapping) {
234+
return XmlMapper.builder()
235+
.defaultUseWrapper(useListWrapping);
236+
}
237+
233238
protected static XmlMapper.Builder mapperBuilder(XmlFactory f) {
234239
return XmlMapper.builder(f);
235240
}
236241

237242
protected XmlMapper xmlMapper(boolean useListWrapping)
238243
{
239-
JacksonXmlModule module = new JacksonXmlModule();
240-
module.setDefaultUseWrapper(useListWrapping);
241-
return new XmlMapper(module);
244+
return mapperBuilder(useListWrapping).build();
242245
}
243246

244247
protected AnnotationIntrospector jakartaXMLBindAnnotationIntrospector() {

src/test/java/com/fasterxml/jackson/dataformat/xml/deser/builder/BuilderSimpleTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,15 +349,15 @@ public void testBuilderMethodReturnMoreGeneral() throws Exception
349349
@Test
350350
public void testBuilderMethodReturnMoreSpecific() throws Exception
351351
{
352-
final String json = "<ValueInterface2><x>1</x></ValueInterface2>}";
352+
final String json = "<ValueInterface2><x>1</x></ValueInterface2>";
353353
ValueInterface2 value = MAPPER.readValue(json, ValueInterface2.class);
354354
assertEquals(2, value.getX());
355355
}
356356

357357
@Test
358358
public void testSelfBuilder777() throws Exception
359359
{
360-
SelfBuilder777 result = MAPPER.readValue("<SelfBuilder777><x>3</x></SelfBuilder777>'",
360+
SelfBuilder777 result = MAPPER.readValue("<SelfBuilder777><x>3</x></SelfBuilder777>",
361361
SelfBuilder777.class);
362362
assertNotNull(result);
363363
assertEquals(3, result.x);

src/test/java/com/fasterxml/jackson/dataformat/xml/incr/PartialReadTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@ public void testSimpleRead() throws Exception
2828
assertEquals(sr.next(), XMLStreamConstants.START_ELEMENT);
2929
assertEquals("root", sr.getLocalName());
3030

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.
3433
assertEquals(sr.next(), XMLStreamConstants.START_ELEMENT);
3534
assertEquals("NameBean", sr.getLocalName());
3635

0 commit comments

Comments
 (0)