test spring cloud GateWay by MockMvc can't initialize a bean of type 'WebApplicationContext'

454 Views Asked by At

The major problem description is below [a bean of type 'org.springframework.web.context.WebApplicationContext' that could not be found]

I try many times,and guess adding a spring-boot-web-starter may works,but when i do that,another problem occured.

1

There are 1 best solutions below

1
On

You can't use servlet based solutions with Spring Cloud Gateway since it's reactor based. Please use WebFlux starter instead of spring-boot-web-starter.