Skip to content

Commit 8634a26

Browse files
committed
Fix 1 of 5 new IT failures (due to DeserializationFeature.FAIL_ON_TRAILING_TOKENS default change)
1 parent 2da8a1f commit 8634a26

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

src/test/java/tools/jackson/dataformat/xml/XmlTestUtil.java

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

231+
protected static XmlMapper.Builder mapperBuilder(boolean useListWrapping) {
232+
return XmlMapper.builder()
233+
.defaultUseWrapper(useListWrapping);
234+
}
235+
231236
protected static XmlMapper.Builder mapperBuilder(XmlFactory f) {
232237
return XmlMapper.builder(f);
233238
}
234239

235240
protected XmlMapper xmlMapper(boolean useListWrapping)
236241
{
237-
return XmlMapper.builder()
238-
.defaultUseWrapper(useListWrapping)
239-
.build();
242+
return mapperBuilder(useListWrapping).build();
240243
}
241244

242245
protected AnnotationIntrospector jakartaXMLBindAnnotationIntrospector() {

src/test/java/tools/jackson/dataformat/xml/incr/PartialReadTest.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import org.junit.jupiter.api.Test;
77

88
import tools.jackson.core.JsonParser;
9-
9+
import tools.jackson.databind.DeserializationFeature;
1010
import tools.jackson.dataformat.xml.XmlMapper;
1111
import tools.jackson.dataformat.xml.XmlTestUtil;
1212

@@ -15,7 +15,9 @@
1515

1616
public class PartialReadTest extends XmlTestUtil
1717
{
18-
private final XmlMapper MAPPER = xmlMapper(true);
18+
private final XmlMapper MAPPER = mapperBuilder(true)
19+
.disable(DeserializationFeature.FAIL_ON_TRAILING_TOKENS)
20+
.build();
1921

2022
@Test
2123
public void testSimpleRead() throws Exception
@@ -28,9 +30,8 @@ public void testSimpleRead() throws Exception
2830
assertEquals(sr.next(), XMLStreamConstants.START_ELEMENT);
2931
assertEquals("root", sr.getLocalName());
3032

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-
*/
33+
// 30-May-2014, tatu: This is bit tricky... need to ensure that currently
34+
// pointed to START_ELEMENT is sort of re-read.
3435
assertEquals(sr.next(), XMLStreamConstants.START_ELEMENT);
3536
assertEquals("NameBean", sr.getLocalName());
3637

0 commit comments

Comments
 (0)