Answer the question
In order to leave comments, you need to log in
Testing the Spring REST controller. How to disable request forwarding?
Greetings. I am writing a test for a rest controller marked with the @RestController annotation.
In the test, I check that JSON is returned
mockMvc.perform(get(URI).accept(MediaType.APPLICATION_JSON))
.andExpect(status().isOk())
//.andExpect(content().contentType(MediaType.APPLICATION_JSON))
.andDo(print());
Answer the question
In order to leave comments, you need to log in
Answer found. The old version of spring-webmvc 3.2.4 with the old WebMvcConfigurationSupport arrived transitively, in which the necessary bins are not raised, including the resolver I need.
Removed this lib from dependencies. All OK!
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question