Stop pretty printing from truncating content starts as valid JSON

Fixes gh-730
This commit is contained in:
Andy Wilkinson
2021-06-15 11:37:29 +01:00
parent f3e305ab24
commit 88fe8a6f13
2 changed files with 11 additions and 3 deletions

View File

@@ -64,7 +64,14 @@ public class PrettyPrintingContentModifierTests {
this.outputCapture.expect(isEmptyString());
assertThat(new PrettyPrintingContentModifier().modifyContent(content.getBytes(), null))
.isEqualTo(content.getBytes());
}
@Test
public void nonJsonContentThatInitiallyLooksLikeJsonIsHandledGracefully() throws Exception {
String content = "\"abc\",\"def\"";
this.outputCapture.expect(isEmptyString());
assertThat(new PrettyPrintingContentModifier().modifyContent(content.getBytes(), null))
.isEqualTo(content.getBytes());
}
@Test