com.github.tomakehurst.wiremock.client.WireMock.configureFor()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(144)

本文整理了Java中com.github.tomakehurst.wiremock.client.WireMock.configureFor()方法的一些代码示例,展示了WireMock.configureFor()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WireMock.configureFor()方法的具体详情如下:
包路径:com.github.tomakehurst.wiremock.client.WireMock
类名称:WireMock
方法名:configureFor

WireMock.configureFor介绍

暂无

代码示例

代码示例来源:origin: HotelsDotCom/styx

public FakeHttpServer start() {
  configureFor("localhost", adminPort);
  if (!server.isRunning()) {
    server.start();
  }
  return this;
}

代码示例来源:origin: imooc-java/security

public static void main(String[] args) throws IOException {
  // 绑定本地服务器
  configureFor(8062);
  // 清理配置
  removeAllMappings();
  mock("/order/1", "mock/response/order_1.txt");
}

代码示例来源:origin: com.hotels.styx/styx-testsupport

public FakeHttpServer reset() {
  configureFor("localhost", adminPort());
  WireMock.reset();
  return this;
}

代码示例来源:origin: aws/aws-sdk-java-v2

public static void startWireMockServer() {
  WIRE_MOCK.start();
  WireMock.configureFor(WIRE_MOCK.port());
}

代码示例来源:origin: tihomcode/TiHom-Security

public static void main(String[] args) throws IOException {
  configureFor(8082);
  removeAllMappings();
  mock("/order/1","01");
}

代码示例来源:origin: software.amazon.awssdk/protocol-tests-core

public static void startWireMockServer() {
  WIRE_MOCK.start();
  WireMock.configureFor(WIRE_MOCK.port());
}

代码示例来源:origin: HotelsDotCom/styx

public void verify(int count, RequestPatternBuilder builder) {
  configureFor("localhost", adminPort());
  WireMock.verify(count, builder);
}

代码示例来源:origin: com.hotels.styx/styx-testsupport

public FakeHttpServer setDelay(int delay) {
  configureFor("localhost", adminPort());
  WireMock.setGlobalFixedDelay(delay);
  return this;
}

代码示例来源:origin: com.github.tomakehurst/wiremock-jre8

public WireMockStaticRule(int port) {
  wireMockServer = new WireMockServer(port);
  wireMockServer.start();
  WireMock.configureFor("localhost", port);
}

代码示例来源:origin: HotelsDotCom/styx

public FakeHttpServer reset() {
  configureFor("localhost", adminPort());
  WireMock.reset();
  return this;
}

代码示例来源:origin: HotelsDotCom/styx

public FakeHttpServer setDelay(int delay) {
  configureFor("localhost", adminPort());
  WireMock.setGlobalFixedDelay(delay);
  return this;
}

代码示例来源:origin: HotelsDotCom/styx

public FakeHttpServer stub(MappingBuilder mappingBuilder, ResponseDefinitionBuilder response) {
  configureFor("localhost", adminPort());
  stubFor(mappingBuilder.willReturn(response));
  return this;
}

代码示例来源:origin: HotelsDotCom/styx

public MockOriginServer stub(MappingBuilder mappingBuilder, ResponseDefinitionBuilder response) {
  configureFor("localhost", adminPort());
  stubFor(mappingBuilder.willReturn(response));
  return this;
}

代码示例来源:origin: com.hotels.styx/styx-testsupport

public FakeHttpServer stub(MappingBuilder mappingBuilder, ResponseDefinitionBuilder response) {
  configureFor("localhost", adminPort());
  stubFor(mappingBuilder.willReturn(response));
  return this;
}

代码示例来源:origin: HotelsDotCom/styx

public FakeHttpServer stop() {
  configureFor("localhost", adminPort());
  if (server.isRunning()) {
    server.stop();
  }
  return this;
}

代码示例来源:origin: com.hotels.styx/styx-testsupport

public FakeHttpServer stub(UrlMatchingStrategy urlMatchingStrategy, ResponseDefinitionBuilder response) {
  configureFor("localhost", adminPort());
  stubFor(WireMock.get(urlMatchingStrategy).willReturn(response));
  return this;
}

代码示例来源:origin: HotelsDotCom/styx

public FakeHttpServer stub(UrlMatchingStrategy urlMatchingStrategy, ResponseDefinitionBuilder response) {
  configureFor("localhost", adminPort());
  stubFor(WireMock.get(urlMatchingStrategy).willReturn(response));
  return this;
}

代码示例来源:origin: authorjapps/zerocode

public static void restartWireMock(int dynamicPort) {
  wireMockServer = new WireMockServer(wireMockConfig().port(dynamicPort)); // <-- Strange
  /*
   * Stop the wireMock server if it is running previously due to any other tests.
   */
  wireMockServer.stop();
  wireMockServer.start();
  WireMock.configureFor("localhost", dynamicPort); // <-- Repetition of PORT was needed, this is a wireMock bug
}

代码示例来源:origin: georocket/georocket

/**
 * Set up the unit tests
 */
@Before
public void setUp() {
 configureFor("localhost", wireMockRule.port());
 downloadUrl = "http://localhost:" + wireMockRule.port() + "/" + ZIP_NAME;
}

代码示例来源:origin: georocket/georocket

/**
 * Set up test
 * @throws Exception if something goes wrong
 */
@Before
public void setUp() throws Exception {
 configureFor("localhost", wireMockRule.port());
 client = new GeoRocketClient("localhost", wireMockRule.port(), rule.vertx());
}

相关文章