Buggy code:
public class MappingJackson2JsonViewTests { private MappingJackson2JsonView 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 MappingJackson2JsonViewTests . 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 MappingJackson2JsonViewTests . TestChildBean child = new MappingJackson2JsonViewTests . TestChildBean ( ) ; public String getValue ( ) { } public boolean getTest ( ) { } public long getNumber ( ) { } public Date getNow ( ) { } public MappingJackson2JsonViewTests . TestChildBean getChild ( ) { } } @ JsonSerialize ( using = MappingJackson2JsonViewTests . TestBeanSimpleSerializer . class ) public static class TestBeanSimpleAnnotated extends MappingJackson2JsonViewTests . TestBeanSimple { } public static class TestChildBean { private String value = "bar" ; private String baz = null ; private MappingJackson2JsonViewTests . TestBeanSimple parent = null ; public String getValue ( ) { } public String getBaz ( ) { } public MappingJackson2JsonViewTests . TestBeanSimple getParent ( ) { } public void setParent ( MappingJackson2JsonViewTests . TestBeanSimple parent ) { } } public static class TestBeanSimpleSerializer extends JsonSerializer < Object > { @ Override public void serialize ( Object value , JsonGenerator jgen , SerializerProvider provider ) throws IOException { } } public static class DelegatingSerializerFactory extends BasicSerializerFactory { private SerializerFactory beanSerializer = BeanSerializerFactory . instance ; protected DelegatingSerializerFactory ( SerializerFactoryConfig config ) { } @ Override public JsonSerializer < Object > createSerializer ( SerializerProvider prov , JavaType type , BeanProperty property ) throws JsonMappingException { } @ Override public SerializerFactory withConfig ( SerializerFactoryConfig config ) { } @ Override protected Iterable < Serializers > customSerializers ( ) { } } }

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