@@ -9,7 +9,7 @@ public class JacksonSortingTest {
9
9
10
10
private final ObjectMapper objectMapper = new ObjectMapper ();
11
11
12
- private final String JSON_INPUT = """
12
+ private final String INPUT_JSON = """
13
13
{
14
14
"b": 2,
15
15
"a": 1,
@@ -31,7 +31,7 @@ public class JacksonSortingTest {
31
31
}
32
32
""" ;
33
33
34
- private final String JSON_OUTPUT_SECOND = """
34
+ private final String SECOND_JSON_OUTPUT = """
35
35
{
36
36
"transactionId": "test",
37
37
"a": 1,
@@ -53,7 +53,7 @@ public class JacksonSortingTest {
53
53
}
54
54
""" ;
55
55
56
- private final String JSON_OUTPUT_THIRD = """
56
+ private final String THIRD_JSON_OUTPUT = """
57
57
{
58
58
"transactionId": "test",
59
59
"c": [
@@ -75,28 +75,28 @@ public class JacksonSortingTest {
75
75
}
76
76
""" ;
77
77
78
- private <T > void testSerializationDeserialization (String resultOutput , Class <T > clazz ) throws Exception {
79
- T deserializedObject = objectMapper .readValue (JSON_INPUT , clazz );
78
+ private <T > void testSerializationDeserialization (String outputResult , Class <T > clazz ) throws Exception {
79
+ T deserializedObject = objectMapper .readValue (INPUT_JSON , clazz );
80
80
String serializedJson = objectMapper .writeValueAsString (deserializedObject );
81
81
82
- String expectedJson = objectMapper .readTree (resultOutput ).toPrettyString ();
82
+ String expectedJson = objectMapper .readTree (outputResult ).toPrettyString ();
83
83
String actualJson = objectMapper .readTree (serializedJson ).toPrettyString ();
84
84
85
85
assertEquals (expectedJson , actualJson );
86
86
}
87
87
88
88
@ Test
89
89
public void testSerializationAndDeserializationForFirstObject () throws Exception {
90
- testSerializationDeserialization (JSON_INPUT , FirstObject .class );
90
+ testSerializationDeserialization (INPUT_JSON , FirstObject .class );
91
91
}
92
92
93
93
@ Test
94
94
public void testSerializationAndDeserializationForSecondObject () throws Exception {
95
- testSerializationDeserialization (JSON_OUTPUT_SECOND , SecondObject .class );
95
+ testSerializationDeserialization (SECOND_JSON_OUTPUT , SecondObject .class );
96
96
}
97
97
98
98
@ Test
99
99
public void testSerializationAndDeserializationForThirdObject () throws Exception {
100
- testSerializationDeserialization (JSON_OUTPUT_THIRD , ThirdObject .class );
100
+ testSerializationDeserialization (THIRD_JSON_OUTPUT , ThirdObject .class );
101
101
}
102
102
}
0 commit comments