2424
2525class JsonMapperTest {
2626 @ TableTest ({
27- "Scenario | Input | Expected " ,
28- "null input | | '{}' " ,
29- "empty map | [:] | '{}' " ,
30- "single entry | [key1: value1] | '{\" key1\" :\" value1\" }' " ,
31- "two entries | [key1: value1, key2: value2] | '{\" key1\" :\" value1\" ,\" key2\" :\" value2\" }' " ,
32- "quoted entries | [key1: va\" lu\" e1, ke\" y2: value2] | '{\" key1\" :\" va\\ \" lu\\ \" e1\" ,\" ke\\ \" y2\" :\" value2\" }'"
27+ "Scenario | Input | Expected " ,
28+ "null input | | '{}' " ,
29+ "empty map | [:] | '{}' " ,
30+ "single entry | [key1: value1] | '{\" key1\" :\" value1\" }' " ,
31+ "two entries | [key1: value1, key2: value2] | '{\" key1\" :\" value1\" ,\" key2\" :\" value2\" }' " ,
32+ "quoted entries | [key1: va\" lu\" e1, ke\" y2: value2] | '{\" key1\" :\" va\\ \" lu\\ \" e1\" ,\" ke\\ \" y2\" :\" value2\" }'"
3333 })
3434 @ ParameterizedTest (name = "test mapping to JSON object: {0}" )
3535 @ MethodSource ("testMappingToJsonObjectArguments" )
@@ -94,12 +94,12 @@ void testMappingToMapFromNonObjectJson(String json) {
9494 }
9595
9696 @ TableTest ({
97- "Scenario | Input | Expected " ,
98- "null input | | '[]' " ,
99- "empty list | [] | '[]' " ,
100- "single value | [value1] | '[\" value1\" ]' " ,
101- "two values | [value1, value2] | '[\" value1\" ,\" value2\" ]' " ,
102- "quoted values | [va\" lu\" e1, value2] | '[\" va\\ \" lu\\ \" e1\" ,\" value2\" ]'"
97+ "Scenario | Input | Expected " ,
98+ "null input | | '[]' " ,
99+ "empty list | [] | '[]' " ,
100+ "single value | [value1] | '[\" value1\" ]' " ,
101+ "two values | [value1, value2] | '[\" value1\" ,\" value2\" ]' " ,
102+ "quoted values | [va\" lu\" e1, value2] | '[\" va\\ \" lu\\ \" e1\" ,\" value2\" ]'"
103103 })
104104 @ ParameterizedTest (name = "test mapping iterable to JSON array: {0}" )
105105 void testMappingIterableToJsonArray (List <String > input , String expected ) throws IOException {
@@ -111,12 +111,12 @@ void testMappingIterableToJsonArray(List<String> input, String expected) throws
111111 }
112112
113113 @ TableTest ({
114- "Scenario | Input | Expected " ,
115- "null input | | '[]' " ,
116- "empty array | [] | '[]' " ,
117- "single element | [value1] | '[\" value1\" ]' " ,
118- "two elements | [value1, value2] | '[\" value1\" ,\" value2\" ]' " ,
119- "escaped quotes | [va\" lu\" e1, value2] | '[\" va\\ \" lu\\ \" e1\" ,\" value2\" ]'"
114+ "Scenario | Input | Expected " ,
115+ "null input | | '[]' " ,
116+ "empty array | [] | '[]' " ,
117+ "single element | [value1] | '[\" value1\" ]' " ,
118+ "two elements | [value1, value2] | '[\" value1\" ,\" value2\" ]' " ,
119+ "escaped quotes | [va\" lu\" e1, value2] | '[\" va\\ \" lu\\ \" e1\" ,\" value2\" ]'"
120120 })
121121 @ ParameterizedTest (name = "test mapping array to JSON array: {0}" )
122122 void testMappingArrayToJsonArray (String ignoredScenario , String [] input , String expected )
@@ -137,14 +137,14 @@ void testMappingToListFromEmptyJsonObject(String json) throws IOException {
137137 }
138138
139139 @ TableTest ({
140- "Scenario | input | expected " ,
141- "null value | | '' " ,
142- "empty string | '' | '' " ,
143- "\\ b | '\b ' | '\" \\ b\" '" ,
144- "\\ t | '\t ' | '\" \\ t\" '" ,
145- "\\ f | '\f ' | '\" \\ f\" '" ,
146- "a | 'a' | '\" a\" ' " ,
147- "/ | '/' | '\" \\ /\" '"
140+ "Scenario | input | expected " ,
141+ "null value | | '' " ,
142+ "empty string | '' | '' " ,
143+ "\\ b | '\b ' | '\" \\ b\" '" ,
144+ "\\ t | '\t ' | '\" \\ t\" '" ,
145+ "\\ f | '\f ' | '\" \\ f\" '" ,
146+ "a | 'a' | '\" a\" ' " ,
147+ "/ | '/' | '\" \\ /\" '"
148148 })
149149 @ ParameterizedTest (name = "test mapping to JSON string: {0}" )
150150 @ MethodSource ("testMappingToJsonStringArguments" )
0 commit comments