Version: 21.11 (EOL)
POST Run Unit Test
Run a service's automated unit test.
Request
HTTP request
POST https://<JM_SERVER>/manager/secure/rest/service-definitions/v1/run-unit-test/
Parameters
This request takes no parameters.
Request body
The POST request parameters include:
- serviceName: Required. The name of a service definition to run.
- versionNumber: A service version number. Use of this parameter is highly recommended to resolve the correct service version.
- clientCode: An organization client code. Use of this parameter is highly recommended to resolve the correct organization service.
Example
This example runs the unit test for the 'Hello World' version 1 service.
Ensure you specify Content-Type: application/x-www-form-urlencoded.
POST /manager/secure/rest/service-definitions/v1/run-unit-test/ HTTP/1.1
Host: https://transact.maguire.com
Content-Type: application/x-www-form-urlencoded
serviceName=Hello World&versionNumber=1&clientCode=maguire
Response
If successful, this operation returns a response with a HTTP 200 OK status code.
Example
This is an example response of a successful service unit test.
{
  "serviceName": "Hello World",
  "versionNumber": 1,
  "testStatus": "Success",
  "message": "Test succeeded in 49 ms",
  "logger": "21:24:21,034 INFO  groovy result"
}
This is an example response of a service unit test failure.
{
  "serviceName": "Hello World",
  "versionNumber": 1,
  "testStatus": "Failure",
  "message": "Test failed after 741 ms",
  "errorCause": "java.lang.NullPointerException",
  "errorLine": 19
}