Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Guian Gumpac <[email protected]>
Signed-off-by: Mitchell Gale <[email protected]>
  • Loading branch information
MitchellGale and GumpacG authored Aug 17, 2023
1 parent 09cef84 commit 8acc03a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void produces_always_same_output_for_any_query_response() {
.build())),
new Cursor("test_cursor"));

assertEquals("{\n" + " \"succeeded\": true\n" + "}", formatter.format(response));
assertEquals("{\n \"succeeded\": true\n}", formatter.format(response));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void sanitizeHeaders() {
"Seattle",
"@age",
20))));
String expected = "'=firstname,'+lastname,'-city,'@age%n" + "John,Smith,Seattle,20";
String expected = "'=firstname,'+lastname,'-city,'@age%nJohn,Smith,Seattle,20";
assertEquals(format(expected), formatter.format(response));
}

Expand Down Expand Up @@ -109,7 +109,7 @@ void quoteIfRequired() {
new QueryResult(
schema,
Arrays.asList(tupleValue(ImmutableMap.of("na,me", "John,Smith", ",,age", "30,,,"))));
String expected = "\"na,me\",\",,age\"%n" + "\"John,Smith\",\"30,,,\"";
String expected = "\"na,me\",\",,age\"%n\"John,Smith\",\"30,,,\"";
assertEquals(format(expected), formatter.format(response));
}

Expand All @@ -133,7 +133,7 @@ void escapeSanitize() {
Arrays.asList(
tupleValue(ImmutableMap.of("city", "=Seattle")),
tupleValue(ImmutableMap.of("city", ",,Seattle"))));
String expected = "city%n" + "=Seattle%n" + "\",,Seattle\"";
String expected = "city%n=Seattle%n\",,Seattle\"";
assertEquals(format(expected), escapeFormatter.format(response));
}

Expand All @@ -153,7 +153,7 @@ void replaceNullValues() {
ImmutableMap.of("firstname", LITERAL_NULL, "city", stringValue("Seattle"))),
ExprTupleValue.fromExprValueMap(
ImmutableMap.of("firstname", stringValue("John"), "city", LITERAL_MISSING))));
String expected = "name,city%n" + "John,Seattle%n" + ",Seattle%n" + "John,";
String expected = "name,city%nJohn,Seattle%n,Seattle%nJohn,";
assertEquals(format(expected), formatter.format(response));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void sanitizeHeaders() {
"Seattle",
"@age",
20))));
String expected = "=firstname|+lastname|-city|@age%n" + "John|Smith|Seattle|20";
String expected = "=firstname|+lastname|-city|@age%nJohn|Smith|Seattle|20";
assertEquals(format(expected), rawFormatter.format(response));
}

Expand Down Expand Up @@ -108,7 +108,7 @@ void quoteIfRequired() {
new QueryResult(
schema,
Arrays.asList(tupleValue(ImmutableMap.of("na|me", "John|Smith", "||age", "30|||"))));
String expected = "\"na|me\"|\"||age\"%n" + "\"John|Smith\"|\"30|||\"";
String expected = "\"na|me\"|\"||age\"%n\"John|Smith\"|\"30|||\"";
assertEquals(format(expected), rawFormatter.format(response));
}

Expand All @@ -132,7 +132,7 @@ void escapeSanitize() {
Arrays.asList(
tupleValue(ImmutableMap.of("city", "=Seattle")),
tupleValue(ImmutableMap.of("city", "||Seattle"))));
String expected = "city%n" + "=Seattle%n" + "\"||Seattle\"";
String expected = "city%n=Seattle%n\"||Seattle\"";
assertEquals(format(expected), escapeFormatter.format(response));
}

Expand All @@ -147,7 +147,7 @@ void senstiveCharater() {
Arrays.asList(
tupleValue(ImmutableMap.of("city", "@Seattle")),
tupleValue(ImmutableMap.of("city", "++Seattle"))));
String expected = "city%n" + "@Seattle%n" + "++Seattle";
String expected = "city%n@Seattle%n++Seattle";
assertEquals(format(expected), rawFormatter.format(response));
}

Expand All @@ -163,7 +163,7 @@ void senstiveCharaterWithSanitize() {
Arrays.asList(
tupleValue(ImmutableMap.of("city", "@Seattle")),
tupleValue(ImmutableMap.of("city", "++Seattle|||"))));
String expected = "city%n" + "@Seattle%n" + "\"++Seattle|||\"";
String expected = "city%n@Seattle%n\"++Seattle|||\"";
assertEquals(format(expected), testFormater.format(response));
}

Expand All @@ -183,7 +183,7 @@ void replaceNullValues() {
ImmutableMap.of("firstname", LITERAL_NULL, "city", stringValue("Seattle"))),
ExprTupleValue.fromExprValueMap(
ImmutableMap.of("firstname", stringValue("John"), "city", LITERAL_MISSING))));
String expected = "name|city%n" + "John|Seattle%n" + "|Seattle%n" + "John|";
String expected = "name|city%nJohn|Seattle%n|Seattle%nJohn|";
assertEquals(format(expected), rawFormatter.format(response));
}

Expand Down

0 comments on commit 8acc03a

Please sign in to comment.