Skip to content

Commit 12e971a

Browse files
committed
Refactor naming
1 parent a894ae4 commit 12e971a

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/main/java/com/cdpn/jsonautorepair/internal/EscapeProcessor.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@ private void handleNonQuoteCharacter(char currentChar) {
7878
return;
7979
}
8080
if(currentChar == TAB_CHAR || currentChar == BREAK_LINE_CHAR) {
81-
escapedJson.append(getEscapeSequence(currentChar));
81+
escapedJson.append(getEscapeStringFromChar(currentChar));
8282
return;
8383
}
8484
escapedJson.append(currentChar);
8585
}
8686

87-
private String getEscapeSequence(char currentChar) {
87+
private String getEscapeStringFromChar(char currentChar) {
8888
return switch (currentChar) {
8989
case TAB_CHAR -> "\\t";
9090
case BREAK_LINE_CHAR -> "\\n";

src/test/java/com/cdpn/jsonautorepair/EscapeProcessorTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public void process_should_return_same_string_when_there_is_no_internal_quote()
3838
}
3939

4040
@Test
41-
public void process_should_escape_already_escaped_character() {
41+
public void process_should_not_escape_already_escaped_character() {
4242
String originalJSON ="{\"address\":\"123 Andrew Street,\\n \\tward 3\"}";
4343
EscapeProcessor processor = new EscapeProcessor(originalJSON);
4444
assertEquals("{\"address\":\"123 Andrew Street,\\n \\tward 3\"}",

src/test/java/com/cdpn/jsonautorepair/JSONAutoRepairerTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public void repair_should_cleanup_markdown_code_block_when_string_contain_json_c
4040

4141

4242
@Test
43-
public void repair_should_return_original_string_when_the_string_is_a_valid_JSON() {
43+
public void repair_should_return_good_JSON_string_output_when_the_string_is_a_valid_JSON() {
4444
String originalJSON = """
4545
{
4646
"name": "Alice",

0 commit comments

Comments
 (0)