File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
src/test/java/tools/jackson/dataformat/xml/tofix/records Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ package tools .jackson .dataformat .xml .tofix .records ;
2+
3+ import org .junit .jupiter .api .Test ;
4+
5+ import tools .jackson .dataformat .xml .XmlMapper ;
6+ import tools .jackson .dataformat .xml .XmlTestUtil ;
7+ import tools .jackson .dataformat .xml .annotation .JacksonXmlProperty ;
8+ import tools .jackson .dataformat .xml .annotation .JacksonXmlText ;
9+ import tools .jackson .dataformat .xml .testutil .failure .JacksonTestFailureExpected ;
10+
11+ import static org .junit .jupiter .api .Assertions .assertEquals ;
12+
13+ // [dataformat-xml#734]
14+ public class XmlRecordDeser734Test extends XmlTestUtil
15+ {
16+
17+ record Amount (@ JacksonXmlText String value ,
18+ @ JacksonXmlProperty (isAttribute = true , localName = "Ccy" ) String currency ) {}
19+
20+ private final String XML =
21+ a2q ("<Amt Ccy='EUR'>1</Amt>" );
22+
23+ @ JacksonTestFailureExpected
24+ @ Test
25+ public void testDeser () throws Exception {
26+ XmlMapper mapper = new XmlMapper ();
27+ Amount amt = mapper .readValue (XML , Amount .class );
28+ assertEquals ("1" , amt .value );
29+ assertEquals ("EUR" , amt .currency );
30+ }
31+ }
You can’t perform that action at this time.
0 commit comments