Search code examples
spring-webfluxspring-cloud-contract

Why Spring Cloud Contract with Reactive Webflux mandate EXPLICIT testmode


We have an option of using RestAssuredMockMVC or RestAssured while writing cloud contracts for Spring MVC. By RestAssuredMockMVC we can mock the controller and no need of starting the context. And via RestAssured we can use the direct call the controller via physical API using the testmode =EXPLICIT.

But, while using Reactive Webflux, we have been limited to RestAssured only and we have to make context up and running.

Why can't we have an option of mocking the controller here as well?


Solution

  • We will, there's an open issue for that to start using WebTestClient - https://github.com/spring-cloud/spring-cloud-contract/issues/422 . If you're interested in the feature go ahead add +1 and / or file a PR :)