Skip to content

Commit d5f91ec

Browse files
committed
Minor test refactoring
1 parent b2e92b6 commit d5f91ec

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/test/java/com/fasterxml/jackson/failing/EnumDeserializationFromInt1850Test.java

+10-7
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,19 @@ enum Example2 {
2121
Example2(int x) { this.x = x; }
2222
}
2323

24-
public void testEnumFromInt1850() throws Exception
24+
private final ObjectMapper MAPPER = newJsonMapper();
25+
26+
public void testEnumFromInt1850Method() throws Exception
2527
{
26-
final ObjectMapper mapper = newJsonMapper();
27-
28-
String json = mapper.writeValueAsString(Example1.A);
29-
Example1 e1 = mapper.readValue(json, Example1.class);
28+
String json = MAPPER.writeValueAsString(Example1.A);
29+
Example1 e1 = MAPPER.readValue(json, Example1.class);
3030
assertEquals(Example1.A, e1);
31+
}
3132

32-
json = mapper.writeValueAsString(Example2.A);
33-
Example2 e2 = mapper.readValue(json, Example2.class);
33+
public void testEnumFromInt1850Field() throws Exception
34+
{
35+
String json = MAPPER.writeValueAsString(Example2.A);
36+
Example2 e2 = MAPPER.readValue(json, Example2.class);
3437
assertEquals(Example2.A, e2);
3538
}
3639
}

0 commit comments

Comments
 (0)