Skip to content

Commit f09660e

Browse files
authored
add test for issue 734 (disabled) (#739)
1 parent 7363d52 commit f09660e

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
}

0 commit comments

Comments
 (0)