Skip to main content
This IDE plugin provides support for various WireMock OSS features as well as integration with WireMock Cloud.

Install the WireMock plugin

The plugin is available on the JetBrains Marketplace.
The WireMock plugin is not available in IntelliJ IDEA Community Edition.
  1. Press ⌘Сmd, on Mac or CtrlAltS on other platforms to open settings and then select Plugins.
  2. Open the Marketplace tab, find the WireMock plugin, and click Install (restart the IDE if prompted).

Setup

The WireMock plugin comes with features that utilize users’ existing WireMock Cloud accounts and integrates local files with them, e.g. creating remote mock APIs from local stub mappings. So, if you have a WireMock Cloud account and want to connect to it and use Cloud specific features, head to the plugin settings at Settings | Tools | WireMock and log in to your account. Otherwise, no specific setup is required.

Log in to WireMock Cloud

When WireMock is first installed, it is necessary to log in to your WireMock Cloud account, in order to be able to use related features. Logging in can happen at two different locations: via an editor notification after opening stub mappings files, or from the plugin’s settings UI.
Credentials are stored safely by the IDE (on the IDE level), so
  • they are completely separate from any WireMock CLI installation on the system,
  • and if you are using the plugin in multiple IDEs, you have to log in in each of them.

From the editor notification

Upon opening a stub mapping JSON file, the following notification appears at the top of the editor. It provides a way to create an account if you haven’t already, or to use your existing account. WireMock Cloud editor notification when not logged in To start the login process, click on the Log in link. This performs two things:
  • shows a balloon popup with your verification code
  • opens the login page in your web browser showing you a verification code
In case the page would not open, you can copy the verification URL from the popup. WireMock Cloud authentication confirmation balloon Make sure that the two codes match, then confirm the device code. In a few seconds the IDE will show you another balloon confirming your login.

From the plugin settings

You can also log in to your account via the plugin settings at Settings | Tools | WireMock. The flow is similar to the one described in the previous section, but it is handled entirely on the settings UI, and you also have the option to Cancel Login. WireMock Cloud settings not logged in When the login is successful, the UI will show you the email address you are logged in with, or will notify you if a problem occurred during the login.

Use with On-Premise Edition

The plugin also supports work with the on-premise edition of WireMock Cloud. To turn on this feature, enable the Use with On-Premise Edition option, update the necessary configuration values, and log in. If you are already logged into a different installment of WireMock Cloud, make sure to log out, save the settings, and log in again. WireMock Cloud settings on-premise

Create mock APIs and import stubs

If you want to convert local stub mappings to remotely hosted WireMock Cloud mock APIs, you can do so: open a stub mapping file, then click on the Create mock API link in the top notification, or the icon in the floating toolbar. WireMock Cloud create mock API options
These actions are shown only when you are logged in to a WireMock Cloud account.
This will display a dialog (detailed in the sections below) to specify the properties of the new mock API. Submitting the dialog creates an empty, remote mock API with the specified name and custom hostname, and immediately imports/uploads the stubs from the open mapping file into that new API.

Mock API properties and types

When you initiate the mock API creation, you are presented with a dialog to specify the API name, an optional custom hostname and the type of the API to create. WireMock Cloud create mock API dialog The following API types are supported:
  • Unstructured (WireMock)
  • REST
  • GraphQL (+ non-federated schema)
  • gRPC (+ descriptor file)
If you choose GraphQL or gRPC you must also upload a schema/descriptor file with them. Creating a mock API without them is not permitted. WireMock Cloud create mock API with GraphQL

Completion of the API creation

The creation of the mock API and data upload into it is performed in two or three separate phases depending on the API type:
  • API creation and stub upload for Unstructured and REST,
  • API creation, stub upload and schema/descriptor upload for GraphQL and gRPC
Thus, when all phases finish without any issue, a separate balloon notification appears for each phase. The first one also provides a link with which you can easily open the new API in your browser. WireMock Cloud create mock API with GraphQL If any phase fails for any reason, notifications with appropriate messages will let you know of the failure and the reason of it.