Integrating Microcks using API

Services API

Model

{
  "service": {
    "id":"591463bed6018000012d1272",
    "name":"HelloService Mock",
    "version":"0.9",
    "xmlNS":"http://www.example.com/hello",
    "type":"SOAP_HTTP",
    "operations":[
      {
        "name":"sayHello",
        "method":null,
        "inputName":"sayHello",
        "outputName":"sayHelloResponse",
        "dispatcher":"QUERY_MATCH",
        "dispatcherRules":"declare namespace ser='http://www.example.com/hello';\n//ser:sayHello/name",
        "defaultDelay":null,
        "resourcePaths":null
      }
    ]
  },
  "messagesMap":{
    "sayHello":[
      {
        "request":{
          "name":"Karla Request",
          "content":"<soapenv:Envelope ...</soapenv:Envelope>",
          "operationId":"591463bed6018000012d1272-sayHello",
          "headers":null,
          "id":"5915bff04cedfd0001a5b60f",
          "responseId":"5915bff04cedfd0001a5b60d",
          "queryParameters":null
        },
        "response":{
          "name":"Karla Response",
          "content":"<soapenv:Envelope ...</soapenv:Envelope>",
          "operationId":"591463bed6018000012d1272-sayHello",
          "headers":null,
          "id":"5915bff04cedfd0001a5b60d",
          "status":null,
          "mediaType":null,
          "dispatchCriteria":"Karla",
          "fault":false
        }
      },
      {...}
    ]
  }
}

Endpoint

Base : http://host:port/api/services
Verb URL Params Description
GET /services/{id} id: Unique identifier of this service Get the details of the service: the full model shown above

Tests API

Model

{
  "id":"5919d9014cedfd0001a5b61c",
  "testNumber":1,
  "testDate":1494866177868,
  "testedEndpoint":"http://10.130.6.226:8088/mockHelloService",
  "serviceId":"591463bed6018000012d1272",
  "elapsedTime":19,
  "success":true,
  "inProgress":false,
  "runnerType":"HTTP",
  "testCaseResults":[
    {
      "success":true,
      "elapsedTime":19,
      "operationName":"sayHello",
      "testStepResults":[
        {
          "success":true,
          "elapsedTime":16,
          "requestName":"Karla Request",
          "message":"200"
        },
        {
          "success":true,
          "elapsedTime":3,
          "requestName":"Andrew Request",
          "message":"200"
        }
      ]
    }
  ]
}

Endpoint

Base : http://host:port/api/tests
Verb URL Params/Body Description
POST /tests application/json body to specify a test configuration: {"serviceId":"591463bed6018000012d1272", "testEndpoint":"http://10.130.6.226:8088/mockHelloService", "runnerType":"HTTP"}. serviceId: the unique id of Service to test, testEndpoint: the endpoint where Service to test has been deployed, runnerType: the type of test to run against endpoint Create and launch a new test just with these 3 parameters. Uncomplete Test entity is returned with created id. Test is actually run asynchronously so you should call the GET method later to get test results
GET /tests/{id} id: Unique identifier of this test Get the details of the test: the full model shown above