Wiremock 与 Spring Boot:什么是 blob 存储?

问题描述 投票:0回答:1
@SpringBootApplication
public class WiremockDemoApplication implements CommandLineRunner {

    private WireMockServer wireMockServer;

    public static void main(String[] args) {
        SpringApplication.run(WiremockDemoApplication.class, args);
    }

    @Override
    public void run(String... args) throws Exception {
        wireMockServer = new WireMockServer(options()
                .port(8090));

        wireMockServer.start();
        wireMockServer.stubFor(get(urlPathEqualTo("/bind-test"))
                .willReturn(aResponse()
                        .withBodyFile("stub_1.json")
                        .withHeader("header1", "poks")
                        //.withBody("heipta")
                        .withStatus(200)));
    }
}

返回错误:

com.github.tomakehurst.wiremock.admin.NotFoundException: Not found in blob store: stub_1.json

什么是“blob 商店”。我无法从文档中找到它。

我应该将存根文件放在哪里?在此示例中为“stub_1.json”。

spring-boot rest wiremock
1个回答
0
投票

读取文本文件并将其粘贴到“withBody(“xxx”)

© www.soinside.com 2019 - 2024. All rights reserved.