Buggy code:
public class MappingJacksonJsonViewTest { 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 { Map < String , Object > model = new HashMap < String , Object > ( ) ; model . put ( "bindingResult" , createMock ( "binding_result" , BindingResult . class ) ) ; model . put ( "foo" , "bar" ) ; view . render ( model , request , response ) ; assertEquals ( "no-cache" , response . getHeader ( "Pragma" ) ) ; assertEquals ( "no-cache,<seq2seq4repair_space>no-store,<seq2seq4repair_space>max-age=0" , response . getHeader ( "Cache-Control" ) ) ; assertNotNull ( response . getHeader ( "Expires" ) ) ; <START_BUG> assertEquals ( DEFAULT_CONTENT_TYPE , response . getContentType ( ) ) ; <END_BUG> String jsonResult = response . getContentAsString ( ) ; assertTrue ( ( ( jsonResult . length ( ) ) > 0 ) ) ; validateResult ( ) ; } @ Test public void renderCaching ( ) throws Exception { } @ Test public void renderSimpleMapPrefixed ( ) throws Exception { } @ Test public void renderSimpleBean ( ) throws Exception { } @ 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 MappingJacksonJsonViewTest . TestChildBean child = new MappingJacksonJsonViewTest . TestChildBean ( ) ; public String getValue ( ) { } public boolean getTest ( ) { } public long getNumber ( ) { } public Date getNow ( ) { } public MappingJacksonJsonViewTest . TestChildBean getChild ( ) { } } @ JsonSerialize ( using = MappingJacksonJsonViewTest . TestBeanSimpleSerializer . class ) public static class TestBeanSimpleAnnotated extends MappingJacksonJsonViewTest . TestBeanSimple { } public static class TestChildBean { private String value = "bar" ; private String baz = null ; private MappingJacksonJsonViewTest . TestBeanSimple parent = null ; public String getValue ( ) { } public String getBaz ( ) { } public MappingJacksonJsonViewTest . TestBeanSimple getParent ( ) { } public void setParent ( MappingJacksonJsonViewTest . TestBeanSimple parent ) { } } public static class TestBeanSimpleSerializer extends JsonSerializer < MappingJacksonJsonViewTest . TestBeanSimple > { @ Override public void serialize ( MappingJacksonJsonViewTest . 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:
assertEquals ( ( ( MappingJacksonJsonView . DEFAULT_CONTENT_TYPE ) + ";charset=UTF-8" ) , response . getContentType ( ) ) ;