I have a simple controller test that looks like this

```
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = CuponzaApiApplication.class)
@WebAppConfiguration
public class UserControllerTest {

private MockMvc mockMvc;

@Autowired
protected WebApplicationContext wac;

@Autowired
UserRepository userRepository;

@Before
public void setUp(){
    mockMvc = MockMvcBuilders.webAppContextSetup(wac).build();

}

@Test
public void createUser() throws Exception{
    CuponzaUser user = new CuponzaUser("some@test.com", "firstName", "lastName");
    ObjectWriter jackson = new ObjectMapper().writer().withDefaultPrettyPrinter();

    mockMvc.perform(post("/user/add").content(jackson.writeValueAsString(user)).contentType(MediaType.APPLICATION_JSON))
             .andDo(print())
             .andExpect(status().isOk())
             .andExpect(content().contentType("application/json"));

}

```

however it fails saying the following
java.lang.AssertionError: Content type not set

here is my controller

```
@RestController
public class UserController {

@Autowired
UserRepository userRepository;

@RequestMapping(value = "/user/add",method = RequestMethod.POST,produces={MediaType.APPLICATION_JSON_VALUE})
public void AddUser(@RequestBody CuponzaUser user, HttpServletResponse response){

    if(user ==null){
        response.setStatus(HttpStatus.BAD_REQUEST.value());
        return;
    }else{
        user.setCreationDate(new Date());
        user.setLastSeenDate(new Date());
        userRepository.save(user);
        //response.addHeader("Content-Type", MediaType.APPLICATION_JSON_VALUE);
        return;
    }

}

```

I dont want to manually add the content type header for each response , and i thought that the "produces" annotation should take care of this

any ideas?