java如何将JaxRS响应转换为Wiremock响应
我有一个上游REST服务,它以application/x-protobuf
类型返回响应。
我能够在我的集成测试类中成功地创建JaxRsResponse对象。但是,我不知道如何使用该对象在wiremock中创建存根响应。
我尝试使用以下方法,但它对我不起作用,并因protobuf错误无效而失败
wireMockStub.stubFor(get(urlPathMatching(String.format("my-testing-url-hidden", TEST_HOTEL_ID))).
willReturn(aResponse().
withBody(upstreamResponse.getEntity().toString()).
withHeader("Content-Type", "application/x-protobuf")));
感谢您的帮助。 非常感谢
共 (0) 个答案