У меня есть RestController и функция, которая принимает почтовые запросы.
@RequestMapping(path = "/auth",method = RequestMethod.POST)
public void authenticate(@RequestBody AuthenticationRequest authenticationRequest, HttpServletResponse httpServletResponse) throws IOException {
}
Я пытаюсь оформить почтовый запрос
mockMvc.perform(post("/auth")
.contentType(MediaType.APPLICATION_JSON)
.content("{ \"foo\": \"bar\", \"fruit\": \"apple\" }".getBytes()))
.andDo(print());
я получаю
Resolved Exception:
Type = org.springframework.web.HttpMediaTypeNotSupportedException
Любые идеи обходного пути?
Изменить: я также пытался указать в контроллере потребление = "приложение/json", но все равно не работает.