@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); }
private <B, R> R executeRequest(RequestSpec requestSpec, Class<R> responseType) { return executeRequest(requestSpec, PathParams.empty(), null, responseType, 200); }
private void executeRequest(RequestSpec requestSpec) { executeRequest(requestSpec, PathParams.empty(), null, Void.class, 200); }