File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
src/test/java/com/fasterxml/jackson/databind/deser Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -170,6 +170,17 @@ public static ObjectMapper setupObjectMapper(ObjectMapper mapper) {
170
170
}
171
171
}
172
172
173
+ // [databind#1626]
174
+ enum NumberEnum {
175
+ @ JsonProperty ("2" )
176
+ EN2 ,
177
+ @ JsonProperty ("0" )
178
+ EN0 ,
179
+ @ JsonProperty ("1" )
180
+ EN1
181
+ ;
182
+ }
183
+
173
184
/*
174
185
/**********************************************************
175
186
/* Test methods
@@ -510,4 +521,12 @@ public void testExceptionFromCustomEnumKeyDeserializer() {
510
521
assertTrue (e .getMessage ().contains ("Undefined AnEnum" ));
511
522
}
512
523
}
524
+
525
+ // [databind#1626]
526
+ public void testNumericEnumName () throws Exception
527
+ {
528
+ String json = MAPPER .writeValueAsString (NumberEnum .EN2 );
529
+ assertEquals (quote ("2" ), json );
530
+ assertEquals (NumberEnum .EN2 , MAPPER .readValue (json , NumberEnum .class ));
531
+ }
513
532
}
You can’t perform that action at this time.
0 commit comments