14
14
import static org .junit .jupiter .api .Assertions .assertThrows ;
15
15
import static org .junit .jupiter .api .Assertions .assertTrue ;
16
16
17
- public class DifferentDeserializationPropertyNameTest extends XmlTestUtil {
18
-
17
+ public class DifferentDeserializationPropertyNameTest extends XmlTestUtil
18
+ {
19
19
static class TestBean {
20
-
21
20
@ JacksonXmlProperty (localName = "wrong" )
22
21
String wrong ;
23
22
24
23
@ JacksonXmlText
25
24
String name ;
26
-
27
-
28
25
}
29
26
30
27
/*
@@ -36,7 +33,8 @@ static class TestBean {
36
33
@ Test
37
34
public void testWithExplicitProperty () {
38
35
final XmlMapper mapper = XmlMapper .builder ()
39
- .annotationIntrospector (new JacksonXmlAnnotationIntrospector (false , new JacksonXmlAnnotationIntrospectorConfig (false , new PropertyName ("name" ))))
36
+ .annotationIntrospector (new JacksonXmlAnnotationIntrospector (false ,
37
+ new JacksonXmlAnnotationIntrospectorConfig (false , new PropertyName ("name" ))))
40
38
.build ();
41
39
42
40
String xmlInput = "<testBean>ABC123</testBean>" ;
@@ -49,7 +47,8 @@ public void testWithExplicitProperty() {
49
47
@ Test
50
48
public void testWithInferName () {
51
49
final XmlMapper mapper = XmlMapper .builder ()
52
- .annotationIntrospector (new JacksonXmlAnnotationIntrospector (false , new JacksonXmlAnnotationIntrospectorConfig (true , null )))
50
+ .annotationIntrospector (new JacksonXmlAnnotationIntrospector (false ,
51
+ new JacksonXmlAnnotationIntrospectorConfig (true , null )))
53
52
.build ();
54
53
55
54
String xmlInput = "<testBean>DEF</testBean>" ;
@@ -62,7 +61,8 @@ public void testWithInferName() {
62
61
@ Test
63
62
public void testWithDuplicateExplicitProperty () {
64
63
final XmlMapper mapper = XmlMapper .builder ()
65
- .annotationIntrospector (new JacksonXmlAnnotationIntrospector (false , new JacksonXmlAnnotationIntrospectorConfig (false , new PropertyName ("wrong" ))))
64
+ .annotationIntrospector (new JacksonXmlAnnotationIntrospector (false ,
65
+ new JacksonXmlAnnotationIntrospectorConfig (false , new PropertyName ("wrong" ))))
66
66
.build ();
67
67
68
68
String xmlInput = "<testBean>DEF</testBean>" ;
@@ -71,5 +71,4 @@ public void testWithDuplicateExplicitProperty() {
71
71
72
72
assertTrue (result .getMessage ().contains ("Multiple fields representing property \" wrong\" " ));
73
73
}
74
-
75
74
}
0 commit comments