Skip to content

Commit

Permalink
feat: write json and string methods for producer and consumer configs (
Browse files Browse the repository at this point in the history
  • Loading branch information
oktaykcr committed Aug 24, 2024
1 parent a55af9d commit aa7faf9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions consumer_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,11 @@ func Test_jsonPretty(t *testing.T) {
expected: "{\n\t\"key1\": \"value1\",\n\t\"key2\": 2\n}",
},
{
name: "Nested JSON",
input: `{"key1":"value1","key2":{"nestedKey1":1,"nestedKey2":2},"key3":[1,2,3]}`,
expected: "{\n\t\"key1\": \"value1\",\n\t\"key2\": {\n\t\t\"nestedKey1\": 1,\n\t\t\"nestedKey2\": 2\n\t},\n\t\"key3\": [\n\t\t1,\n\t\t2,\n\t\t3\n\t]\n}",
name: "Nested JSON",
input: `{"key1":"value1","key2":{"nestedKey1":1,"nestedKey2":2},"key3":[1,2,3]}`,
expected: "{\n\t\"key1\": \"value1\",\n\t\"" +
"key2\": {\n\t\t\"nestedKey1\": 1,\n\t\t\"nestedKey2\": 2\n\t},\n\t\"" +
"key3\": [\n\t\t1,\n\t\t2,\n\t\t3\n\t]\n}",
},
{
name: "Invalid JSON",
Expand Down

0 comments on commit aa7faf9

Please sign in to comment.