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