I Am trying the below code which used to work earlier but due to a high ‘PATH TRANVERSAL’ vulnerability in older versions of spring webmvc, i had to upgrade to latest version of spring webmvc dependency which is 6.1.13 in the pom file. But after the changes below code started breaking :
@BeforeEach
void setUp() {
this.mockMvc = MockMvcBuilders.standaloneSetup(myController)
.build();
}
It gives below error when I try do mvn install:
java.lang.NoSuchMethodError: 'org.springframework.web.method.HandlerMethod org.springframework.web.method.HandlerMethod.createWithValidateFlags()'
Also, when i run the application it gives below error:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerAdapter' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Post-processing of merged bean definition failed
I checked if i can find anything in the documentation but i am not sure what is the right direction for me now:
https://docs.spring.io/spring-framework/reference/testing/webtestclient.html#webtestclient-controller-config
Meenal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2