diff --git a/src/test/java/com/fasterxml/jackson/failing/EnumDeserializationFromInt1850Test.java b/src/test/java/com/fasterxml/jackson/failing/EnumDeserializationFromInt1850Test.java index ef11b9c99f..caa32e72d0 100644 --- a/src/test/java/com/fasterxml/jackson/failing/EnumDeserializationFromInt1850Test.java +++ b/src/test/java/com/fasterxml/jackson/failing/EnumDeserializationFromInt1850Test.java @@ -21,16 +21,19 @@ enum Example2 { Example2(int x) { this.x = x; } } - public void testEnumFromInt1850() throws Exception + private final ObjectMapper MAPPER = newJsonMapper(); + + public void testEnumFromInt1850Method() throws Exception { - final ObjectMapper mapper = newJsonMapper(); - - String json = mapper.writeValueAsString(Example1.A); - Example1 e1 = mapper.readValue(json, Example1.class); + String json = MAPPER.writeValueAsString(Example1.A); + Example1 e1 = MAPPER.readValue(json, Example1.class); assertEquals(Example1.A, e1); + } - json = mapper.writeValueAsString(Example2.A); - Example2 e2 = mapper.readValue(json, Example2.class); + public void testEnumFromInt1850Field() throws Exception + { + String json = MAPPER.writeValueAsString(Example2.A); + Example2 e2 = MAPPER.readValue(json, Example2.class); assertEquals(Example2.A, e2); } }