In the upper right of the z/OS Connect Designer window, click
Test.
Figure 1. Location of the Test button.
The Open Liberty REST Client opens your OpenAPI definition in a new tab in your browser, ready to be
tested.
Table 1. Test API button status
Indication
Status
Enabled. Click the button to test your API.
Button is unavailable with a loading indicator. The project build is
running.
Button is unavailable with an error indicator. The project build failed. Hover
over the button to see error information. For example,
Figure 2. The Open Liberty REST Client available
from the Liberty server with your OpenAPI definition
loaded.
The Open Liberty REST Client lists the paths of
your z/OS Connect API that are available to test. The
Open Liberty REST Client acts as an HTTP client to
test your OpenAPI by sending a RESTful request to
your resources.
Test the GET /phonebook/contacts/{lastName} operation.
Click anywhere on the GET /phonebook/contacts/{lastName} operation
bar to expand the GET /phonebook/contacts/{lastName} operation.
Figure 3. Information about the GET /phonebook/contacts/{lastName} operation to
be tested.
In the expanded operation section, you see the parameters that you can select. For example,
firstName.
Click Try it out in the upper right of the operation
section.
Figure 4. The location of the Try it out button in the Open Liberty REST Client.
Enter any name that exists in the phone book in the lastName
field.
Smith
Click Execute.
Figure 5 shows the result of a successful
test. An unsuccessful test result is shown in Figure 6.
Figure 5. A successful test result.
Figure 6. A test result when the lastName is not in the
phonebook
You can also test your API in other REST Clients.
Your API is hosted on your local workstation from a z/OS Connect server that is exposed as
https://localhost:9443/phonebook/contacts/Smith.
You can use this URL in any REST client of your choice and it returns successful responses. If a
REST client is not available to you, use the Open Liberty REST Client within the Liberty server as
demonstrated here. The Liberty server client is part of the ibm-zcon-designer
image.
Results
You successfully tested your API.
What to do next
You can now continue to test with different mappings and explore the power of JSONata.