使用顯式模式的 WebFlux

您還可以在生成的測試中使用 WebFlux 的顯式模式來處理 WebFlux。以下示例展示瞭如何配置使用顯式模式。

Maven
<plugin>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-contract-maven-plugin</artifactId>
    <version>${spring-cloud-contract.version}</version>
    <extensions>true</extensions>
    <configuration>
        <testMode>EXPLICIT</testMode>
    </configuration>
</plugin>
Gradle
contracts {
		testMode = 'EXPLICIT'
}

以下示例展示瞭如何為 Web Flux 設定一個基類和 RestAssured。

© . This site is unofficial and not affiliated with VMware.