Skip to content

Commit b55fb4e

Browse files
committed
Improve test for #5355
1 parent b0ef3c0 commit b55fb4e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/test/java/tools/jackson/databind/misc/IPhoneStyleProperty5335Test.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import tools.jackson.databind.DeserializationFeature;
99
import tools.jackson.databind.MapperFeature;
1010
import tools.jackson.databind.ObjectMapper;
11+
import tools.jackson.databind.introspect.DefaultAccessorNamingStrategy;
1112
import tools.jackson.databind.json.JsonMapper;
1213
import tools.jackson.databind.testutil.DatabindTestUtil;
1314

@@ -22,14 +23,12 @@ static class TestPojo {
2223
private String aProp;
2324
private String anotherProp;
2425

25-
// Needed in 3.0 due to incompatible naming
26-
@JsonProperty("aProp")
26+
// NOTE: non-compliant naming; see JsonMapper configuration
2727
public String getaProp() {
2828
return aProp;
2929
}
3030

31-
// Needed in 3.0 due to incompatible naming
32-
@JsonProperty("aProp")
31+
// NOTE: non-compliant naming; see JsonMapper configuration
3332
public void setaProp(String aProp) {
3433
this.aProp = aProp;
3534
}
@@ -49,6 +48,8 @@ public void featureEnabledTest()
4948
ObjectMapper mapper = JsonMapper.builder()
5049
.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
5150
.enable(MapperFeature.FIX_FIELD_NAME_UPPER_CASE_PREFIX)
51+
.accessorNaming(new DefaultAccessorNamingStrategy.Provider()
52+
.withFirstCharAcceptance(true, false))
5253
.build();
5354

5455
String json = "{\"aProp\":\"aPropValue\",\"prop1\":\"prop1Value\"}";

0 commit comments

Comments
 (0)