Version

    Testing

    Testing Service Logic in Designer

    Testing Services Deployed on Server

    Testing Service Logic in Designer

    You may want to test your service logic iteratively as you develop it in CloverDX Designer. It is possible to launch the logic and simulate an incoming request without publishing the logic to CloverDX Server.

    Under Run  Run Configurations…​  CloverDX Data Service REST Job you can set incoming HTTP parameters, HTTP headers as well as request payload.

    After executing the service, the HTTP response including the serialized payload will be shown in the job execution log, so you can inspect it in the Console window.

    data service 3720
    Figure 318. Run Configuration of Data Services

    The result of the test run can be seen in console in Designer.

    data service 3730
    Figure 319. Data Service test result in console

    Testing Services Deployed on Server

    Once deployed, the service endpoint starts receiving requests so you can invoke it directly.

    Note that there is no ‘simulation’ mode available, incoming request will execute the live logic of the service.

    From generated documentation

    The automatically generated documentation of the service contains a Try it out button, which shows the web UI to test the service and will reflect required parameters and after invocation will parse the response and show all headers and status code returned.

    If you want to simplify testing of the service for your endpoint consumers, it is advisable to include example input payloads or combination of parameters in the Documentation section of your service.

    Testing using curl or wget

    For quick and dirty tests, you can invoke the endpoint using curl or wget utilities.

    The auto-generated documentation actually displays the correct curl command-line syntax after you test it using the Try it out button.

    If you use wget to query the Data Service and the Data Services requires authentication, you can realize that two queries have been performed: the first one without credentials and second with credentials. Therefore, you can see one success and one failure in the list of Data Services in server console.