运行 Spring Boot 集成测试时,Wiremock 未在日志中显示失败的存根差异

问题描述 投票:0回答:0

Wiremock 不显示请求的差异,在不匹配时被存根。抛出 404 错误并在日志中显示以下消息。

                                           Request was not matched
                                           =======================

------------------------------------------------ ------...(20142 字节)] 例外:[PUT] 期间的 [404 Not Found]

我尝试通过两种方式添加详细日志记录

  1. 加入log4j2.xml
  2. 在 application-test.properties 中尝试过 logging.level.com.github.tomakehurst.wiremock=调试
  3. 使用 RestAssuredMockMvc.enableLoggingOfRequestAndResponseIfValidationFails(LogDetail.ALL);在@BeforeEach 方法中。

没有任何效果。我希望在日志中看到预期的 JSON 和实际的 JSON

spring spring-boot rest-assured wiremock
© www.soinside.com 2019 - 2024. All rights reserved.