Buggy code:
public class MappingJacksonJsonViewTests { private MappingJacksonJsonView view ; private MockHttpServletRequest request ; private MockHttpServletResponse response ; private Context jsContext ; private ScriptableObject jsScope ; @ Before public void setUp ( ) { } @ Test public void isExposePathVars ( ) { } @ Test public void renderSimpleMap ( ) throws Exception { } @ Test public void renderCaching ( ) throws Exception { } @ Test public void renderSimpleMapPrefixed ( ) throws Exception { } @ Test public void renderSimpleBean ( ) throws Exception { } @ Test public void renderWithPrettyPrint ( ) throws Exception { ModelMap model = new ModelMap ( "foo" , new MappingJacksonJsonViewTests . TestBeanSimple ( ) ) ; view . setPrettyPrint ( true ) ; view . render ( model , request , response ) ; <START_BUG> String result = response . getContentAsString ( ) ; <END_BUG> assertTrue ( ( "Pretty<seq2seq4repair_space>printing<seq2seq4repair_space>not<seq2seq4repair_space>applied:\n" + result ) , result . startsWith ( "{\n<seq2seq4repair_space>\"foo\"<seq2seq4repair_space>:<seq2seq4repair_space>{\n<seq2seq4repair_space>" ) ) ; validateResult ( ) ; } @ Test public void renderSimpleBeanPrefixed ( ) throws Exception { } @ Test public void renderWithCustomSerializerLocatedByAnnotation ( ) throws Exception { } @ Test public void renderWithCustomSerializerLocatedByFactory ( ) throws Exception { } @ Test public void renderOnlyIncludedAttributes ( ) throws Exception { } @ Test public void filterSingleKeyModel ( ) throws Exception { } @ SuppressWarnings ( "rawtypes" ) @ Test public void filterTwoKeyModel ( ) throws Exception { } private void validateResult ( ) throws Exception { } public static class TestBeanSimple { private String value = "foo" ; private boolean test = false ; private long number = 42 ; private MappingJacksonJsonViewTests . TestChildBean child = new MappingJacksonJsonViewTests . TestChildBean ( ) ; public String getValue ( ) { } public boolean getTest ( ) { } public long getNumber ( ) { } public Date getNow ( ) { } public MappingJacksonJsonViewTests . TestChildBean getChild ( ) { } } @ JsonSerialize ( using = MappingJacksonJsonViewTests . TestBeanSimpleSerializer . class ) public static class TestBeanSimpleAnnotated extends MappingJacksonJsonViewTests . TestBeanSimple { } public static class TestChildBean { private String value = "bar" ; private String baz = null ; private MappingJacksonJsonViewTests . TestBeanSimple parent = null ; public String getValue ( ) { } public String getBaz ( ) { } public MappingJacksonJsonViewTests . TestBeanSimple getParent ( ) { } public void setParent ( MappingJacksonJsonViewTests . TestBeanSimple parent ) { } } public static class TestBeanSimpleSerializer extends JsonSerializer < MappingJacksonJsonViewTests . TestBeanSimple > { @ Override public void serialize ( MappingJacksonJsonViewTests . TestBeanSimple value , JsonGenerator jgen , SerializerProvider provider ) throws IOException { } } public static class DelegatingSerializerFactory extends SerializerFactory { private SerializerFactory delegate = BeanSerializerFactory . instance ; @ Override @ SuppressWarnings ( "unchecked" ) public < T > JsonSerializer < T > createSerializer ( Class < T > type , SerializationConfig config ) { } } }

Fix:
String result = response . getContentAsString ( ) . replace ( "\r\n" , "\n" ) ;