![](/img/trans.png)
[英]Spring Cloud Contract - Re-use path variable in request for repsonse
我目前正在嘗試建立這樣的合同: 但是得到一個例外 如果在這里閱讀文檔,這應該是可能的。 如果我使用硬編碼值,它會起作用,例如 有人可以幫我嗎? 非常感謝 ...
[英]Spring Cloud Contract - Re-use path variable in request for repsonse
我目前正在嘗試建立這樣的合同: 但是得到一個例外 如果在這里閱讀文檔,這應該是可能的。 如果我使用硬編碼值,它會起作用,例如 有人可以幫我嗎? 非常感謝 ...
[英]Spring Cloud CDC separate base class configuration
我正在嘗試設置 spring CDC 配置。 但是當我想為映射定義單獨的基類時,我遇到了問題。 當我將其定義為 有用。 但是,當我使用baseClassMappings元素時,出現異常。 我得到的錯誤: java.lang.IllegalStateException:您尚未配置 MockMVC 實 ...
[英]Generated test can't read property from application.yml
剛剛嘗試使用 Spring 雲合同。 在提供者端運行生成的測試並且實例化應用程序上下文時,它無法從 application.yml 讀取配置值。 當我將測試從生成的構建文件夾移動到 src/test/java 時,問題就不再出現了。 這意味着由於構建文件夾在項目 src/.. 結構之外,它無法讀取配 ...
[英]Spring cloud contract: tests based on contracts are not generated on producer side at all
測試不是基於 java 中的合同生成的。我使用 gradle 配置 spring-cloud-contract 並使用 java 作為合同。 當我運行./gradlew clean build -x test時,它拋出非法 state 異常,因為缺少我在 build.gradle 中配置的合同測試( ...
[英]Spring Cloud Contract and Gradle Setup Question
我正在試用 Spring Cloud Contract 但無法正常運行。 我遵循了幾個教程並查看了 spring 提供的存儲庫。 結果總是一樣的: 這是我的 build.gradle 的樣子: 和 BaseTest class: 我懷疑我的 BaseTest class 有一些錯誤,但我對 spri ...
[英]Spring Cloud Contract Consumer side Cannot bind to DefaultKafkaConsumerFactory
我有一個 spring 雲合同消費者,它有以下錯誤。 我不明白為什么我的測試用例無法綁定到 EmbeddedKafka。 回購: https://github.com/Isaacwhyuenac/spring-cloud-contract-poc/ 當我運行https://github.com/I ...
[英]Spring Cloud Contract failed to start Stub Runner
我已經進行了消費者端 spring-cloud-contract 測試,但它在啟動存根服務器時失敗。 我在日志中看到它能夠下載並解壓縮 stub.jar,但隨后失敗並出現以下異常: 我在 Java 8 中使用 mavenBom "org.springframework.cloud:spring- ...
[英]Spring Cloud Contract Tests with Gradle - publish stubs to local repository
我正在使用幾種不同的技術制作一個 Gradle 項目,其中之一是 Spring Cloud Contract。 根據本教程,生產者在執行:build任務后將存根發布到本地 maven 存儲庫。 我正在嘗試使用 Gradle 執行相同的操作,執行:build和:publishToMavenLoca ...
[英]Unable to generate contract tests when using spring-cloud-contract-oa3 and spring cloud contract gradle plugin
當我在 OA3 yml 文件中指定合同然后構建項目時,構建通過但它不會生成合同測試。 如果我將 OA3 yml 合同文件替換為 groovy 等效文件,則構建通過並生成並運行合同測試。 我有以下設置: com.github.mzielinski:spring-cloud-contract- ...
[英]OpenAPI extension for spring cloud contract compatibility with later version of spring-cloud-contract-gradle-plugin
我可以讓 OpenAPI 擴展(guru.springframework:spring-cloud-contract-oa3:2.1.2.0)使用 gradle 來工作 spring 雲合同。 但是,它最多可與 org.springframework.cloud:spring-cloud-cont ...
[英]How to generate and run a single contract test without building all the unit and contract tests in the project? Java Spring Cloud Contract Verifier
我是合同測試的新手。 要運行測試,我使用 maven 命令mvn clean test 。 它運行我項目中的所有測試,spring cloud 生成合同測試類,整個過程需要很多時間。 在開發測試時,我想快速檢查它(生成並運行)。 我想知道是否有任何方法可以只運行一個測試。 對於單元測試,它很簡單—— ...
[英]contractVerifierMessaging.receive is null
我正在以spring-cloud-contract-samples/producer_kafka_middleware/中描述的方式使用測試容器為 Kafka 消息傳遞設置合同測試。 適用於嵌入式 Kafka,但不適用於 TestContainers。 當我嘗試運行生成的 ContractVeri ...
[英]Embedded Kafka contract tests randomly failing
我正在使用 spring cloud contrat 來測試我的服務的 kafkaListsener。 我將 EmbeddedKafka 與 Spring Cloud 合約一起使用。 我服務中的偵聽器由 spring kafka 的 @KafkaListener 實現。 我的合同測試如下: ...
[英]Spring Cloud Contract with multiple requestparts
我正在嘗試編寫合同來測試以下提供商端點 我正在努力編寫一份適用於多個 RequestParts 的合同,例如這樣。 如果我將兩個 String RequestParts 更改為 RequestParams,我可以通過以下約定讓測試通過: 但是有沒有一種方法可以在將所有內容都保留為 RequestPa ...
[英]Spring Cloud Contract: common repository for all microservices
我正在研究微服務架構系統。 我想使用消費者驅動的方法為我們的微服務的所有合約設置一個公共存儲庫。 我以這個樣本為例: https://github.com/spring-cloud/spring-cloud-contract/tree/2.1.x/samples/standalone/contr ...
[英]Spring Cloud Contract: how to prevent Producer to break consumers?
我是 Spring 雲合同的新手,最近我能夠生成生產者合同,並使用安裝在我本地 maven 存儲庫上的存根在消費者端編寫測試。 如果我在生產者端違反合同,然后安裝新的存根,正如預期的那樣,如果我運行消費者測試,它將失敗。 但是想象一下這個場景: 生產者被改變,違反了消費者的合同-a Produc ...
[英]Spring Cloud Contract generates weak tests using bodyFromFile in contract file
我嘗試為get users REST Endpoit 實施簡單的合同。 我希望 Spring Cloud Contract 生成測試 whitch 更強烈地檢查 json 響應。 誰能知道如何配置測試生成器?在此處輸入代碼我的合同yaml文件在這里: 和get_users_response.json ...
[英]Generated test sources not getting invoked as part of the gradle build
添加 Spring Cloud Contract 插件並為 baseClassMappings 配置它 添加了 Spring Cloud Contract 驗證器 為生成的測試添加了所需的基類 定義的 groovy 合約 使用 Test{useunitPlatform()} 識別和執行 ...
[英]No label found exception on cloud contract testing on the consumer side
在使用 rabbitmq 進行 Spring Boot 微服務項目的雲合約測試方面需要您的幫助。 我有一個微服務服務,它向兔子 MQ 通道生成消息,並被另一個監聽它的微服務監聽。 發布方雲合約測試成功完成,並將生成的存根推送到存儲庫。 消費者端測試已編寫完成,但由於無法在存根中找到標簽而失敗。 ...
[英]Do we need to do Consumer Driven Contract Testing Kafka Driven Micro-services when we have the Scheme Registry?
我試圖了解消費者驅動合同 ( CDC ) 的概念在基於 Kafka 的事件驅動架構的上下文中是否仍然有效。 在 RESTful 世界中,消費者驅動的契約驗證至關重要,因為沒有在運行時發生的基於模式演化的兼容性測試的概念。 糟糕的生產者可能會在不通知消費者的情況下隨意更改架構和部署,如果 API 的 ...