diff --git a/.github/workflows/deploy-preview.yaml b/.github/workflows/deploy-preview.yaml new file mode 100644 index 00000000..6182dc04 --- /dev/null +++ b/.github/workflows/deploy-preview.yaml @@ -0,0 +1,69 @@ +name: Deploy Jekyll site to Pages + +on: + # Runs on pushes targeting the default branch + push: + branches: ["master", "cd-public-preview", "website-2.0"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Build job + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Ruby + uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0 + with: + ruby-version: '2.7.6' # Not needed with a .ruby-version file + bundler: '2.4.10' + bundler-cache: false # runs 'bundle install' and caches installed gems automatically + cache-version: 3 # Increment this number if you need to re-download cached gems + - name: Setup Pages + id: pages + uses: actions/configure-pages@v3 + - name: Update RubyGems and Co + run: gem update --system + - name: Install Ruby Bundles + run: bundle install + - name: Build with Jekyll + # Outputs to the './_site' directory by default + run: bundle exec jekyll build --config '_config_preview_public.yml' --baseurl "${{ steps.pages.outputs.base_path }}" + env: + JEKYLL_ENV: development +# TODO: Uncomment when cleaned up (if ever) +# - name: Validate HTML and links +# uses: anishathalye/proof-html@v2 +# with: +# directory: ./_site +# enforce_https: false + - name: Upload artifact + # Automatically uploads an artifact from the './_site' directory by default + uses: actions/upload-pages-artifact@v1 + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 diff --git a/.gitignore b/.gitignore index c2c89006..fcfaeba9 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,6 @@ main.min.js main.css .idea/ -vendor +/vendor **/.DS_Store diff --git a/Gemfile.lock b/Gemfile.lock index 8df68acc..a383af67 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,134 +1,116 @@ GEM remote: https://rubygems.org/ specs: - activesupport (7.0.2.3) + activesupport (7.0.4.3) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) + addressable (2.8.3) + public_suffix (>= 2.0.2, < 6.0) colorator (1.1.0) - concurrent-ruby (1.1.9) + concurrent-ruby (1.2.2) em-websocket (0.5.3) eventmachine (>= 0.12.9) http_parser.rb (~> 0) eventmachine (1.2.7) eventmachine (1.2.7-x64-mingw32) - faraday (1.10.0) - faraday-em_http (~> 1.0) - faraday-em_synchrony (~> 1.0) - faraday-excon (~> 1.1) - faraday-httpclient (~> 1.0) - faraday-multipart (~> 1.0) - faraday-net_http (~> 1.0) - faraday-net_http_persistent (~> 1.0) - faraday-patron (~> 1.0) - faraday-rack (~> 1.0) - faraday-retry (~> 1.0) + faraday (2.7.4) + faraday-net_http (>= 2.0, < 3.1) ruby2_keywords (>= 0.0.4) - faraday-em_http (1.0.0) - faraday-em_synchrony (1.0.0) - faraday-excon (1.1.0) - faraday-httpclient (1.0.1) - faraday-multipart (1.0.3) - multipart-post (>= 1.2, < 3) - faraday-net_http (1.0.1) - faraday-net_http_persistent (1.2.0) - faraday-patron (1.0.0) - faraday-rack (1.0.0) - faraday-retry (1.0.3) + faraday-net_http (3.0.2) ffi (1.15.5) ffi (1.15.5-x64-mingw32) forwardable-extended (2.6.0) - gemoji (3.0.1) - html-pipeline (2.14.0) + gemoji (4.1.0) + google-protobuf (3.22.2-x64-mingw32) + google-protobuf (3.22.2-x86_64-linux) + html-pipeline (2.14.3) activesupport (>= 2) nokogiri (>= 1.4) http_parser.rb (0.8.0) - i18n (1.10.0) + i18n (1.12.0) concurrent-ruby (~> 1.0) - jekyll (4.2.2) + jekyll (4.3.2) addressable (~> 2.4) colorator (~> 1.0) em-websocket (~> 0.5) i18n (~> 1.0) - jekyll-sass-converter (~> 2.0) + jekyll-sass-converter (>= 2.0, < 4.0) jekyll-watch (~> 2.0) - kramdown (~> 2.3) + kramdown (~> 2.3, >= 2.3.1) kramdown-parser-gfm (~> 1.0) liquid (~> 4.0) - mercenary (~> 0.4.0) + mercenary (>= 0.3.6, < 0.5) pathutil (~> 0.9) - rouge (~> 3.0) + rouge (>= 3.0, < 5.0) safe_yaml (~> 1.0) - terminal-table (~> 2.0) - jekyll-feed (0.16.0) + terminal-table (>= 1.8, < 4.0) + webrick (~> 1.7) + jekyll-feed (0.17.0) jekyll (>= 3.7, < 5.0) jekyll-gist (1.5.0) octokit (~> 4.2) jekyll-paginate (1.1.0) jekyll-redirect-from (0.16.0) jekyll (>= 3.3, < 5.0) - jekyll-sass-converter (2.2.0) - sassc (> 2.0.1, < 3.0) + jekyll-sass-converter (3.0.0) + sass-embedded (~> 1.54) jekyll-sitemap (1.4.0) jekyll (>= 3.7, < 5.0) jekyll-watch (2.2.1) listen (~> 3.0) - jemoji (0.12.0) - gemoji (~> 3.0) + jemoji (0.13.0) + gemoji (>= 3, < 5) html-pipeline (~> 2.2) jekyll (>= 3.0, < 5.0) json (1.8.6) - kramdown (2.3.1) + kramdown (2.4.0) rexml kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) - liquid (4.0.3) - listen (3.7.1) + liquid (4.0.4) + listen (3.8.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) mercenary (0.4.0) - mini_portile2 (2.8.0) - minitest (5.15.0) - multipart-post (2.1.1) - nokogiri (1.13.3) - mini_portile2 (~> 2.8.0) + minitest (5.18.0) + nokogiri (1.14.2-x64-mingw32) racc (~> 1.4) - nokogiri (1.13.3-x64-mingw32) + nokogiri (1.14.2-x86_64-linux) racc (~> 1.4) - octokit (4.22.0) - faraday (>= 0.9) - sawyer (~> 0.8.0, >= 0.5.3) + octokit (4.25.1) + faraday (>= 1, < 3) + sawyer (~> 0.9) pathutil (0.16.2) forwardable-extended (~> 2.6) - public_suffix (4.0.6) - racc (1.6.0) - rb-fsevent (0.11.1) + public_suffix (5.0.1) + racc (1.6.2) + rake (13.0.6) + rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) rexml (3.2.5) - rouge (3.28.0) + rouge (4.1.0) ruby2_keywords (0.0.5) safe_yaml (1.0.5) - sassc (2.4.0) - ffi (~> 1.9) - sassc (2.4.0-x64-mingw32) - ffi (~> 1.9) - sawyer (0.8.2) + sass-embedded (1.60.0) + google-protobuf (~> 3.21) + rake (>= 10.0.0) + sawyer (0.9.2) addressable (>= 2.3.5) - faraday (> 0.8, < 2.0) - terminal-table (2.0.0) - unicode-display_width (~> 1.1, >= 1.1.1) - tzinfo (2.0.4) + faraday (>= 0.17.3, < 3) + terminal-table (3.0.2) + unicode-display_width (>= 1.1.1, < 3) + tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (1.8.0) - webrick (1.7.0) + unicode-display_width (2.4.2) + wdm (0.1.1) + webrick (1.8.1) PLATFORMS - ruby x64-mingw32 + x86_64-linux DEPENDENCIES jekyll (~> 4) @@ -140,7 +122,8 @@ DEPENDENCIES jemoji json (~> 1.8.6) nokogiri (>= 1.7.2) + wdm (~> 0.1.0) webrick (~> 1.7) BUNDLED WITH - 2.3.8 + 2.4.10 diff --git a/_config.yml b/_config.yml index 48581115..279216d0 100644 --- a/_config.yml +++ b/_config.yml @@ -129,6 +129,9 @@ keep_files: encoding: "utf-8" markdown_ext: "markdown,mkdown,mkdn,mkd,md" +sass: + sass_dir: _sass + # Conversion markdown: kramdown highlighter: rouge diff --git a/_config_preview_public.yml b/_config_preview_public.yml new file mode 100644 index 00000000..52edffe9 --- /dev/null +++ b/_config_preview_public.yml @@ -0,0 +1,182 @@ +# This config file is for publishing preview on GitHub Pages + +# Site Settings +locale: "en-US" +title: "WireMock" +title_separator: "|" +name: "Tom Akehurst" +description: "WireMock is a flexible API mocking tool for fast, robust and comprehensive testing." +url: "https://wiremock.github.io" +baseurl: "/wiremock.org-sources/" +gh_repo: +teaser: # filename of teaser fallback teaser image placed in /images/, .e.g. "500x300.png" +# breadcrumbs : false # true, false (default) +words_per_minute: 200 + +# SEO Related +google_site_verification: +bing_site_verification: +alexa_site_verification: +yandex_site_verification: + +# Social Sharing +twitter: + username: +facebook: + username: + app_id: + publisher: +og_image: # Open Graph/Twitter default site image +# For specifying social profiles +# - https://developers.google.com/structured-data/customize/social-profiles +social: + type: # Person or Organization (defaults to Person) + name: # If the user or organization name differs from the site's name + links: # An array of links to social media profiles + +# Site Author +author: + name: "Your Name" + avatar: "bio-photo.jpg" + bio: "I am an amazing person." + location: "Somewhere" + email: + uri: + bitbucket: + codepen: + dribbble: + flickr: + facebook: + foursquare: + github: + google_plus: + keybase: + instagram: + lastfm: + linkedin: + pinterest: + soundcloud: + stackoverflow: # http://stackoverflow.com/users/123456/username + steam: + tumblr: + twitter: + vine: + weibo: + xing: + youtube: + +# Reading Files +include: + - .htaccess + - _pages +exclude: + - vendor/ + - "*.sublime-project" + - "*.sublime-workspace" + - .asset-cache + - .bundle + - .jekyll-assets-cache + - .sass-cache + - assets/js/plugins + - assets/js/_main.js + - assets/js/vendor + - Capfile + - CHANGELOG + - config + - Gemfile + - Gruntfile.js + - gulpfile.js + - LICENSE + - log + - node_modules + - package.json + - Rakefile + - README + - tmp +keep_files: + - .git + - .svn +encoding: "utf-8" +markdown_ext: "markdown,mkdown,mkdn,mkd,md" + +sass: + sass_dir: _sass + +# Conversion +markdown: kramdown +highlighter: rouge +lsi: false +excerpt_separator: "\n\n" +incremental: false + +# Markdown Processing +kramdown: + input: GFM + hard_wrap: false + auto_ids: true + footnote_nr: 1 + entity_output: as_char + toc_levels: 1..6 + smart_quotes: lsquo,rsquo,ldquo,rdquo + +# Outputting +permalink: /blog/:title/ +paginate: 5 # amount of posts to show +paginate_path: /blog/page:num/ +# timezone: # http://en.wikipedia.org/wiki/List_of_tz_database_time_zones + +# Plugins +plugins: + - jekyll-redirect-from + - jekyll-paginate + - jekyll-sitemap + - jekyll-gist + - jekyll-feed + - jemoji + +# mimic GitHub Pages with --safe +whitelist: + - jekyll-paginate + - jekyll-sitemap + - jekyll-gist + - jekyll-feed + - jemoji + +# Archives +# Type +# - GitHub Pages compatible archive pages built with Liquid ~> type: liquid (default) +# - Jekyll Archives plugin archive pages ~> type: jekyll-archives +# Path (examples) +# - Archive page should exist at path when using Liquid method or you can +# expect broken links (especially with breadcrumbs enabled) +# - /tags/my-awesome-tag/index.html ~> path: /tags/ +# - path: /categories/ +# - path: / +category_archive: + type: liquid + path: /categories/ +tag_archive: + type: liquid + path: /tags/ + +collections: + studio_docs: + output: true + permalink: /studio/docs/:path/ + docs: + output: true + permalink: /docs/:path/ + + +# HTML Compression +# - http://jch.penibelst.de/ +compress_html: + clippings: all + ignore: + envs: development + +wiremock_version: 2.35.0 +wiremock_beta_version: 3.0.0-beta-2 + +community_slack: + join_url: https://join.slack.com/t/wiremock-community/shared_invite/zt-1mkbo0zlx-gxeZdTJ15Kchdt888Fn_1A diff --git a/_docs/api.md b/_docs/api.md index eb40d6f0..6618fd2f 100644 --- a/_docs/api.md +++ b/_docs/api.md @@ -7,10 +7,10 @@ description: The WireMock admin API is described in OpenAPI 3.0. redirect_from: "/wiremock-admin-api.html" --- -The WireMock admin API is described in [OpenAPI 3.0](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md). The spec file plus an instance of Swagger UI can be accessed from a running WireMock instance under `/__admin/docs/`, e.g. [http://localhost:8080/\_\_admin/docs/](http://localhost:8080/__admin/docs/) +The WireMock admin API is described in [OpenAPI 3.0](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md). The spec file plus an instance of Swagger UI can be accessed from a running WireMock instance under `/__admin/docs/`, e.g. `http://localhost:8080/__admin/docs/`. Below is the full API reference: - + - + diff --git a/_docs/configuration.md b/_docs/configuration.md index 0f3d786d..09e15169 100644 --- a/_docs/configuration.md +++ b/_docs/configuration.md @@ -175,7 +175,7 @@ Gzipping of responses can be disabled. ## Extensions -For details see [Extending WireMock](/docs/extending-wiremock/). +For details see [Extending WireMock](../extending-wiremock/). ```java // Add extensions diff --git a/_docs/docker.md b/_docs/docker.md index b1257efd..e957c87c 100644 --- a/_docs/docker.md +++ b/_docs/docker.md @@ -22,7 +22,7 @@ docker run -it --rm \ ### Start with command line arguments -The Docker image supports exactly the same set of command line arguments as the [standalone version](/docs/running-standalone/#command-line-options). +The Docker image supports exactly the same set of command line arguments as the [standalone version](../running-standalone#command-line-options). These can be passed to the container by appending them to the end of the command e.g.: ```sh @@ -50,10 +50,10 @@ docker run -it --rm \ ### Running with extensions -[WireMock extensions](/docs/extending-wiremock/) are packaged as JAR files. In order to use them they need to be made +[WireMock extensions](../extending-wiremock/) are packaged as JAR files. In order to use them they need to be made available at runtime and WireMock must be configured to enable them. -For example, to use the [Webhooks extension](/docs/webhooks-and-callbacks/) we would first download [wiremock-webhooks-extension-{{ site.wiremock_version }}.jar](https://repo1.maven.org/maven2/org/wiremock/wiremock-webhooks-extension/{{ site.wiremock_version }}/wiremock-webhooks-extension-{{ site.wiremock_version }}.jar) +For example, to use the [Webhooks extension](../webhooks-and-callbacks/) we would first download [wiremock-webhooks-extension-{{ site.wiremock_version }}.jar](https://repo1.maven.org/maven2/org/wiremock/wiremock-webhooks-extension/{{ site.wiremock_version }}/wiremock-webhooks-extension-{{ site.wiremock_version }}.jar) into the `extensions` directory under our working directory. Then when starting Docker we would mount the extensions directory to `/var/wiremock/extensions` and enable the webhooks extension diff --git a/_docs/download-and-installation.md b/_docs/download-and-installation.md index 81267979..c40898f9 100644 --- a/_docs/download-and-installation.md +++ b/_docs/download-and-installation.md @@ -10,7 +10,7 @@ WireMock is distributed in two flavours - a standard JAR containing just WireMoc WireMock plus all its dependencies. Most of the standalone JAR's dependencies are shaded i.e. they are hidden in alternative packages. This allows WireMock to be used in projects with -conflicting versions of its dependencies. The standalone JAR is also runnable (see [Running as a Standalone Process](/docs/running-standalone/)). +conflicting versions of its dependencies. The standalone JAR is also runnable (see [Running as a Standalone Process](../running-standalone/)). Additionally, versions of these JARs are distributed for both Java 7 and Java 8+. diff --git a/_docs/extending-wiremock.md b/_docs/extending-wiremock.md index 45eb9221..002468ce 100644 --- a/_docs/extending-wiremock.md +++ b/_docs/extending-wiremock.md @@ -23,7 +23,7 @@ new WireMockServer(wireMockConfig() .extensions(new BodyContentTransformer(), new HeaderMangler())); ``` -See [Running as a Standalone Process](/docs/running-standalone/) for details on running with extensions from the command line. +See [Running as a Standalone Process](../running-standalone/) for details on running with extensions from the command line. ## Transforming Responses diff --git a/_docs/getting-started.md b/_docs/getting-started.md index cd80b853..608f16c2 100644 --- a/_docs/getting-started.md +++ b/_docs/getting-started.md @@ -31,7 +31,7 @@ testImplementation "com.github.tomakehurst:wiremock-jre8:{{ site.wiremock_versio ``` WireMock is also shipped in Java 7 and standalone versions, both of which work better in certain contexts. -See [Download and Installation](/docs/download-and-installation/) for details. +See [Download and Installation](../download-and-installation/) for details. ## Writing a test with JUnit 4.x @@ -74,9 +74,9 @@ For many more examples of JUnit tests look no further than [WireMock's own acceptance tests](https://github.com/tomakehurst/wiremock/tree/master/src/test/java/com/github/tomakehurst/wiremock) -For more details on verifying requests and stubbing responses, see [Stubbing](/docs/stubbing) and [Verifying](/docs/verifying/) +For more details on verifying requests and stubbing responses, see [Stubbing](../stubbing) and [Verifying](../verifying/) -For more information on the JUnit rule see [The JUnit Rule](/docs/junit-rule/). +For more information on the JUnit rule see [The JUnit Rule](../junit-rule/). ## Changing port numbers @@ -112,7 +112,7 @@ int httpsPort = wireMockRule.httpsPort(); ## Writing a test with JUnit 5.x -See [JUnit 5+ Jupiter Usage](/docs/junit-jupiter/) for various JUnit 5 usage scenarios. +See [JUnit 5+ Jupiter Usage](../junit-jupiter/) for various JUnit 5 usage scenarios. ## Non-JUnit and general Java usage @@ -157,7 +157,7 @@ This will start the server on port 8080: You can download the standalone JAR from here. -See [Running as a Standalone Process](/docs/running-standalone/) running-standalone for more details and commandline options. +See [Running as a Standalone Process](../running-standalone/) running-standalone for more details and commandline options. ## Fetching all of your stub mappings (and checking WireMock is working) diff --git a/_docs/https.md b/_docs/https.md index 4925e5fa..e6c1cc05 100644 --- a/_docs/https.md +++ b/_docs/https.md @@ -71,7 +71,7 @@ specify a trust store containing the certificate(s). ## Common HTTPS issues `javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?`: Usually means you've tried to connect to the -HTTP port with a client that's expecting HTTPS (i.e. has https:// in the URL). +HTTP port with a client that's expecting HTTPS (i.e. has `https://` in the URL). `org.apache.hc.core5.http.NoHttpResponseException: The target server failed to respond`: Could mean you've tried to connect to the HTTPS port with a client expecting HTTP. diff --git a/_docs/index.md b/_docs/index.md index db097740..4ecede95 100644 --- a/_docs/index.md +++ b/_docs/index.md @@ -19,4 +19,4 @@ All of WireMock's features are accessible via its REST (JSON) interface and its If you have any questions that aren't answered here please post them on the [mailing list](https://groups.google.com/forum/#!forum/wiremock-user). -Ready to try it? Head to the [Getting Started](/docs/getting-started/) page. +Ready to try it? Head to the [Getting Started]( ./getting-started/ ) page. diff --git a/_docs/java-usage.md b/_docs/java-usage.md index 86e553af..ed94566e 100644 --- a/_docs/java-usage.md +++ b/_docs/java-usage.md @@ -21,9 +21,9 @@ wireMockServer.start(); wireMockServer.stop(); ``` -For more details of the `options()` builder accepted by the constructor see [Configuration](/docs/configuration/) for details. +For more details of the `options()` builder accepted by the constructor see [Configuration](../configuration/) for details. -As with stubbing and verification via the [JUnit rule](/docs/junit-rule/) you can call the +As with stubbing and verification via the [JUnit rule](../junit-rule/) you can call the stubbing/verifying DSL from the server object as an alternative to calling the client. diff --git a/_docs/junit-extensions.md b/_docs/junit-extensions.md index c2d14f2e..5f7f1880 100644 --- a/_docs/junit-extensions.md +++ b/_docs/junit-extensions.md @@ -33,7 +33,7 @@ various settings. An `Options` implementation can be created via the public WireMockRule wireMockRule = new WireMockRule(options().port(8888).httpsPort(8889)); ``` -See [Configuration](/docs/configuration/) for details. +See [Configuration](../configuration/) for details. ## Unmatched requests diff --git a/_docs/junit-jupiter.md b/_docs/junit-jupiter.md index 78348058..7ced6c96 100644 --- a/_docs/junit-jupiter.md +++ b/_docs/junit-jupiter.md @@ -161,7 +161,7 @@ This behavior can be changed by calling `.failOnUnmatchedRequests(false)` on the ## Proxy mode The JUnit Jupiter extension can be configured to enable "proxy mode" which simplifies configuration and supports -[multi-domain mocking](/docs/multi-domain-mocking/). +[multi-domain mocking](../multi-domain-mocking/). ### Declarative diff --git a/_docs/multi-domain-mocking.md b/_docs/multi-domain-mocking.md index 0b21180d..ecb8b420 100644 --- a/_docs/multi-domain-mocking.md +++ b/_docs/multi-domain-mocking.md @@ -23,7 +23,7 @@ The following sections detail how to achieve this in various deployment contexts ## Configuring for JUnit Jupiter The simplest way to enable this mode if you're using JUnit Jupiter it to toggle it on via the `WireMockExtension`. See the -[Junit Jupiter Proxy Mode](/docs/junit-jupiter/#proxy-mode) for details. +[Junit Jupiter Proxy Mode](../junit-jupiter#proxy-mode) for details. ## Configuring for JUnit 4.x diff --git a/_docs/proxying.md b/_docs/proxying.md index 51e24bed..8eaa6115 100644 --- a/_docs/proxying.md +++ b/_docs/proxying.md @@ -13,7 +13,7 @@ default proxied to another (possibly real, live) service, but where specific stubs are configured these are returned in place of the remote service's response. Responses that the live service can't be forced to generate on demand can thus be injected for testing. Proxying also -supports [record and playback](/docs/record-playback/). +supports [record and playback](../record-playback/). # Proxy stub mappings @@ -122,14 +122,14 @@ or } ``` -You can also add response headers via the same method as for non-proxy responses (see [Stubbing](/docs/stubbing/)). +You can also add response headers via the same method as for non-proxy responses (see [Stubbing](../stubbing/)). ## Standalone shortcut It is possible to start the standalone running with the catch-all stub already configured: -Then it's simply a case of adding your stub mapping `.json` files under `mappings` as usual (see [Stubbing](/docs/stubbing/)). +Then it's simply a case of adding your stub mapping `.json` files under `mappings` as usual (see [Stubbing](../stubbing/)). ## Running as a browser proxy @@ -145,9 +145,9 @@ $ java -jar wiremock-standalone-{{ site.wiremock_version }}.jar --enable-browser ``` Then open your browser's proxy settings and point them to the running server: -Firefox proxy screenshot +Firefox proxy screenshot -After that, you can configure stubs as described in [Running Standalone](/docs/running-standalone/#configuring-wiremock-using-the-java-client) and then browse to a website. Any resources fetched whose requests are matched by stubs you have configured will be overridden by the stub's response. +After that, you can configure stubs as described in [Running Standalone](../running-standalone#configuring-wiremock-using-the-java-client) and then browse to a website. Any resources fetched whose requests are matched by stubs you have configured will be overridden by the stub's response. So for instance, say you're visiting a web page that fetches a user profile via an AJAX call to `/users/12345.json` and you wanted to test how it responded to a server unavailable response. You could create a stub like this and the response from the server would be swapped for a 503 response: @@ -160,13 +160,13 @@ stubFor(get(urlEqualTo("/users/12345.json")) Also, we can enable/disable pass through unmatched requests to the target indicated by the original requests by enabling/disabling proxyPassThrough flag. By default, flag is set to true. -This flag can be enabled/disabled at startup either by passing CLI option while running jar as described in [Running Standalone](/docs/running-standalone/#command-line-options) or by passing as options in Java client as shown below. +This flag can be enabled/disabled at startup either by passing CLI option while running jar as described in [Running Standalone](../running-standalone#command-line-options) or by passing as options in Java client as shown below. ```java WireMockServer wireMockServer = new WireMockServer(options().proxyPassThrough(false)); ``` -We can also update this flag without WireMock restart either by using Admin API as described in [API section](/docs/api/#tag/System/paths/~1__admin~1settings/post) if we are running as standalone or by updating the global settings in Java client. +We can also update this flag without WireMock restart either by using Admin API as described in [API section](../api/#tag/System/paths/~1__admin~1settings/post) if we are running as standalone or by updating the global settings in Java client. Json payload to update via admin API ```json @@ -315,4 +315,4 @@ public WireMockRule wireMockRule = new WireMockRule(wireMockConfig() .trustStorePassword("mostsecret")); // Defaults to "password" if omitted ``` -See [Running as a Standalone Process](/docs/running-standalone/) for command line equivalent. +See [Running as a Standalone Process](../running-standalone/) for command line equivalent. diff --git a/_docs/record-playback-legacy.md b/_docs/record-playback-legacy.md index 2c050b1d..1eb13421 100644 --- a/_docs/record-playback-legacy.md +++ b/_docs/record-playback-legacy.md @@ -45,7 +45,7 @@ PUT). This is done by adding an extra parameter to the command line e.g. ## Playback -If you start the standalone runner again without the extra commandline +If you start the standalone runner again without the extra command line options it will automatically load the newly created stub mappings and start serving them. diff --git a/_docs/record-playback.md b/_docs/record-playback.md index c59f87ee..85f1d384 100644 --- a/_docs/record-playback.md +++ b/_docs/record-playback.md @@ -18,11 +18,11 @@ Both approaches are described in more detail below. The fastest way to get started with WireMock's recorder is to use the simple web UI provided. -First, start an instance of [WireMock running standalone](/docs/running-standalone). +First, start an instance of [WireMock running standalone](../running-standalone). Once that's running visit the recorder UI page at [http://localhost:8080/\_\_admin/recorder](http://localhost:8080/__admin/recorder) (assuming you started WireMock on the default port of 8080). -![Recorder UI]({{ base_path }}/images/recorder-screenshot.png) +![Recorder UI]({{ '/images/recorder-screenshot.png' | absolute_url }}) Enter the URL you wish to record from in the target URL field and click the Record button. You can use `http://example.mocklab.io` to try it out. @@ -97,7 +97,7 @@ Snapshotting is effectively "recording after the fact". Rather than starting rec into stub mappings. An implication of this order of events is that if you want to record an external API, you'll need to have configured proxying before you start generating traffic. -See [Proxying](/docs/proxying) for details on proxy configuration, but in summary this can be achieved by creating a proxy mapping via the API or Java DSL: +See [Proxying](../proxying) for details on proxy configuration, but in summary this can be achieved by creating a proxy mapping via the API or Java DSL: Java: @@ -269,7 +269,7 @@ The following sections will detail each parameter in turn: ### Filtering -`filters` supports selection of requests to be recorded according to the same [request matcher](/docs/request-matching) format used elsewhere in WireMock. +`filters` supports selection of requests to be recorded according to the same [request matcher](../request-matching) format used elsewhere in WireMock. Additionally, when snapshotting the `ids` parameter allows specific serve events to be selected by ID. @@ -329,7 +329,7 @@ What happens when the recorder sees two identical requests that produce differen There are two ways to handle this. Setting `repeatsAsScenarios` to `false` means that after the first request, subsequent identical ones will be ignored. -However, when set to `true` (which is the default if omitted), multiple identical requests will be added to a [Scenario](/docs/stateful-behaviour), meaning that when +However, when set to `true` (which is the default if omitted), multiple identical requests will be added to a [Scenario](../stateful-behaviour), meaning that when playing back, a series of requests matching this stub will yield the same series of responses captured during recording. If more requests are made after the end of the series is reached, the last response will continue to be returned. @@ -337,7 +337,7 @@ is reached, the last response will continue to be returned. If you need even more control over how your recorded stubs are generated, you can write one or more custom transformers that will be applied to stubs as they are captured. -A transformer is an implementations of `StubMappingTransformer` and needs to be registered when starting WireMock as described in [Extending WireMock](/docs/extending-wiremock). +A transformer is an implementations of `StubMappingTransformer` and needs to be registered when starting WireMock as described in [Extending WireMock](../extending-wiremock). Transformer implementations supply a name, and this is used to identify them in the `transformers` parameter e.g. diff --git a/_docs/request-matching.md b/_docs/request-matching.md index 709ee4c0..fba41dac 100644 --- a/_docs/request-matching.md +++ b/_docs/request-matching.md @@ -17,7 +17,7 @@ WireMock enables flexible definition of a [mock API](/) by supporting rich match - Request body - Multipart/form-data -Here's an example showing all attributes being matched using WireMock's in-built match operators. It is also possible to write [custom matching logic](/docs/extending-wiremock/#custom-request-matchers) if +Here's an example showing all attributes being matched using WireMock's in-built match operators. It is also possible to write [custom matching logic](../extending-wiremock#custom-request-matchers) if you need more precise control: Java: diff --git a/_docs/response-templating.md b/_docs/response-templating.md index 084197a4..e0b56f9c 100644 --- a/_docs/response-templating.md +++ b/_docs/response-templating.md @@ -57,7 +57,7 @@ wm.stubFor(get(urlPathEqualTo("/templated")) {% endraw %} -Command line parameters can be used to enable templating when running WireMock [standalone](/docs/running-standalone/#command-line-options). +Command line parameters can be used to enable templating when running WireMock [standalone](../running-standalone#command-line-options). ## Template caching @@ -546,7 +546,7 @@ Dates can be truncated to e.g. first day of month using the `truncateDate` helpe {% endraw %} -See the [full list of truncations here](/docs/request-matching/#all-truncations). +See the [full list of truncations here](../request-matching#all-truncations). ## Random value helper diff --git a/_docs/running-standalone.md b/_docs/running-standalone.md index dded9e17..43b4628d 100644 --- a/_docs/running-standalone.md +++ b/_docs/running-standalone.md @@ -48,8 +48,8 @@ sets the keystore password value. The key manager password can be set with the ( `--https-truststore`: Path to a keystore file containing client public certificates, proxy target public certificates & private keys to use when authenticate with a proxy target that require client authentication. Can be a path to a file or a resource on the classpath. See -[HTTPS configuration](/docs/configuration/#https-configuration) -and [Running as a browser proxy](/docs/proxying#running-as-a-browser-proxy) for +[HTTPS configuration](../configuration#https-configuration) +and [Running as a browser proxy](../proxying#running-as-a-browser-proxy) for details. `--truststore-type`: The HTTPS trust store type. Usually JKS or PKCS12. @@ -58,7 +58,7 @@ details. to "password" if not specified. `--https-require-client-cert`: Force clients to authenticate with a -client certificate. See [HTTPS](/docs/https/) for details. +client certificate. See [HTTPS](../https/) for details. `--verbose`: Turn on verbose logging to stdout @@ -66,10 +66,10 @@ client certificate. See [HTTPS](/docs/https/) for details. `__files` reside. This defaults to the current directory. `--record-mappings`: Record incoming requests as stub mappings. See -[Record and Playback](/docs/record-playback/). +[Record and Playback](../record-playback/). `--match-headers`: When in record mode, capture request headers with the -keys specified. See [Record and Playback](/docs/record-playback/). +keys specified. See [Record and Playback](../record-playback/). `--proxy-all`: Proxy all requests through to another base URL e.g. `--proxy-all="http://api.someservice.com"` Typically used in conjunction @@ -91,7 +91,7 @@ internet access via an opaque proxy). e.g. e.g. `--proxy-via http://username:password@webproxy.mycorp.com:8080/`. `--enable-browser-proxying`: Run as a browser proxy. See -[Running as a browser proxy](/docs/proxying#running-as-a-browser-proxy). +[Running as a browser proxy](../proxying#running-as-a-browser-proxy). `--ca-keystore`: A key store containing a root Certificate Authority private key and certificate that can be used to sign generated certificates when @@ -145,7 +145,7 @@ Recommended when using WireMock for performance testing with delays, as it allow Effective only with `asynchronousResponseEnabled=true`. Defaults to 10. `--extensions`: Extension class names e.g. -com.mycorp.HeaderTransformer,com.mycorp.BodyTransformer. See [Extending WireMock](/docs/extending-wiremock/). +com.mycorp.HeaderTransformer,com.mycorp.BodyTransformer. See [Extending WireMock](../extending-wiremock/). `--print-all-network-traffic`: Print all raw incoming and outgoing network traffic to console. @@ -170,9 +170,9 @@ The last of these will cause chunked encoding to be used only when a stub define `--logged-response-body-size-limit`: Set a limit in bytes beyond which response bodies in the log will be truncated. When enabled this helps avoid out of memory errors when serving large response bodies. -`--allow-proxy-targets`: Limit the permitted targets for proxying to and recording from the supplied addressess. This parameter takes a comma-separated list of single IP addresses, IP address ranges and hostname wildcards. See [this article](/docs/configuration/#preventing-proxying-to-and-recording-from-specific-target-addresses) for details. +`--allow-proxy-targets`: Limit the permitted targets for proxying to and recording from the supplied addressess. This parameter takes a comma-separated list of single IP addresses, IP address ranges and hostname wildcards. See [this article](../configuration#preventing-proxying-to-and-recording-from-specific-target-addresses) for details. -`--deny-proxy-targets`: Prevent proxying to and recording from the supplied addressess. This parameter takes a comma-separated list of single IP addresses, IP address ranges and hostname wildcards. Note: if both `--allow-proxy-targets` and this parameter are set, the allow list will be evaluated first. See [this article](/docs/configuration/#preventing-proxying-to-and-recording-from-specific-target-addresses) for details. +`--deny-proxy-targets`: Prevent proxying to and recording from the supplied addressess. This parameter takes a comma-separated list of single IP addresses, IP address ranges and hostname wildcards. Note: if both `--allow-proxy-targets` and this parameter are set, the allow list will be evaluated first. See [this article](../configuration#preventing-proxying-to-and-recording-from-specific-target-addresses) for details. `--proxy-timeout`: Set the timeout for requests to the proxy in milliseconds @@ -215,7 +215,7 @@ $ curl http://localhost:8080/get/this Here it is! ``` -The full stubbing API syntax is described in [Stubbing](/docs/stubbing/). +The full stubbing API syntax is described in [Stubbing](../stubbing/). ## JSON file configuration @@ -246,7 +246,7 @@ $ curl http://localhost:8080/api/mytest More content ``` -See [stubbing](/docs/stubbing/) and [verifying](/docs/verifying/) for more on the JSON API. +See [stubbing](../stubbing/) and [verifying](../verifying/) for more on the JSON API. ### Multi-stub JSON files diff --git a/_docs/running-without-http-server.md b/_docs/running-without-http-server.md index d3c4c752..f18c33ac 100644 --- a/_docs/running-without-http-server.md +++ b/_docs/running-without-http-server.md @@ -7,7 +7,7 @@ redirect_from: "/running-without-http-server.html" description: Running WireMock inside a Java process, without running the inbuilt HTTP layer. --- -If you want to run Wiremock inside another process, such as wrapping it in a serverless function such as on AWS Lambda, or using it as part of an application's integration tests, you previously would need to resort to [Running as a Standalone Process](/docs/running-standalone/). +If you want to run Wiremock inside another process, such as wrapping it in a serverless function such as on AWS Lambda, or using it as part of an application's integration tests, you previously would need to resort to [Running as a Standalone Process](../running-standalone/). This works well, but has the overhead of a full HTTP server and HTTP calls back and forth that in some cases may not be relevant, and adds a fair bit of overhead to each call, and the memory footprint of the application. diff --git a/_docs/stub-metadata.md b/_docs/stub-metadata.md index 6e2dcdc0..bb26958e 100644 --- a/_docs/stub-metadata.md +++ b/_docs/stub-metadata.md @@ -48,7 +48,7 @@ JSON: ## Search for stubs by metadata -Stubs can be found by matching against their metadata using the same matching strategies as when [matching HTTP requests](/docs/request-matching/). +Stubs can be found by matching against their metadata using the same matching strategies as when [matching HTTP requests](../request-matching/). The most useful matcher for this is `matchesJsonPath`: Java: @@ -96,4 +96,4 @@ POST /__admin/mappings/remove-by-metadata ## Remove request journal events by metadata -See [Removing items from the journal](/docs/verifying/#by-criteria) +See [Removing items from the journal](../verifying#by-criteria) diff --git a/_docs/stubbing.md b/_docs/stubbing.md index 889233e0..90a9c8bb 100644 --- a/_docs/stubbing.md +++ b/_docs/stubbing.md @@ -7,8 +7,8 @@ redirect_from: "/stubbing.html" description: A core feature of WireMock is the ability to return canned HTTP responses for requests matching criteria. These are described in detail in Request Matching. --- -A core feature of WireMock [API mocking](/) is the ability to return canned HTTP -responses for requests matching criteria. These are described in detail in [Request Matching](/docs/request-matching/). +A core feature of WireMock [API mocking]({{ '/' | absolute_url }}) is the ability to return canned HTTP +responses for requests matching criteria. These are described in detail in [Request Matching](../request-matching/). ## Basic stubbing diff --git a/_docs/verifying.md b/_docs/verifying.md index 1177b8af..4aee216b 100644 --- a/_docs/verifying.md +++ b/_docs/verifying.md @@ -8,22 +8,22 @@ description: Verifying and querying requests relies on the request journal, whic --- The WireMock server records all requests it receives in memory (at -least until it is [reset](/docs/stubbing#reset)). This makes it possible to verify that +least until it is [reset](../stubbing#reset)). This makes it possible to verify that a request matching a specific pattern was received, and also to fetch the requests' details. Verifying and querying requests relies on the request journal, which is an in-memory log -of received requests. This can be disabled for load testing - see the [Configuration](/docs/configuration/) section for details. +of received requests. This can be disabled for load testing - see the [Configuration](../configuration/) section for details. -Like stubbing, verification also uses WireMock's [Request Matching](/docs/request-matching/) system to filter and query requests. +Like stubbing, verification also uses WireMock's [Request Matching](../request-matching/) system to filter and query requests. ## Verification failures, console output and IntelliJ When verifying via the Java API all failed verifications will result in a `VerificationException` being thrown. -![Verification exception]({{ base_path }}/images/verification-exception.png) +![Verification exception]({{ '/images/verification-exception.png' | absolute_url }}) The message text in the exception is formatted to enable IntelliJ's failure comparison view: -![Comparison failure]({{ base_path }}/images/idea-comparison-failure.png) +![Comparison failure]({{ '/images/idea-comparison-failure.png' | absolute_url }}) ## Verifying in Java @@ -37,7 +37,7 @@ verify(postRequestedFor(urlEqualTo("/verify/this")) The criteria part in the parameter to `postRequestedFor()` uses the same builder as for stubbing, so all of the same predicates are available. -See [Stubbing](/docs/stubbing/) for more details. +See [Stubbing](../stubbing/) for more details. To check for a precise number of requests matching the criteria, use this form: @@ -302,7 +302,7 @@ POST /__admin/requests/remove-by-metadata } ``` -For more info about stub metadata see [Stub Metadata](/docs/stub-metadata/) +For more info about stub metadata see [Stub Metadata](../stub-metadata/) ## Resetting the request journal diff --git a/_docs/webhooks-and-callbacks.md b/_docs/webhooks-and-callbacks.md index 8bd26b8a..ea5cc6c4 100644 --- a/_docs/webhooks-and-callbacks.md +++ b/_docs/webhooks-and-callbacks.md @@ -113,7 +113,7 @@ JSON: ## Using data from the original request -Webhooks use the same [templating system](/docs/response-templating/) as WireMock responses. This means that any of the +Webhooks use the same [templating system](../response-templating/) as WireMock responses. This means that any of the configuration fields can be provided with a template expression which will be resolved before firing the webhook. Similarly to response templates the original request data is available, although in this case it is named `originalRequest`. @@ -232,7 +232,7 @@ JSON: ## Adding delays -A fixed or random delay can be added before the webhook call is made, using the same style of [delay parameters as stubs](/docs/simulating-faults/). +A fixed or random delay can be added before the webhook call is made, using the same style of [delay parameters as stubs](../simulating-faults/). ### Fixed delays diff --git a/_includes/archive-single.html b/_includes/archive-single.html index f3eeff3a..41e07c75 100644 --- a/_includes/archive-single.html +++ b/_includes/archive-single.html @@ -1,4 +1,3 @@ -{% include base_path %} {% if post.header.teaser %} {% capture teaser %}{{ post.header.teaser }}{% endcapture %} @@ -10,7 +9,7 @@ {% if post.link %} {% else %} - + {% endif %}
@@ -20,7 +19,7 @@ {% if teaser contains "://" %} "{{ teaser }}" {% else %} - "{{ teaser | prepend: "/images/" | prepend: base_path }}" + "{{ teaser | prepend: "/images/" | absolute_url }}" {% endif %} alt=""> diff --git a/_includes/author-profile.html b/_includes/author-profile.html index e4b601f0..607dfd18 100644 --- a/_includes/author-profile.html +++ b/_includes/author-profile.html @@ -1,4 +1,3 @@ -{% include base_path %} {% if page.author %} {% assign author = site.data.authors[page.author] %}{% else %}{% assign author = site.author %} @@ -10,7 +9,7 @@ {% if author.avatar contains "://" %} {{ author.name }} {% else %} - {{ author.name }} + {{ author.name }} {% endif %} diff --git a/_includes/base_path b/_includes/base_path deleted file mode 100644 index 8c7dc62b..00000000 --- a/_includes/base_path +++ /dev/null @@ -1 +0,0 @@ -{% capture base_path %}{{ site.url }}{{ site.baseurl }}{% endcapture %} \ No newline at end of file diff --git a/_includes/breadcrumbs.html b/_includes/breadcrumbs.html index ded8bd6e..ee59e1f1 100644 --- a/_includes/breadcrumbs.html +++ b/_includes/breadcrumbs.html @@ -1,4 +1,3 @@ -{% include base_path %} {% case site.categories.type %} {% when "liquid" %} @@ -21,7 +20,7 @@ {% for crumb in crumbs offset: 1 %} {% if forloop.first %}
  • - {{ site.data.ui-text[site.locale].breadcrumb_home_label }} + {{ site.data.ui-text[site.locale].breadcrumb_home_label }}
  • {{ site.data.ui-text[site.locale].breadcrumb_separator }} @@ -31,7 +30,7 @@ {% else %} {% assign i = i | plus: 1 %}
  • - {{ crumb | replace: '-', ' ' | replace: '%20', ' ' | capitalize }} + {{ crumb | replace: '-', ' ' | replace: '%20', ' ' | capitalize }}
  • {{ site.data.ui-text[site.locale].breadcrumb_separator }} diff --git a/_includes/category-list.html b/_includes/category-list.html index 77b13547..2f52c3e4 100644 --- a/_includes/category-list.html +++ b/_includes/category-list.html @@ -1,6 +1,3 @@ -{% include base_path %} - -{% include base_path %} {% case site.category_archive.type %} {% when "liquid" %} @@ -23,7 +20,7 @@ {% for hash in category_hashes %} {% assign keyValue = hash | split: '#' %} {% capture category_word %}{{ keyValue[1] | strip_newlines }}{% endcapture %} - {% unless forloop.last %}, {% endunless %} + {% unless forloop.last %}, {% endunless %} {% endfor %}

    diff --git a/_includes/comments-providers/discourse.html b/_includes/comments-providers/discourse.html index 1d23b6f2..a6527569 100644 --- a/_includes/comments-providers/discourse.html +++ b/_includes/comments-providers/discourse.html @@ -1,6 +1,6 @@ {% if site.comments.discourse.server %} -{% include base_path %} -{% capture canonical %}{{ base_path }}{% if site.permalink contains '.html' %}{{ page.url }}{% else %}{{ page.url | remove:'index.html' | strip_slash }}{% endif %}{% endcapture %} + +{% capture canonical %}{% if site.permalink contains '.html' %}{{ page.url | absolute_url }}{% else %}{{ page.url | remove:'index.html' | strip_slash | absolute_url }}{% endif %}{% endcapture %} - + + - - - + + + diff --git a/_includes/gallery b/_includes/gallery index d8454145..cc6b9737 100644 --- a/_includes/gallery +++ b/_includes/gallery @@ -1,4 +1,3 @@ -{% include base_path %} {% if include.id %} {% assign gallery = page.[include.id] %} @@ -23,7 +22,7 @@ {% if img.url contains "://" %} "{{ img.url }}" {% else %} - "{{ img.url | prepend: "/images/" | prepend: base_path }}" + "{{ img.url | prepend: "/images/" | absolute_url }}" {% endif %} {% if img.title %}title="{{ img.title }}"{% endif %} > @@ -31,7 +30,7 @@ {% if img.image_path contains "://" %} "{{ img.image_path }}" {% else %} - "{{ img.image_path | prepend: "/images/" | prepend: base_path }}" + "{{ img.image_path | prepend: "/images/" | absolute_url }}" {% endif %} alt="{% if img.alt %}{{ img.alt }}{% endif %}"> @@ -40,7 +39,7 @@ {% if img.image_path contains "://" %} "{{ img.image_path }}" {% else %} - "{{ img.image_path | prepend: "/images/" | prepend: base_path }}" + "{{ img.image_path | prepend: "/images/" | absolute_url }}" {% endif %} alt="{% if img.alt %}{{ img.alt }}{% endif %}"> {% endif %} diff --git a/_includes/head.html b/_includes/head.html index c7e69d96..081ded1b 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -1,4 +1,3 @@ -{% include base_path %} @@ -9,7 +8,7 @@ {% include clarity.html %} {% include plausible.html %} - + @@ -26,8 +25,8 @@ - + - + diff --git a/_includes/masthead.html b/_includes/masthead.html index 21162333..d21756b9 100644 --- a/_includes/masthead.html +++ b/_includes/masthead.html @@ -1,4 +1,3 @@ -{% include base_path %}