Skip to content

Commit 88941d2

Browse files
committed
recover test, for now (need to decide if there's a bug to fix or not)
1 parent 59868ea commit 88941d2

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
package com.fasterxml.jackson.failing;
2+
3+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
4+
import com.fasterxml.jackson.databind.*;
5+
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
6+
7+
public class BuilderWithIgnored1214Test extends BaseMapTest
8+
{
9+
@JsonDeserialize(builder = TestObject1214.Builder.class)
10+
@JsonIgnoreProperties(ignoreUnknown = true)
11+
static class TestObject1214 {
12+
final String property1;
13+
14+
private TestObject1214(Builder builder) {
15+
property1 = builder.property1;
16+
}
17+
18+
public static Builder builder() {
19+
return new Builder();
20+
}
21+
22+
public String getProperty1() {
23+
return property1;
24+
}
25+
26+
static class Builder {
27+
28+
private String property1;
29+
30+
public Builder withProperty1(String p1) {
31+
property1 = p1;
32+
return this;
33+
}
34+
35+
public TestObject1214 build() {
36+
return new TestObject1214(this);
37+
}
38+
}
39+
}
40+
41+
public void testUnknown1214() throws Exception
42+
{
43+
ObjectMapper mapper = new ObjectMapper();
44+
TestObject1214 value = mapper.readValue(aposToQuotes
45+
("{'property1':'a', 'property2':'b'}"),
46+
TestObject1214.class);
47+
assertEquals("a", value.property1);
48+
}
49+
}

0 commit comments

Comments
 (0)