Get test reports with Maven plugin


Restlet Client allows you to use exported tests as an input for Maven plugin which generates JUnit-like reports and allows you to hook custom URLs where to get notified before or/and after a unit test is completed.

Get started in seconds

Open the project, service or scenario you want to test and click on the Export to maven button.

All you have to do then is download the full package, extract it and run mvn test in the extracted folder.

More configuration options

Choose the requests to run

The maven plugin takes a JSON configuration file as a parameter and runs it. That configuration file really is just an export of your repository or a subset of it.

If you want to run a specific set of tests, you can click on export on the bottom of the left panel of the Requests view, tab Repository and check the boxes that match the requests/scenarios etc... you want to run.

Place the downloaded JSON near the pom.xml you downloaded (see get started) and make sure to configure the pom.xml to use that JSON file (more information on that below).

POM example

<project xmlns="" xmlns:xsi="" xsi:schemaLocation="">




      <name>Nexus Release Repository</name>

Plugin configuration

This Maven plugin comes with a number of parameters to tweak its behavior.

Name Type Mandatory Default Description
file File Yes X file path pointing to the Restlet Client export file
selectedEnvironment String No X a name of an environment to be used
licenseKey String Yes X A valid license key (see the "Get a license key" paragraph below)
stopOnFailure Boolean No False stops processing build if an error/failure occurs
httpClientTimeoutInMs Integer False 60000 Time before HTTP time-out in milliseconds
variables Properties No X custom variables
xhrEmulation Boolean No True adds headers like accept-*
beforeTest URL No X URL where to send a notification before a test starts
afterTest URL No X URL where to send a notification after a test is completed
begin URL No X URL where to send a notification before first test is executed
end URL No X URL where to send a notification after last test is completed

To change them, modify the tag configuration in your pom.xml, see a configuration example below.


Get a license key

At start, the Restlet Client Maven plugin checks whether the user has recorded a license key. In case the license is missing or invalid, the user is asked to get one and configure it. Such license key is granted to users that purchase a team plan or above, and can be found in the Billing page.

Just copy/paste this value as the licenseKey parameter of the pom.xml file:

Get license key

In-build API test use case

The following examples will focus on the configuration block which can be found in the previous example.

Use a specific environment

In Restlet Client, a consistent set of variables is called an "environment". The user is able to setup several environments (for example, one for the production environment, one for the local environment, etc). If this functionality was used to build the scenario then it is possible to indicate to the maven-plugin which environment should be used.

For instance if a scenario is based on the localhost environment then the following configuration block would be used:


Override environment variables

The user can also override an environment variable.

Let's imagine that the API port is not the same on the test environment as on the development environment, then it is possible to override the environment port variable to provide the right value: 13337.

This is done by using the following configuration:


Notifications format

Before/After test notifications

POST [url]
Content-Type: application/json
   “name” : [test name],
   “event” : [BeforeTest|AfterTest],
   “result” : [Ok|Failure|Error] 	<- present only if event=afterTest

Begin/End notifications

POST [url]
Content-Type: application/json
   “event” : [Begin|End]