예제 #1
0
  @Override
  public void addStubMapping(StubMapping stubMapping) {
    if (stubMapping.getRequest().hasCustomMatcher()) {
      throw new AdminException(
          "Custom matchers can't be used when administering a remote WireMock server. "
              + "Use WireMockRule.stubFor() or WireMockServer.stubFor() to administer the local instance.");
    }

    executeRequest(
        adminRoutes.requestSpecForTask(CreateStubMappingTask.class),
        PathParams.empty(),
        stubMapping,
        Void.class,
        201);
  }
예제 #2
0
 private <B, R> R executeRequest(RequestSpec requestSpec, Class<R> responseType) {
   return executeRequest(requestSpec, PathParams.empty(), null, responseType, 200);
 }
예제 #3
0
 private void executeRequest(RequestSpec requestSpec) {
   executeRequest(requestSpec, PathParams.empty(), null, Void.class, 200);
 }